This commit is contained in:
李鹏飞 2025-09-24 17:32:36 +08:00
commit b41ed9caef
19 changed files with 807 additions and 121 deletions

View File

@ -369,6 +369,7 @@
<Compile Include="CQMS\WBS\WorkPackageParentDetailService.cs" />
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
<Compile Include="DCGL\ServerCheck\DCGLCheckNoticeItemService.cs" />
<Compile Include="DCGL\ServerCheck\DCGLCheckRectifyItemService.cs" />
<Compile Include="DCGL\ServerCheck\DCGLCheckRectifyService.cs" />
<Compile Include="DigData\CQMSDataCollectService.cs" />

View File

@ -73,6 +73,11 @@ namespace BLL
}
}
/// <summary>
/// 服务器路径
/// </summary>
public static string AttachRootPath { get; set; }
/// <summary>
/// 系统名称
/// </summary>

View File

@ -0,0 +1,39 @@
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 督查检查整改明细表
/// </summary>
public static class DCGLCheckNoticeItemService
{
/// <summary>
/// 根据主键获取督查检查整改明细信息
/// </summary>
/// <param name="checkRectifyItemId"></param>
/// <returns></returns>
public static Model.DCGL_Check_CheckInfo_TableNoticeItem GetCheckNoticeItemByCheckNoticeItemId(string checkNoticeItemId)
{
return Funs.DB.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(e => e.ID == checkNoticeItemId);
}
/// <summary>
/// 添加督查检查整改明细信息
/// </summary>
/// <param name="CheckNoticeItem"></param>
public static void UpdateCheckNoticeItem(Model.DCGL_Check_CheckInfo_TableNoticeItem CheckNoticeItem)
{
var newCheckNoticeItem = Funs.DB.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(x => x.ID == CheckNoticeItem.ID);
if (newCheckNoticeItem != null)
{
newCheckNoticeItem.Situation = CheckNoticeItem.Situation;
Funs.DB.SubmitChanges();
}
}
}
}

View File

@ -55,6 +55,8 @@ namespace BLL
newPlan.CompletedCount = plan.CompletedCount;
newPlan.CompletedRate = plan.CompletedRate;
newPlan.TotalCompletedRate = plan.TotalCompletedRate;
newPlan.OnDayCompleteDyne = plan.OnDayCompleteDyne;
newPlan.NextDayCompleteDyne = plan.NextDayCompleteDyne;
db.HJGL_ProductionSchedulingPlan.InsertOnSubmit(newPlan);
db.SubmitChanges();
}

View File

@ -640,9 +640,9 @@ namespace BLL
/// <param name="flowingSection">流水段</param>
/// <param name="steelType">材质</param>
/// <param name="caliber">口径</param>
/// <param name="type">1-达因2-完成达因</param>
/// <param name="type">1-达因2-完成达因</param>
/// <returns></returns>
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber,string type)
public static decimal? GetSizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber, string type)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
@ -654,39 +654,41 @@ namespace BLL
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
//&& Convert.ToInt32(x.DNDia.Substring(2, x.DNDia.Length - 2)) < c
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
select x);
foreach (var item in weldjoints)
{
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
{
if (type == "1")
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
if (type == "1")
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
sizeSum += item.Size;
}
}
}
}
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
if (type == "1")
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
if (type == "1")
{
sizeSum += item.Size;
}
else
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
sizeSum += item.Size;
}
}
}
}
}
@ -695,14 +697,14 @@ namespace BLL
}
/// <summary>
/// 根据单位工程、流水段获取总达因
/// 根据单位工程、流水段获取优先级总达因、完成总达因
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="unitWorkId">单位工程</param>
/// <param name="flowingSection">流水段</param>
/// <param name="type">1-总达因2-完成总达因</param>
/// <returns></returns>
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection,string type)
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSection(string projectId, string unitWorkId, string flowingSection, string type)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
@ -710,7 +712,7 @@ namespace BLL
{
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
select x.Size).Sum();
@ -719,7 +721,7 @@ namespace BLL
{
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
//join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
&& x.WeldingDailyId != "" && x.WeldingDailyId != null
@ -727,5 +729,85 @@ namespace BLL
}
return sizeSum;
}
/// <summary>
/// 根据单位工程、流水段、材质获取总达因(按材质)
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="unitWorkId">单位工程id</param>
/// <param name="flowingSection">流水号</param>
/// <param name="material">材质</param>
/// <returns></returns>
public static decimal? GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(string projectId, string unitWorkId, string flowingSection, string steelType)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
sizeSum = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
&& z.SteelType == steelType
select x.Size).Sum();
return sizeSum;
}
/// <summary>
/// 获取当日已完成量
/// </summary>
/// <param name="projectId"></param>
/// <param name="unitWorkId"></param>
/// <param name="flowingSection"></param>
/// <param name="steelType"></param>
/// <param name="caliber"></param>
/// <returns></returns>
public static decimal? GetCurrentDaySizeSum(string projectId, string unitWorkId, string flowingSection, string steelType, string caliber)
{
Model.SGGLDB db = Funs.DB;
decimal? sizeSum = 0;
int c = 0;
if (!string.IsNullOrEmpty(caliber))
{
c = Convert.ToInt32(caliber.Substring(1, caliber.Length - 1));
var weldjoints = (from x in db.HJGL_WeldJoint
join y in db.HJGL_Pipeline on x.PipelineId equals y.PipelineId
join z in db.Base_Material on y.MaterialId equals z.MaterialId
where x.ProjectId == projectId && y.UnitWorkId == unitWorkId && y.FlowingSection == flowingSection && z.SteelType == steelType
&& y.PipeArea == "1" && x.JointAttribute == "预制口"
select x);
foreach (var item in weldjoints)
{
if (!string.IsNullOrEmpty(item.DNDia) && item.DNDia != null)
{
int s = Convert.ToInt32(item.DNDia.Substring(2, item.DNDia.Length - 2));
if (caliber.Substring(0, 1) == "<" && s < c)
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
{
sizeSum += item.Size;
}
}
}
else if (caliber.Substring(0, 1) == "≥" && s >= c)
{
if (!string.IsNullOrEmpty(item.WeldingDailyId))
{
var weldingDaily = BLL.WeldingDailyService.GetPipeline_WeldingDailyByWeldingDailyId(item.WeldingDailyId);
if (weldingDaily != null && weldingDaily.WeldingDate.HasValue && weldingDaily.WeldingDate.Value.ToShortDateString() == DateTime.Now.ToShortDateString())
{
sizeSum += item.Size;
}
}
}
}
}
}
return sizeSum;
}
}
}

View File

@ -5,11 +5,52 @@ using System.Text;
using System.Collections;
using System.IO;
using System.Web;
using System.Text.RegularExpressions;
using System.Net;
namespace BLL
{
public static class FileInsertService
{
/// <summary>
/// 获取服务器图片转byte
/// </summary>
/// <param name="fileHost"></param>
/// <param name="attachUrl"></param>
/// <returns></returns>
public static List<byte[]> FilePathTransStream(string fileHost, string attachUrl)
{
List<byte[]> bytes = new List<byte[]>();
var strs = attachUrl.Trim().Split(',');
try
{
foreach (var fileUrl in strs)
{
string filepath = $"{fileHost}{fileUrl}";
// 创建WebClient实例
using (WebClient webClient = new WebClient())
{
// 下载图片并保存到内存流
using (MemoryStream ms = new MemoryStream(webClient.DownloadData(filepath)))
{
// 将MemoryStream转换为byte数组
byte[] imageBytes = ms.ToArray();
bytes.Add(imageBytes);
//// 使用byte数组例如保存到文件或进行其他处理
//File.WriteAllBytes("localImage.jpg", imageBytes);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
return bytes;
}
/// <summary>
/// 获取附件数据流类
/// </summary>
@ -19,7 +60,7 @@ namespace BLL
{
if (fileContextList != null && fileContextList.Count > 0)
{
string physicalpath = Funs.RootPath;
string physicalpath = Funs.AttachRootPath;
//HttpContext.Current.Request.PhysicalApplicationPath;
string fullPath = physicalpath + attachUrl;
if (!File.Exists(fullPath))
@ -61,18 +102,29 @@ namespace BLL
{
if (strs.Count() > i)
{
string physicalpath = Funs.RootPath;
//HttpContext.Current.Request.PhysicalApplicationPath;
string fullPath = physicalpath + strs[i];
string physicalpath = Funs.AttachRootPath;
string fpath = strs[i];
string fullPath = physicalpath + fpath;
if (!File.Exists(fullPath))
{
byte[] fileContext = item;
int index = fullPath.LastIndexOf("\\");
string filePath = fullPath.Substring(0, index);
string fileName = Regex.Match(fullPath, @"[^/\\?]+(\?.*)?$").Value;
string filePath = fullPath.Replace(fileName, "");
//int index = fullPath.LastIndexOf("\\");
//string filePath = fullPath.Substring(0, index) ;
//string filePath = index > 0 ? fullPath.Substring(0, index) : fullPath;
if (!Directory.Exists(filePath))
try
{
Directory.CreateDirectory(filePath);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog($"附件【{filePath}】获取异常!");
//continue;
}
//string savePath = fullPath + fileName;
@ -125,7 +177,7 @@ namespace BLL
if (attachFile.AttachUrl != attachUrl)
{
///删除附件文件
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
BLL.UploadAttachmentService.DeleteFile(Funs.AttachRootPath, attachFile.AttachUrl);
////插入附件文件
BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
attachFile.AttachSource = attachSource;
@ -134,5 +186,45 @@ namespace BLL
}
}
}
/// <summary>
/// 数据和附件插入到多附件表【不存实际文件,只存地址】
/// </summary>
public static void InsertAttachFileRecord(string attachFileId, string dataId, string attachSource, string attachUrl)
{
var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.AttachFileId == attachFileId);
if (getAtt != null)
{
Funs.DB.AttachFile.DeleteOnSubmit(getAtt);
Funs.DB.SubmitChanges();
}
//多附件
var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == dataId);
if (attachFile == null && !string.IsNullOrEmpty(attachSource))
{
Model.AttachFile newAttachFile = new Model.AttachFile
{
AttachFileId = attachFileId,
ToKeyId = dataId,
AttachSource = attachSource,
AttachUrl = attachUrl
};
Funs.DB.AttachFile.InsertOnSubmit(newAttachFile);
Funs.DB.SubmitChanges();
}
else
{
if (attachFile.AttachUrl != attachUrl)
{
///删除附件文件
BLL.UploadAttachmentService.DeleteFile(Funs.AttachRootPath, attachFile.AttachUrl);
attachFile.AttachSource = attachSource;
attachFile.AttachUrl = attachUrl;
Funs.DB.SubmitChanges();
}
}
}
}
}

View File

@ -13,10 +13,12 @@ namespace FineUIPro.Web.DCGL.ServerCheck
{
public partial class CheckRectify : PageBase
{
private static string proType;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
proType = Request.Params["proType"] ?? string.Empty;
this.GetButtonPower();
//btnNew.OnClientClick = Window1.GetShowReference("CheckRectifyEdit.aspx") + "return false;";
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
@ -30,15 +32,19 @@ namespace FineUIPro.Web.DCGL.ServerCheck
/// </summary>
private void BindGrid()
{
string strSql = string.Empty;
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT S.CheckRectifyId,S.CheckRectifyCode,S.ProjectId,S.ProjectName,S.UnitId,U.UnitName,S.CheckDate,CASE S.HandleState WHEN '{BLL.Const.State_1}' THEN '未签发' WHEN '{BLL.Const.State_2}' THEN '未上报' ELSE '已上报' END AS HandleState,
S.IssueMan,S.IssueDate,ISNULL(TotalCount.TotalCount,0) AS TotalCount ,ISNULL(CompleteCount.CompleteCount,0) AS CompleteCount,(ISNULL(TotalCount.TotalCount,0) -ISNULL(CompleteCount.CompleteCount,0)) AS UnCompleteCount ");
sb.Append("FROM dbo.DCGL_Check_CheckRectify AS S LEFT JOIN dbo.Base_Unit AS U ON U.UnitId = S.UnitId ");
sb.Append(" LEFT JOIN (SELECT COUNT(*) AS TotalCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem GROUP BY CheckRectifyId) AS TotalCount ON S.CheckRectifyId=TotalCount.CheckRectifyId ");
sb.Append(" LEFT JOIN (SELECT COUNT(*) AS CompleteCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem WHERE RealEndDate IS NOT NULL GROUP BY CheckRectifyId) AS CompleteCount ON S.CheckRectifyId=CompleteCount.CheckRectifyId ");
if (!string.IsNullOrWhiteSpace(proType) && proType == "1")
{//只查询本项目检查数据
sb.Append($"WHERE S.ProjectId='{this.CurrUser.LoginProjectId}' ");
}
sb.Append("ORDER BY HandleState");
SqlParameter[] parameter = new SqlParameter[] { };
strSql = "SELECT S.CheckRectifyId,S.CheckRectifyCode,S.ProjectId,S.ProjectName,S.UnitId,U.UnitName,S.CheckDate,CASE S.HandleState WHEN '" + BLL.Const.State_1 + "' THEN '未签发' WHEN '" + BLL.Const.State_2 + "' THEN '未上报' ELSE '已上报' END AS HandleState,"
+ @" S.IssueMan,S.IssueDate,ISNULL(TotalCount.TotalCount,0) AS TotalCount ,ISNULL(CompleteCount.CompleteCount,0) AS CompleteCount,(ISNULL(TotalCount.TotalCount,0) -ISNULL(CompleteCount.CompleteCount,0)) AS UnCompleteCount"
+ @" FROM dbo.DCGL_Check_CheckRectify AS S LEFT JOIN dbo.Base_Unit AS U ON U.UnitId = S.UnitId"
+ @" LEFT JOIN (SELECT COUNT(*) AS TotalCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem GROUP BY CheckRectifyId) AS TotalCount ON S.CheckRectifyId=TotalCount.CheckRectifyId"
+ @" LEFT JOIN (SELECT COUNT(*) AS CompleteCount, CheckRectifyId FROM dbo.DCGL_Check_CheckRectifyItem WHERE RealEndDate IS NOT NULL GROUP BY CheckRectifyId) AS CompleteCount ON S.CheckRectifyId=CompleteCount.CheckRectifyId"
+ @" ORDER BY HandleState";
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
DataTable tb = SQLHelper.GetDataTableRunText(sb.ToString(), parameter);
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
@ -365,7 +371,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck
#endregion
#endregion
/// <summary>
/// 从集团获取
/// </summary>
@ -387,8 +393,9 @@ namespace FineUIPro.Web.DCGL.ServerCheck
#region
/// <summary>
/// 获取
/// 获取督查检查整改
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
@ -397,7 +404,239 @@ namespace FineUIPro.Web.DCGL.ServerCheck
var responeData = new Model.ResponeData();
try
{
string unitId =BLL.Const.UnitId_SEDIN;
string unitId = BLL.Const.UnitId_SEDIN;
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/getDCGLCheckInfoRectify?unitId=" + unitId;
string contenttype = "application/json;charset=unicode";
Hashtable newToken = new Hashtable
{
{ "token", ServerService.GetToken().Token }
};
var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
if (!string.IsNullOrEmpty(strJosn))
{
JObject obj = JObject.Parse(strJosn);
responeData.code = Funs.GetNewIntOrZero(obj["code"].ToString());
responeData.message = obj["message"].ToString();
if (responeData.code == 1)
{
JArray getData = JArray.Parse(obj["data"].ToString());
if (getData.Count() > 0)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<string> ids = new List<string>();
foreach (var item in getData)
{
string getCheckRectifyId = item["CheckRectifyId"].ToString();
if (!ids.Contains(getCheckRectifyId))
{
var newRectify = db.DCGL_Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == getCheckRectifyId);
if (newRectify == null)
{
ids.Add(getCheckRectifyId);
Model.DCGL_Check_CheckRectify newCheckRectify = new Model.DCGL_Check_CheckRectify
{
CheckRectifyId = getCheckRectifyId,
CheckRectifyCode = item["CheckRectifyCode"].ToString(),
ProjectId = item["ProjectId"].ToString(),
ProjectName = item["ProjectName"].ToString(),
UnitId = unitId,
CheckDate = Funs.GetNewDateTime(item["CheckDate"].ToString()),
IssueMan = item["IssueMan"].ToString(),
IssueDate = Funs.GetNewDateTime(item["IssueDate"].ToString()),
HandleState = item["HandleState"].ToString()
};
db.DCGL_Check_CheckRectify.InsertOnSubmit(newCheckRectify);
db.SubmitChanges();
}
else
{
newRectify.CheckRectifyCode = item["CheckRectifyCode"].ToString();
db.SubmitChanges();
}
//获取对应主表主键的明细集合
string getNoticeItemId = item["NoticeItemId"].ToString();
var notice = db.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(x => x.ID == getNoticeItemId);
if (notice == null)
{
Model.DCGL_Check_CheckInfo_TableNoticeItem newCheckRectifyItem = new Model.DCGL_Check_CheckInfo_TableNoticeItem
{
ID = getNoticeItemId,
CheckInfoId = item["CheckInfoId"].ToString(),
SortIndex = Funs.GetNewInt(item["SortIndex"].ToString()),
Describe = item["Describe"].ToString(),
Standards = item["Standards"].ToString(),
Advice = item["Advice"].ToString(),
LimitTime = Funs.GetNewDateTime(item["LimitTime"].ToString()),
Situation = item["Situation"].ToString(),
Remark = item["Remark"].ToString(),
Url = item["Url"].ToString(),
AffUrl = item["AffUrl"].ToString(),
RiskLevel = item["RiskLevel"].ToString(),
ProblemTypes = item["ProblemTypes"].ToString(),
ProblemSubTypeId = item["ProblemSubTypeId"].ToString(),
ProblemSubType = item["ProblemSubType"].ToString(),
States = item["States"].ToString(),
//WorkType = item["WorkType"].ToString(),
//DangerPoint = item["DangerPoint"].ToString(),
//RiskExists = item["RiskExists"].ToString(),
//IsProject = Convert.ToBoolean(item["IsProject"].ToString()),
//CheckMan = item["CheckMan"].ToString(),
//SubjectUnitMan = item["SubjectUnitMan"].ToString(),
};
db.DCGL_Check_CheckInfo_TableNoticeItem.InsertOnSubmit(newCheckRectifyItem);
db.SubmitChanges();
}
BLL.CommonService.DeleteAttachFileById(getNoticeItemId);//删除附件
////上传附件
string getAttachFileId = item["AttachFileId"].ToString();
if (!string.IsNullOrEmpty(getAttachFileId))
{
List<byte[]> resultList = new List<byte[]>();
string filePath = item["FilePath"].ToString();
string attachSource = item["AttachSource"].ToString();
string attachUrl = item["AttachUrl"].ToString();
BLL.FileInsertService.InsertAttachFileRecord(getAttachFileId, getNoticeItemId, attachSource, attachUrl);
//if (!string.IsNullOrWhiteSpace(filePath) && !string.IsNullOrWhiteSpace(attachSource) && !string.IsNullOrWhiteSpace(attachUrl))
//{
// resultList = FileInsertService.FilePathTransStream(filePath, attachUrl);
//}
//BLL.FileInsertService.InsertAttachFile(getAttachFileId, getNoticeItemId, attachSource, attachUrl, resultList);
}
string getCheckRectifyItemId = item["CheckRectifyItemId"].ToString();
var oldItem = db.DCGL_Check_CheckRectifyItem.FirstOrDefault(e => e.CheckRectifyItemId == getCheckRectifyItemId);
if (oldItem == null)
{
Model.DCGL_Check_CheckRectifyItem newCheckRectifyItem = new Model.DCGL_Check_CheckRectifyItem
{
CheckRectifyItemId = getCheckRectifyItemId,
CheckRectifyId = getCheckRectifyId,
NoticeItemId = getNoticeItemId,
ConfirmMan = item["ConfirmMan"].ToString(),
ConfirmManName = item["ConfirmManName"].ToString(),
ConfirmDate = Funs.GetNewDateTime(item["ConfirmDate"].ToString()),
OrderEndDate = Funs.GetNewDateTime(item["OrderEndDate"].ToString()),
OrderEndPerson = item["OrderEndPerson"].ToString(),
RealEndDate = Funs.GetNewDateTime(item["RealEndDate"].ToString()),
};
db.DCGL_Check_CheckRectifyItem.InsertOnSubmit(newCheckRectifyItem);
db.SubmitChanges();
}
}
else
{
//获取对应主表主键的明细集合
string getNoticeItemId = item["NoticeItemId"].ToString();
var notice = db.DCGL_Check_CheckInfo_TableNoticeItem.FirstOrDefault(x => x.ID == getNoticeItemId);
if (notice == null)
{
Model.DCGL_Check_CheckInfo_TableNoticeItem newCheckRectifyItem = new Model.DCGL_Check_CheckInfo_TableNoticeItem
{
ID = getNoticeItemId,
CheckInfoId = item["CheckInfoId"].ToString(),
SortIndex = Funs.GetNewInt(item["SortIndex"].ToString()),
Describe = item["Describe"].ToString(),
Standards = item["Standards"].ToString(),
Advice = item["Advice"].ToString(),
LimitTime = Funs.GetNewDateTime(item["LimitTime"].ToString()),
Situation = item["Situation"].ToString(),
Remark = item["Remark"].ToString(),
Url = item["Url"].ToString(),
AffUrl = item["AffUrl"].ToString(),
RiskLevel = item["RiskLevel"].ToString(),
ProblemTypes = item["ProblemTypes"].ToString(),
ProblemSubTypeId = item["ProblemSubTypeId"].ToString(),
ProblemSubType = item["ProblemSubType"].ToString(),
States = item["States"].ToString(),
//WorkType = item["WorkType"].ToString(),
//DangerPoint = item["DangerPoint"].ToString(),
//RiskExists = item["RiskExists"].ToString(),
//IsProject = Convert.ToBoolean(item["IsProject"].ToString()),
//CheckMan = item["CheckMan"].ToString(),
//SubjectUnitMan = item["SubjectUnitMan"].ToString(),
};
db.DCGL_Check_CheckInfo_TableNoticeItem.InsertOnSubmit(newCheckRectifyItem);
db.SubmitChanges();
}
BLL.CommonService.DeleteAttachFileById(getNoticeItemId);//删除附件
////上传附件
string getAttachFileId = item["AttachFileId"].ToString();
if (!string.IsNullOrEmpty(getAttachFileId))
{
List<byte[]> resultList = new List<byte[]>();
string attachSource = item["AttachSource"].ToString();
string attachUrl = item["AttachUrl"].ToString();
BLL.FileInsertService.InsertAttachFileRecord(getAttachFileId, getNoticeItemId, attachSource, attachUrl);
//if (!string.IsNullOrWhiteSpace(filePath) && !string.IsNullOrWhiteSpace(attachSource) && !string.IsNullOrWhiteSpace(attachUrl))
//{
// resultList = FileInsertService.FilePathTransStream(filePath, attachUrl);
//}
//BLL.FileInsertService.InsertAttachFile(getAttachFileId, getNoticeItemId, attachSource, attachUrl, resultList);
}
string getCheckRectifyItemId = item["CheckRectifyItemId"].ToString();
var oldItem = db.DCGL_Check_CheckRectifyItem.FirstOrDefault(e => e.CheckRectifyItemId == getCheckRectifyItemId);
if (oldItem == null)
{
Model.DCGL_Check_CheckRectifyItem newCheckRectifyItem = new Model.DCGL_Check_CheckRectifyItem
{
CheckRectifyItemId = getCheckRectifyItemId,
CheckRectifyId = getCheckRectifyId,
NoticeItemId = getNoticeItemId,
ConfirmMan = item["ConfirmMan"].ToString(),
ConfirmManName = item["ConfirmManName"].ToString(),
ConfirmDate = Funs.GetNewDateTime(item["ConfirmDate"].ToString()),
OrderEndDate = Funs.GetNewDateTime(item["OrderEndDate"].ToString()),
OrderEndPerson = item["OrderEndPerson"].ToString(),
RealEndDate = Funs.GetNewDateTime(item["RealEndDate"].ToString()),
};
db.DCGL_Check_CheckRectifyItem.InsertOnSubmit(newCheckRectifyItem);
db.SubmitChanges();
}
}
}
}
}
responeData.message = "获取成功:整改明细记录" + getData.Count().ToString() + "条";
}
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = "获取失败:" + ex.Message;
ErrLogInfo.WriteLog("督查检查通知单获取!", ex);
}
return responeData;
}
#endregion
#region
/// <summary>
/// 获取
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public static Model.ResponeData getCheck_CheckRectifyListToSUBOld()
{
var responeData = new Model.ResponeData();
try
{
string unitId = BLL.Const.UnitId_SEDIN;
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/getDCGLCheckRectify?unitId=" + unitId;
string contenttype = "application/json;charset=unicode";
Hashtable newToken = new Hashtable
@ -591,6 +830,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck
CheckRectifyId = getCheckRectifyId,
NoticeItemId = getNoticeItemId,
ConfirmMan = item["ConfirmMan"].ToString(),
ConfirmManName = item["ConfirmManName"].ToString(),
ConfirmDate = Funs.GetNewDateTime(item["ConfirmDate"].ToString()),
OrderEndDate = Funs.GetNewDateTime(item["OrderEndDate"].ToString()),
OrderEndPerson = item["OrderEndPerson"].ToString(),

View File

@ -6,11 +6,36 @@
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>隐患整改单</title>
<link href="../../res/css/viewer.min.css" rel="stylesheet" />
<script src="../../res/js/jquery-3.4.1.min.js" type="text/javascript"></script>
<script src="../../res/js/viewer.min.js" type="text/javascript"></script>
<style type="text/css">
.f-grid-row .f-grid-cell-inner {
white-space: normal;
word-break: break-all;
}
.imgPreview {
display: none;
top: 0;
left: 0;
width: 100%; /*容器占满整个屏幕*/
height: 100%;
position: fixed;
background: rgba(0, 0, 0, 0.5);
}
.imgPreview img {
z-index: 100;
width: 60%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
/*添加鼠标移入图片效果*/
.img {
cursor: url("ico/放大镜.png"), auto;
}
</style>
</head>
<body>
@ -57,7 +82,7 @@
<f:FormRow>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
BoxFlex="1" DataKeyNames="CheckRectifyItemId" AllowCellEditing="true" Height="420px"
BoxFlex="1" DataKeyNames="CheckRectifyItemId" AllowCellEditing="true" Height="620px"
ClicksToEdit="1" DataIDField="CheckRectifyItemId" EnableColumnLines="true">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="45px" HeaderTextAlign="Center" TextAlign="Center" />
@ -74,10 +99,16 @@
<asp:Label ID="Label4" runat="server" Text='<%# Bind("RiskExists") %>' ToolTip='<%#Bind("RiskExists") %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:WindowField TextAlign="Center" Width="80px" WindowID="WindowAtt" HeaderText="整改前" Text="相关照片"
<f:TemplateField ColumnID="tfImageUrl1" MinWidth="120px" HeaderText="整改前" HeaderTextAlign="Center"
TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lbImageUrl1" runat="server" Text='<%# ConvertImageUrlByImage(Eval("NoticeItemId")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<%--<f:WindowField TextAlign="Center" Width="80px" WindowID="WindowAtt" HeaderText="整改前" Text="相关照片"
ToolTip="相关照片附件" DataIFrameUrlFields="NoticeItemId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&type=-1"
Title="相关照片" ColumnID="WindowAtt">
</f:WindowField>
</f:WindowField>--%>
<f:WindowField TextAlign="Center" Width="80px" WindowID="WindowAtt" HeaderText="整改后" Text="相关照片"
ToolTip="相关照片附件" DataIFrameUrlFields="CheckRectifyItemId" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Check&menuId=2E4A3E58-44B7-41B0-BFE3-634DF29AAE27"
Title="相关照片" ColumnID="WindowAtt1">
@ -108,12 +139,19 @@
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField ColumnID="Verification" DataField="Verification" Width="100px" HeaderToolTip="企业管理部门验证人"
<%-- <f:RenderField ColumnID="Verification" DataField="Verification" Width="100px" HeaderToolTip="企业管理部门验证人"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="验证人">
<Editor>
<f:TextBox ID="txtVerification" Text='<%# Eval("Verification")%>' MaxLength="50" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>--%>
<f:RenderField ColumnID="Situation" DataField="Situation" Width="220px" HeaderToolTip="整改情况"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" HeaderText="整改情况">
<Editor>
<f:TextBox ID="txtSituation" Text='<%# Eval("Situation")%>' MaxLength="500" runat="server">
</f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField Width="1px" ColumnID="CheckRectifyItemId" DataField="CheckRectifyItemId"
FieldType="String" HeaderText="主键" Hidden="true" HeaderTextAlign="Center">
@ -143,5 +181,43 @@
IsModal="true" Width="800px" Height="500px">
</f:Window>
</form>
<div class="imgPreview">
<img src="#" alt="" id="imgPreview" />
</div>
<script type="text/javascript">
var imgID = '<%=Grid1.ClientID %>';
function showImg() {
var $wrap = $("#" + imgID)
//console.log($wrap)
$wrap.find('img').on('click', function () {
var src = $(this).attr('src');
console.log(src)
if (src.indexOf("/res/icon") != -1) {
return;
}
var div = document.createElement('div');
div.style.display = 'none';
div.innerHTML = '<img src="' + src + '">'; // 创建一个包含图片的 div 元素
document.body.appendChild(div); // 将 div 元素添加到页面中
var viewer = new Viewer(div.firstChild); // 创建 Viewer 实例并传入图片元素
viewer.show(); // 显示图片预览
// 在 Viewer 关闭后移除添加的 div 元素
viewer.on('hidden', function () {
document.body.removeChild(div);
});
});
$('.imgPreview').on('click', function () {
// $('.imgPreview').hide()
});
}
F.ready(function () {
showImg();
})
</script>
<script src="../../res/js/hook.js" type="text/javascript"></script>
</body>
</html>

View File

@ -23,6 +23,12 @@ namespace FineUIPro.Web.DCGL.ServerCheck
}
}
/// <summary>
/// 集团服务器路径
/// </summary>
public string CNCECPath = BLL.Funs.CNCECPath;
//public string CNCECPath = "https://qhse.cncecoa.com/QHSE/";
/// <summary>
/// 定义集合
/// </summary>
@ -74,6 +80,27 @@ namespace FineUIPro.Web.DCGL.ServerCheck
}
}
/// <summary>
/// 获取整改前图片(放于Img中)
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
protected string ConvertImageUrlByImage(object id)
{
string url = string.Empty;
if (id != null)
{
var attachFile = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == id.ToString());
if (attachFile != null)
{
url = BLL.UploadAttachmentService.ShowImage(CNCECPath, attachFile.AttachUrl);
}
}
return url;
}
/// <summary>
/// 保存按钮
/// </summary>
@ -103,12 +130,19 @@ namespace FineUIPro.Web.DCGL.ServerCheck
jerqueSaveList();
foreach (var item in CheckRectifyItems)
{
var newCheckNoticeItem = BLL.DCGLCheckNoticeItemService.GetCheckNoticeItemByCheckNoticeItemId(item.NoticeItemId);
if (newCheckNoticeItem != null)
{
newCheckNoticeItem.Situation = item.Situation;
BLL.DCGLCheckNoticeItemService.UpdateCheckNoticeItem(newCheckNoticeItem);
}
var newCheckRectifyItem = BLL.DCGLCheckRectifyItemService.GetCheckRectifyItemByCheckRectifyItemId(item.CheckRectifyItemId);
if (newCheckRectifyItem != null)
{
newCheckRectifyItem.RealEndDate = item.RealEndDate;
newCheckRectifyItem.OrderEndPerson = item.OrderEndPerson;
newCheckRectifyItem.Verification = item.Verification;
//newCheckRectifyItem.Verification = item.Verification;
BLL.DCGLCheckRectifyItemService.UpdateCheckRectifyItem(newCheckRectifyItem);
}
}
@ -121,6 +155,7 @@ namespace FineUIPro.Web.DCGL.ServerCheck
}
if (type == BLL.Const.BtnSaveUp)
{
//string code = CNCECHSSEGetWebService.UpReportDCGlCheck_CheckRectify(newCheckRectify.CheckRectifyId, this.CurrUser);
string code = CNCECHSSEWebService.UpDCGlCheck_CheckRectify(newCheckRectify.CheckRectifyId, this.CurrUser);
if (code == "1")
{
@ -154,7 +189,8 @@ namespace FineUIPro.Web.DCGL.ServerCheck
{
item.OrderEndPerson = values.Value<string>("OrderEndPerson").ToString();
item.RealEndDate = Funs.GetNewDateTime(values.Value<string>("RealEndDate").ToString());
item.Verification = values.Value<string>("Verification").ToString();
//item.Verification = values.Value<string>("Verification").ToString();
item.Situation = values.Value<string>("Situation").ToString();
}
}
}

View File

@ -149,6 +149,15 @@ namespace FineUIPro.Web.DCGL.ServerCheck
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label4;
/// <summary>
/// lbImageUrl1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbImageUrl1;
/// <summary>
/// txtOrderEndPerson 控件。
/// </summary>
@ -168,13 +177,13 @@ namespace FineUIPro.Web.DCGL.ServerCheck
protected global::FineUIPro.DatePicker txtRealEndDate;
/// <summary>
/// txtVerification 控件。
/// txtSituation 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtVerification;
protected global::FineUIPro.TextBox txtSituation;
/// <summary>
/// Toolbar1 控件。

View File

@ -3271,6 +3271,7 @@
<Content Include="res\assets\js\swiper.min.js" />
<Content Include="res\assets\js\video-7.15.0.min.js" />
<Content Include="res\assets\js\world.js" />
<Content Include="res\css\viewer.min.css" />
<Content Include="res\DataInTable.js" />
<Content Include="res\HJGL\InfoQuery\css\Chart.css" />
<Content Include="res\images\idcard.png" />
@ -3363,7 +3364,10 @@
<Content Include="res\indexv1\js\old\draw-circle.js" />
<Content Include="res\indexv1\js\video-7.15.0.min.js" />
<Content Include="res\indexv1\js\world.js" />
<Content Include="res\js\hook.js" />
<Content Include="res\js\jquery-3.3.1.min.js" />
<Content Include="res\js\jquery-3.4.1.min.js" />
<Content Include="res\js\viewer.min.js" />
<Content Include="res\ol\bd09.js" />
<Content Include="res\ol\ol.css" />
<Content Include="res\ol\ol.js" />

View File

@ -20,7 +20,7 @@
try
{
Funs.RootPath = Server.MapPath("~/");
Funs.AttachRootPath = ConfigurationManager.AppSettings["localRoot"];
// 日志文件所在目录
ErrLogInfo.DefaultErrLogFullPath = Server.MapPath("~/ErrLog.txt");
Funs.ConnString = ConfigurationManager.AppSettings["ConnectionString"];

View File

@ -7,6 +7,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>排产计划</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.color1 {
background:#ff0000;
}
</style>
</head>
<body>
<form id="form1" runat="server">
@ -56,7 +62,7 @@
EnableColumnLines="true" ClicksToEdit="1" DataIDField="ProductionSchedulingPlanId"
AllowSorting="true" SortField="FlowNum,Material,Caliber" SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True">
EnableTextSelection="True" OnRowDataBound="Grid1_RowDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
@ -80,23 +86,23 @@
DataField="Dain" SortField="Dain" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="总达因" ColumnID="TotalDyne"
<f:RenderField HeaderText="总达因(按材质)" ColumnID="TotalDyne"
DataField="TotalDyne" SortField="TotalDyne" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
Width="150px">
</f:RenderField>
<f:RenderField HeaderText="总优先级" ColumnID="TotalPriority"
<f:RenderField HeaderText="总达因(按材质)优先级" ColumnID="TotalPriority"
DataField="TotalPriority" SortField="TotalPriority" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="100px">
Width="190px">
<Editor>
<f:TextBox ID="txtTotalPriority" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="优先级总达因" ColumnID="PriorityTotalDyne"
<f:RenderField HeaderText="总达因" ColumnID="PriorityTotalDyne"
DataField="PriorityTotalDyne" SortField="PriorityTotalDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<%--<Editor>
<f:NumberBox ID="txtPriorityTotalDyne" runat="server"></f:NumberBox>
</Editor>
</Editor>--%>
</f:RenderField>
<f:RenderField HeaderText="计划开始时间" ColumnID="PlanStartDate"
DataField="PlanStartDate" SortField="PlanStartDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderTextAlign="Center" TextAlign="Left"
@ -119,7 +125,7 @@
<f:NumberBox ID="txtDays" runat="server" NoDecimal="true" NoNegative="true" ></f:NumberBox>
</Editor>--%>
</f:RenderField>
<f:RenderField HeaderText="平均每工作量" ColumnID="AvgDailyWorkload"
<f:RenderField HeaderText="平均每日应完成工作量" ColumnID="AvgDailyWorkload"
DataField="AvgDailyWorkload" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="140px">
<Editor>
@ -129,9 +135,9 @@
<f:RenderField HeaderText="当日已完成量" ColumnID="OnDayCompleteDyne"
DataField="OnDayCompleteDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
<Editor>
<%--<Editor>
<f:NumberBox ID="NumberBox1" runat="server" NoNegative="true"></f:NumberBox>
</Editor>
</Editor>--%>
</f:RenderField>
<f:RenderField HeaderText="次日应完成量" ColumnID="NextDayCompleteDyne"
DataField="NextDayCompleteDyne" FieldType="Float" HeaderTextAlign="Center" TextAlign="Left"
@ -196,7 +202,7 @@
}
function onGridDataLoad(event) {
this.mergeColumns(['FlowNum', 'Material', 'TotalDyne', 'TotalCompletedRate']);
this.mergeColumns(['FlowNum', 'Material', 'TotalDyne','TotalPriority','PriorityTotalDyne', 'TotalCompletedRate']);
}
//自动计算天数、平均每天工作量

View File

@ -223,10 +223,11 @@ namespace FineUIPro.Web.HJGL.PreDesign
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
string projectId = this.CurrUser.LoginProjectId;
if (tvControlItem.SelectedNode.CommandName == "流水段")
{
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@projectId", projectId));
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.ParentNode.NodeID))
{
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.ParentNode.NodeID));
@ -252,7 +253,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
//删除原有数据
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(this.CurrUser.LoginProjectId,this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text);
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWorkIdAndFlowNum(projectId, this.tvControlItem.SelectedNode.ParentNode.Text, this.tvControlItem.SelectedNode.Text);
for (int i = 0; i < tb.Rows.Count; i++)
{
string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程
@ -261,32 +262,52 @@ namespace FineUIPro.Web.HJGL.PreDesign
string material = tb.Rows[i]["Material"].ToString();//材质Text
string caliber = tb.Rows[i]["Caliber"].ToString();//寸径
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber);
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(projectId, flowingSection, unitWorkId, material, caliber);
if (plan == null)
{
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
newPlan.ProjectId = this.CurrUser.LoginProjectId;
newPlan.ProjectId = projectId;
newPlan.PipelineId = unitWorkId;
newPlan.FlowNum = flowingSection;
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
newPlan.Material = material;
newPlan.Caliber = caliber;
newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber,"1");
newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection,"1");
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2");
newPlan.Dain = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "1");//达因数
var dyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(projectId, unitWorkId, flowingSection, steelType);//总达因(按材质)
if (dyne != null)
{
newPlan.TotalDyne = dyne;
}
else
{
newPlan.TotalDyne = 0;
}
newPlan.PriorityTotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "1");//总达因
//当日已完成量
var currentDay = BLL.WeldJointService.GetCurrentDaySizeSum(projectId, unitWorkId, flowingSection, steelType, caliber);
if (currentDay != null)
{
newPlan.OnDayCompleteDyne = currentDay;
}
else
{
newPlan.OnDayCompleteDyne = 0;
}
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "2");//累计已完成量
if (newPlan.Dain > 0)
{
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;//已完成百分比
}
else
{
newPlan.CompletedRate = 0;
}
if (newPlan.TotalDyne > 0)
if (newPlan.PriorityTotalDyne > 0)
{
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2");
newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100;
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "2");//完成总达因
newPlan.TotalCompletedRate = (completeDinSum / newPlan.PriorityTotalDyne) * 100;//已完成百分比汇总
}
else
{
@ -299,7 +320,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
else if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2)//单位工程
{
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@projectId", projectId));
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNode.NodeID))
{
listStr.Add(new SqlParameter("@unitWorkId", this.tvControlItem.SelectedNode.NodeID));
@ -317,7 +338,7 @@ namespace FineUIPro.Web.HJGL.PreDesign
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_ProductionSchedulingPlanStatistics", parameter);
//删除原有数据
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(this.CurrUser.LoginProjectId, this.tvControlItem.SelectedNode.Text);
BLL.ProductionSchedulingPlanService.DeleteProductionSchedulingPlanByUnitWork(projectId, this.tvControlItem.SelectedNode.Text);
for (int i = 0; i < tb.Rows.Count; i++)
{
string unitWorkId = tb.Rows[i]["UnitWorkId"].ToString();//单位工程
@ -325,32 +346,51 @@ namespace FineUIPro.Web.HJGL.PreDesign
string steelType = tb.Rows[i]["SteelType"].ToString();//材质Value
string material = tb.Rows[i]["Material"].ToString();//材质Text
string caliber = tb.Rows[i]["Caliber"].ToString();//寸径
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(this.CurrUser.LoginProjectId, flowingSection, unitWorkId, material, caliber);
var plan = BLL.ProductionSchedulingPlanService.GetProductionSchedulingPlan(projectId, flowingSection, unitWorkId, material, caliber);
if (plan == null)
{
Model.HJGL_ProductionSchedulingPlan newPlan = new HJGL_ProductionSchedulingPlan();
newPlan.ProductionSchedulingPlanId = SQLHelper.GetNewID(typeof(Model.HJGL_ProductionSchedulingPlan));
newPlan.ProjectId = this.CurrUser.LoginProjectId;
newPlan.ProjectId = projectId;
newPlan.PipelineId = unitWorkId;
newPlan.FlowNum = flowingSection;
newPlan.MainItemName = tb.Rows[i]["UnitWorkName"].ToString();
newPlan.Material = material;
newPlan.Caliber = caliber;
newPlan.Dain = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "1");
newPlan.TotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "1");
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, steelType, caliber, "2");
newPlan.Dain = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "1");//达因数
var dyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSectionAndMaterial(projectId, unitWorkId, flowingSection, steelType);//总达因(按材质)
if (dyne != null)
{
newPlan.TotalDyne = dyne;
}
else
{
newPlan.TotalDyne = 0;
}
newPlan.PriorityTotalDyne = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "1");//总达因
//当日已完成量
var currentDay = BLL.WeldJointService.GetCurrentDaySizeSum(projectId, unitWorkId, flowingSection, steelType, caliber);
if (currentDay != null)
{
newPlan.OnDayCompleteDyne = currentDay;
}
else
{
newPlan.OnDayCompleteDyne = 0;
}
newPlan.CompletedCount = BLL.WeldJointService.GetSizeSum(projectId, unitWorkId, flowingSection, steelType, caliber, "2");//累计已完成量
if (newPlan.Dain > 0)
{
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;
newPlan.CompletedRate = (newPlan.CompletedCount / newPlan.Dain) * 100;//已完成百分比
}
else
{
newPlan.CompletedRate = 0;
}
if (newPlan.TotalDyne > 0)
if (newPlan.PriorityTotalDyne > 0)
{
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(this.CurrUser.LoginProjectId, unitWorkId, flowingSection, "2");
newPlan.TotalCompletedRate = (completeDinSum / newPlan.TotalDyne) * 100;
decimal? completeDinSum = BLL.WeldJointService.GetSizeSumByUnitWorkIdAndFlowingSection(projectId, unitWorkId, flowingSection, "2");//完成总达因
newPlan.TotalCompletedRate = (completeDinSum / newPlan.PriorityTotalDyne) * 100;//已完成百分比汇总
}
else
{
@ -623,9 +663,21 @@ namespace FineUIPro.Web.HJGL.PreDesign
cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
cellStyle.WrapText = true;//自动换行
NPOI.SS.UserModel.ICellStyle style11 = workbook.CreateCellStyle();
style11.DataFormat = NPOI.HSSF.UserModel.HSSFDataFormat.GetBuiltinFormat("0.00");//数字格式
style11.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
style11.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
style11.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
style11.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
style11.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Right;
style11.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
style11.WrapText = true;//自动换行
var font = workbook.CreateFont();
font.FontHeightInPoints = 11;
cellStyle.SetFont(font);
// 第二步:创建新数据行
NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0);
NPOI.SS.UserModel.IRow row = sheet.GetRow(0);
@ -653,20 +705,23 @@ namespace FineUIPro.Web.HJGL.PreDesign
cell.SetCellValue(item.Caliber);//口径
cell = row.CreateCell(4);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.Dain.HasValue ? item.Dain.ToString() : "");//达因数
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.Dain.HasValue ? Convert.ToDouble(item.Dain) : 0);//达因数
cell.CellStyle = style11;
cell = row.CreateCell(5);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.TotalDyne.HasValue ? item.TotalDyne.ToString() : "");//总达因数
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.TotalDyne.HasValue ? Convert.ToDouble(item.TotalDyne) : 0);//总达因数
cell.CellStyle = style11;
cell = row.CreateCell(6);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.TotalPriority);//总优先级
cell = row.CreateCell(7);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.PriorityTotalDyne.HasValue ? item.PriorityTotalDyne.ToString() : "");//优先级总达因
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.PriorityTotalDyne.HasValue ? Convert.ToDouble(item.PriorityTotalDyne) : 0);//优先级总达因
cell.CellStyle = style11;
cell = row.CreateCell(8);
cell.CellStyle = cellStyle;
@ -681,21 +736,25 @@ namespace FineUIPro.Web.HJGL.PreDesign
cell.SetCellValue(item.Days.HasValue ? item.Days.ToString() : "");//天数
cell = row.CreateCell(11);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.AvgDailyWorkload.HasValue ? item.AvgDailyWorkload.ToString() : "");//平均每天工作量
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.AvgDailyWorkload.HasValue ? Convert.ToDouble(item.AvgDailyWorkload.ToString()) : 0);//平均每天工作量
cell.CellStyle = style11;
cell = row.CreateCell(12);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.OnDayCompleteDyne.HasValue ? item.OnDayCompleteDyne.ToString() : "");//当日已完成量
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.OnDayCompleteDyne.HasValue ? Convert.ToDouble(item.OnDayCompleteDyne.ToString()) : 0);//当日已完成量
cell.CellStyle = style11;
cell = row.CreateCell(13);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.NextDayCompleteDyne.HasValue ? item.NextDayCompleteDyne.ToString() : "");//次日应完成量
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.NextDayCompleteDyne.HasValue ? Convert.ToDouble(item.NextDayCompleteDyne.ToString()) : 0);//次日应完成量
cell.CellStyle = style11;
cell = row.CreateCell(14);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.CompletedCount.HasValue ? item.CompletedCount.ToString() : "");//累计已完成量
//cell.CellStyle = cellStyle;
cell.SetCellValue(item.CompletedCount.HasValue ? Convert.ToDouble(item.CompletedCount.ToString()) : 0);//累计已完成量
cell.CellStyle = style11;
cell = row.CreateCell(15);
cell.CellStyle = cellStyle;
cell.SetCellValue(item.CompletedRate.HasValue ? item.CompletedRate.ToString() : "");//已完成百分比
@ -828,5 +887,31 @@ namespace FineUIPro.Web.HJGL.PreDesign
}
}
#endregion
#region Grid行绑定事件
/// <summary>
/// 次日应完成量高于平均每日应完成工作量发出预警,预警要统一着色显示红色
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
DataRowView row = e.DataItem as DataRowView;
double avgDailyWorkload = 0;
double nextDayCompleteDyne = 0;
if (row["AvgDailyWorkload"] != null && !string.IsNullOrEmpty(row["AvgDailyWorkload"].ToString()))
{
avgDailyWorkload = Convert.ToDouble(row["AvgDailyWorkload"]);
}
if (row["NextDayCompleteDyne"] != null && !string.IsNullOrEmpty(row["NextDayCompleteDyne"].ToString()))
{
nextDayCompleteDyne = Convert.ToDouble(row["NextDayCompleteDyne"]);
}
if (avgDailyWorkload < nextDayCompleteDyne)
{
e.RowCssClass = "color1";
}
}
#endregion
}
}

View File

@ -147,15 +147,6 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// </remarks>
protected global::FineUIPro.TextBox txtTotalPriority;
/// <summary>
/// txtPriorityTotalDyne 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtPriorityTotalDyne;
/// <summary>
/// txtPlanStartDate 控件。
/// </summary>
@ -183,15 +174,6 @@ namespace FineUIPro.Web.HJGL.PreDesign {
/// </remarks>
protected global::FineUIPro.NumberBox txtAvgDailyWorkload;
/// <summary>
/// NumberBox1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox NumberBox1;
/// <summary>
/// NumberBox2 控件。
/// </summary>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
_oldParam = jQuery.param;
jQuery.param = function (x) {
var t = _oldParam(x);
t = t.replace('F_STATE=', 'F_STATE=__hook');
return t;
}

File diff suppressed because one or more lines are too long

10
SGGL/FineUIPro.Web/res/js/viewer.min.js vendored Normal file

File diff suppressed because one or more lines are too long