提交代码

This commit is contained in:
2025-01-25 11:56:47 +08:00
parent 553defbc94
commit 22661b6f0e
24 changed files with 6770 additions and 3 deletions
+3
View File
@@ -349,6 +349,8 @@
<Compile Include="CQMS\WBS\WorkPackageParentDetailService.cs" />
<Compile Include="CQMS\WBS\WorkPackageProjectService.cs" />
<Compile Include="CQMS\WBS\WorkPackageService.cs" />
<Compile Include="DCGL\ServerCheck\DCGLCheckRectifyItemService.cs" />
<Compile Include="DCGL\ServerCheck\DCGLCheckRectifyService.cs" />
<Compile Include="DigData\CQMSDataCollectService.cs" />
<Compile Include="DigData\CQMSDataDWService .cs" />
<Compile Include="DigData\ProjectWBSAnalysisService.cs" />
@@ -571,6 +573,7 @@
<Compile Include="OfficeCheck\Check\ProjectSupervision_RectifyItemService.cs" />
<Compile Include="OfficeCheck\Check\ProjectSupervision_RectifyService.cs" />
<Compile Include="OfficeCheck\ProjectEvaluation\ProjectEvaluationService.cs" />
<Compile Include="OpenService\FileInsertService.cs" />
<Compile Include="OpenService\MonitorService.cs" />
<Compile Include="DynamicTHeaderHepler.cs" />
<Compile Include="OpenService\GetDataService.cs" />
+15
View File
@@ -5140,5 +5140,20 @@ namespace BLL
/// 中央企业安全生产管理评价工作调度台账上报
/// </summary>
public const string ReportType_12 = "12";
#region
/// <summary>
/// 企业上报督查检查报告
/// </summary>
public const string UpDCGLCheckReportMenuId = "2E4A3E58-44B7-41B0-BFE3-634DF29AAE27";// "B9950CB5-C47A-4C0A-A6CC-C7DDBBDE7D1E";
/// <summary>
/// 集团下发督查检查整改
/// </summary>
public const string DCGLCheckRectifyMenuId = "2E4A3E58-44B7-41B0-BFE3-634DF29AAE27";
#endregion
}
}
@@ -0,0 +1,61 @@
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 DCGLCheckRectifyItemService
{
/// <summary>
/// 根据主键获取督查检查整改明细信息
/// </summary>
/// <param name="noticeItemId"></param>
/// <returns></returns>
public static Model.DCGL_Check_CheckRectifyItem GetCheckRectifyItemByTable5ItemId(string noticeItemId)
{
return Funs.DB.DCGL_Check_CheckRectifyItem.FirstOrDefault(e => e.NoticeItemId == noticeItemId);
}
/// <summary>
/// 根据督查检查整改id获取所有相关明细信息
/// </summary>
/// <param name="CheckRectifyId"></param>
/// <returns></returns>
public static List<Model.DCGL_Check_CheckRectifyItem> GetCheckRectifyItemByCheckRectifyId(string checkRectifyId)
{
return (from x in Funs.DB.DCGL_Check_CheckRectifyItem where x.CheckRectifyId == checkRectifyId select x).ToList();
}
/// <summary>
/// 根据主键获取督查检查整改明细信息
/// </summary>
/// <param name="checkRectifyItemId"></param>
/// <returns></returns>
public static Model.DCGL_Check_CheckRectifyItem GetCheckRectifyItemByCheckRectifyItemId(string checkRectifyItemId)
{
return Funs.DB.DCGL_Check_CheckRectifyItem.FirstOrDefault(e => e.CheckRectifyItemId == checkRectifyItemId);
}
/// <summary>
/// 添加督查检查整改明细信息
/// </summary>
/// <param name="CheckRectifyItem"></param>
public static void UpdateCheckRectifyItem(Model.DCGL_Check_CheckRectifyItem CheckRectifyItem)
{
var newCheckRectifyItem = Funs.DB.DCGL_Check_CheckRectifyItem.FirstOrDefault(x => x.CheckRectifyItemId == CheckRectifyItem.CheckRectifyItemId);
if (newCheckRectifyItem != null)
{
newCheckRectifyItem.OrderEndPerson = CheckRectifyItem.OrderEndPerson;
newCheckRectifyItem.RealEndDate = CheckRectifyItem.RealEndDate;
newCheckRectifyItem.Verification = CheckRectifyItem.Verification;
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class DCGLCheckRectifyService
{
/// <summary>
/// 根据整改ID获取督查检查信息
/// </summary>
/// <param name="CheckRectifyName"></param>
/// <returns></returns>
public static Model.DCGL_Check_CheckRectify GetCheckRectifyByCheckRectifyId(string checkRectifyId)
{
return Funs.DB.DCGL_Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == checkRectifyId);
}
/// <summary>
/// 添加督查检查整改
/// </summary>
/// <param name="checkRectify"></param>
public static void AddCheckRectify(Model.DCGL_Check_CheckRectify checkRectify)
{
Model.DCGL_Check_CheckRectify newCheckRectify = new Model.DCGL_Check_CheckRectify
{
CheckRectifyId = checkRectify.CheckRectifyId,
CheckRectifyCode = checkRectify.CheckRectifyCode,
ProjectId = checkRectify.ProjectId,
UnitId = checkRectify.UnitId,
CheckDate = checkRectify.CheckDate,
IssueMan = checkRectify.IssueMan,
IssueDate = checkRectify.IssueDate,
HandleState = checkRectify.HandleState
};
Funs.DB.DCGL_Check_CheckRectify.InsertOnSubmit(newCheckRectify);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改督查检查整改
/// </summary>
/// <param name="checkRectify"></param>
public static void UpdateCheckRectify(Model.DCGL_Check_CheckRectify checkRectify)
{
Model.DCGL_Check_CheckRectify newCheckRectify = Funs.DB.DCGL_Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == checkRectify.CheckRectifyId);
if (newCheckRectify != null)
{
newCheckRectify.CheckRectifyCode = checkRectify.CheckRectifyCode;
newCheckRectify.ProjectId = checkRectify.ProjectId;
newCheckRectify.UnitId = checkRectify.UnitId;
newCheckRectify.CheckDate = checkRectify.CheckDate;
newCheckRectify.IssueMan = checkRectify.IssueMan;
newCheckRectify.IssueDate = checkRectify.IssueDate;
newCheckRectify.HandleState = checkRectify.HandleState;
Funs.DB.SubmitChanges();
}
}
}
}
+138
View File
@@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using System.Web;
namespace BLL
{
public static class FileInsertService
{
/// <summary>
/// 获取附件数据流类
/// </summary>
/// <param name="attachUrl">附件路径</param>
/// <returns></returns>
public static void FileInsert(List<byte[]> fileContextList, string attachUrl)
{
if (fileContextList != null && fileContextList.Count > 0)
{
string physicalpath = Funs.RootPath;
//HttpContext.Current.Request.PhysicalApplicationPath;
string fullPath = physicalpath + attachUrl;
if (!File.Exists(fullPath))
{
byte[] fileContext = fileContextList[0];
int index = fullPath.LastIndexOf("\\");
string filePath = fullPath.Substring(0, index);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
//string savePath = fullPath + fileName;
//文件读写模式
System.IO.FileMode fileMode = System.IO.FileMode.Create;
//写入文件
using (System.IO.FileStream fs = new System.IO.FileStream(fullPath, fileMode, System.IO.FileAccess.Write))
{
fs.Write(fileContext, 0, fileContext.Length);
}
}
}
}
/// <summary>
/// 获取多附件数据流类
/// </summary>
/// <param name="attachUrl">附件路径</param>
/// <returns></returns>
public static void FileMoreInsert(List<byte[]> fileContextList, string attachUrl)
{
if (fileContextList != null && fileContextList.Count() > 0)
{
if (fileContextList.Count > 0)
{
string[] strs = attachUrl.Trim().Split(',');
int i = 0;
foreach (var item in fileContextList)
{
if (strs.Count() > i)
{
string physicalpath = Funs.RootPath;
//HttpContext.Current.Request.PhysicalApplicationPath;
string fullPath = physicalpath + strs[i];
if (!File.Exists(fullPath))
{
byte[] fileContext = item;
int index = fullPath.LastIndexOf("\\");
string filePath = fullPath.Substring(0, index);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
//string savePath = fullPath + fileName;
//文件读写模式
System.IO.FileMode fileMode = System.IO.FileMode.Create;
//写入文件
using (System.IO.FileStream fs = new System.IO.FileStream(fullPath, fileMode, System.IO.FileAccess.Write))
{
fs.Write(fileContext, 0, fileContext.Length);
}
}
i++;
}
}
}
}
}
/// <summary>
/// 数据和附件插入到多附件表
/// </summary>
public static void InsertAttachFile(string attachFileId, string dataId, string attachSource, string attachUrl, List<byte[]> fileContext)
{
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();
////插入附件文件
BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
}
else
{
if (attachFile.AttachUrl != attachUrl)
{
///删除附件文件
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, attachFile.AttachUrl);
////插入附件文件
BLL.FileInsertService.FileMoreInsert(fileContext, attachUrl);
attachFile.AttachSource = attachSource;
attachFile.AttachUrl = attachUrl;
Funs.DB.SubmitChanges();
}
}
}
}
}
@@ -14,6 +14,8 @@
using RestSharp;
using System.Net;
using Model;
using System.Collections;
using Newtonsoft.Json.Linq;
public static class CNCECHSSEWebService
{
@@ -1957,6 +1959,87 @@
}
#endregion
#region
/// <summary>
/// 督查检查整改上报
/// </summary>
public static string UpDCGlCheck_CheckRectify(string checkRectifyId, Model.Person_Persons CurrUser)
{
string code = "0";
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
try
{
// CNCECHSSEService.HSSEServiceClient hsseC = new CNCECHSSEService.HSSEServiceClient();
var upCheckReport = from x in db.View_DCGL_CheckRectifyListFromSUB
where x.RealEndDate.HasValue && x.CheckRectifyId == checkRectifyId
select new Model.DCGLCheckRectifyItem
{
CheckRectifyId = x.CheckRectifyId,
CheckRectifyCode = x.CheckRectifyCode,
ProjectId = x.ProjectId,
UnitId = x.UnitId,
CheckDate = x.CheckDate,
IssueMan = x.IssueMan,
IssueDate = x.IssueDate,
HandleState = x.HandleState,
CheckRectifyItemId = x.CheckRectifyItemId,
ConfirmMan = x.ConfirmMan,
ConfirmDate = x.ConfirmDate,
OrderEndDate = x.OrderEndDate,
OrderEndPerson = x.OrderEndPerson,
RealEndDate = x.RealEndDate,
Verification = x.Verification,
AttachFileId = x.AttachFileId2,
ToKeyId = x.ToKeyId2,
AttachSource = x.AttachSource2,
AttachUrl = x.AttachUrl2,
////附件转为字节传送
FileContext = FileStructService.GetMoreFileStructByAttachUrl(x.AttachUrl2),
};
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/UpDCGLCheckRectifyTable";
string contenttype = "application/json;charset=unicode";
Hashtable newToken = new Hashtable
{
{ "token", ServerService.GetToken().Token }
};
var pushContent = JsonConvert.SerializeObject(upCheckReport.ToList());
var strJosn = APIGetHttpService.Http(baseurl, "Post", contenttype, newToken, pushContent);
if (!string.IsNullOrEmpty(strJosn))
{
JObject obj = JObject.Parse(strJosn);
code = obj["code"].ToString();
if (code == "1")
{
var getIds = Funs.GetStrListByStr(obj["data"].ToString(), ',');
if (getIds.Count() > 0)
{
foreach (var item in getIds)
{
var newCheckRectify = db.DCGL_Check_CheckRectify.FirstOrDefault(e => e.CheckRectifyId == item);
if (newCheckRectify != null)
{
newCheckRectify.HandleState = BLL.Const.State_3; //已完成
db.SubmitChanges();
}
}
}
LogService.AddSys_Log(CurrUser, "【集团检查整改】上传到服务器" + getIds.Count.ToString() + "条数据;", null, BLL.Const.UpDCGLCheckReportMenuId, BLL.Const.BtnUploadResources);
}
}
}
catch (Exception ex)
{
ErrLogInfo.WriteLog("【集团检查整改】上传到服务器", ex);
LogService.AddSys_Log(CurrUser, "【集团检查整改】上传到服务器失败;", null, BLL.Const.UpDCGLCheckReportMenuId, BLL.Const.BtnUploadResources);
}
return code;
}
}
#endregion
#endregion
@@ -7121,6 +7204,7 @@
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
}