修改作业票

This commit is contained in:
2023-09-14 20:11:35 +08:00
parent 7cca1b3cd3
commit ba8a84b2e0
9 changed files with 620 additions and 4 deletions
+92 -1
View File
@@ -102,7 +102,7 @@ namespace BLL
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.Manager_HSSELog newHSSELog =db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
Model.Manager_HSSELog newHSSELog = db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
if (newHSSELog != null)
{
newHSSELog.CompileDate = updateHSSELog.CompileDate;
@@ -980,5 +980,96 @@ namespace BLL
}
}
#endregion
#region
/// <summary>
/// 返回列表
/// </summary>
/// <param name="projectId"></param>
/// <param name="userId"></param>
/// <returns></returns>
public static List<Model.HSSELogItem> getHSSELogDataList(string projectId, string userId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
List<Model.HSSELogItem> getInfoList = new List<Model.HSSELogItem>();
getInfoList = (from x in db.Manager_HSSELog
join y in db.Sys_User on x.CompileMan equals y.UserId
join z in db.Sys_Const on x.Weather equals z.ConstValue
orderby x.CompileDate
where x.IsVisible != false && z.GroupId == BLL.ConstValue.Group_Weather && x.ProjectId == projectId
select new Model.HSSELogItem
{
HSSELogId = x.HSSELogId,
ProjectId = x.ProjectId,
CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
CompileMan = x.CompileMan,
Weather = x.Weather,
IsVisible = x.IsVisible,
CompileManName = y.UserName,
WeatherName = z.ConstText
}).ToList();
Model.Project_ProjectUser projectUser = BLL.ProjectUserService.GetProjectUserByUserIdProjectId(projectId, userId);
if (projectUser != null)
{
if (projectUser.RoleId.Contains(BLL.Const.HSSEEngineer)) //项目安全工程师只能看到自己的日志内容
{
getInfoList = getInfoList.Where(x => x.CompileMan == userId).ToList();
}
}
return getInfoList;
}
}
public static Model.HSSELogItem getHSSELogData(string HSSELogId)
{
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.HSSELogItem model = new Model.HSSELogItem();
model = (from x in db.Manager_HSSELog
join y in db.Sys_User on x.CompileMan equals y.UserId
join z in db.Sys_Const on x.Weather equals z.ConstValue
orderby x.CompileDate
where x.IsVisible != false && z.GroupId == BLL.ConstValue.Group_Weather && x.HSSELogId == HSSELogId
select new Model.HSSELogItem
{
HSSELogId = x.HSSELogId,
ProjectId = x.ProjectId,
CompileDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.CompileDate),
CompileMan = x.CompileMan,
Weather = x.Weather,
IsVisible = x.IsVisible,
CompileManName = y.UserName,
WeatherName = z.ConstText,
Num11=x.Num11,
Contents12=x.Contents12,
Contents13=x.Contents13,
Contents21=x.Contents21,
Num21=x.Num21,
Contents22=x.Contents22,
Num22=x.Num22,
Contents23=x.Contents23,
Num23=x.Num23,
Contents24=x.Contents24,
Num24=x.Num24,
Contents210=x.Contents210,
Num210=x.Num210,
Num211=x.Num211,
Contents31=x.Contents31,
Num31=x.Num31,
Contents32=x.Contents32,
Num32=x.Num32,
Contents41=x.Contents41,
Contents42=x.Contents42
}).FirstOrDefault();
return model;
}
}
#endregion
}
}
+1
View File
@@ -1994,6 +1994,7 @@
<Content Include="File\Excel\TestRun\管道一览表.xlsx" />
<Content Include="File\Excel\TestRun\系统划分.xlsx" />
<Content Include="File\Excel\TestRun\设备一览表.xlsx" />
<Content Include="File\Word\HSSE\临时用电作业票.doc" />
<None Include="packages.config" />
<Content Include="ReportPrint\ReportTabFile\分包商上传周报.tab" />
<Content Include="ReportPrint\ReportTabFile\HSSE日志暨管理数据收集.tab" />
@@ -289,7 +289,7 @@ namespace FineUIPro.Web.HSSE.License
string uploadfilepath = string.Empty;
string newUrl = string.Empty;
string filePath = string.Empty;
initTemplatePath = "File\\Word\\HSSE\\动土作业票.doc";
initTemplatePath = "File\\Word\\HSSE\\临时用电作业票.doc";
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
@@ -340,12 +340,12 @@ namespace FineUIPro.Web.HSSE.License
}
}
Bookmark bookmarkWorkDepth = doc.Range.Bookmarks["WorkDepth"];//开挖深度
Bookmark bookmarkWorkDepth = doc.Range.Bookmarks["WorkDepth"];//作业原因
if (bookmarkWorkDepth != null)
{
if (getElectricity != null)
{
bookmarkWorkDepth.Text = getElectricity.WorkDepth;
bookmarkWorkDepth.Text = getElectricity.Reason;
}
}
+47
View File
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class HSSELogItem
{
public string HSSELogId { get; set; }
public string ProjectId { get; set; }
public string CompileDate { get; set; }
public string CompileMan { get; set; }
public string Weather { get; set; }
public bool? IsVisible { get; set; }
public string CompileManName { get; set; }
public string WeatherName { get; set; }
public int? Num11 { get; set; }
public string Contents12 { get; set; }
public string Contents13 { get; set; }
public string Contents21 { get; set; }
public int? Num21 { get; set; }
public string Contents22 { get; set; }
public int? Num22 { get; set; }
public string Contents23 { get; set; }
public int? Num23 { get; set; }
public string Contents24 { get; set; }
public int? Num24 { get; set; }
public string Contents210 { get; set; }
public int? Num210 { get; set; }
public int? Num211 { get; set; }
public string Contents31 { get; set; }
public int? Num31 { get; set; }
public string Contents32 { get; set; }
public int? Num32 { get; set; }
public string Contents41 { get; set; }
public string Contents42 { get; set; }
}
}
+1
View File
@@ -94,6 +94,7 @@
<Compile Include="APIItem\HJGL\NDETrustItem.cs" />
<Compile Include="APIItem\HJGL\WeldJointItem.cs" />
<Compile Include="APIItem\HSSE\HSEDiaryItem.cs" />
<Compile Include="APIItem\HSSE\HSSELogItem.cs" />
<Compile Include="APIItem\HSSE\IncentiveNoticeItem.cs" />
<Compile Include="APIItem\HSSE\LicenseDataItem.cs" />
<Compile Include="APIItem\HSSE\LicenseItem.cs" />
@@ -0,0 +1,118 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using BLL;
using Mvc.Controllers;
namespace WebAPI.Controllers.HSSE
{
public class HSSELogController : ApiController
{
/// <summary>
/// 加载日志列表
/// </summary>
/// <param name="projectId"></param>
/// <param name="userId"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
public Model.ResponeData getHSSELogDataList( string projectId, string userId, int pageIndex=0)
{
var responeData = new Model.ResponeData();
try
{
var getDataList = HSSELogService.getHSSELogDataList(projectId, userId);
int pageCount = getDataList.Count;
if (pageCount > 0 && pageIndex > 0)
{
getDataList = (from x in getDataList.Skip(Funs.PageSize * (pageIndex - 1)).Take(Funs.PageSize)
select x).ToList();
}
responeData.data = new { pageCount, getDataList };
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
/// <summary>
/// 加载日志列表
/// </summary>
/// <param name="projectId"></param>
/// <param name="userId"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
public Model.ResponeData getHSSELogData(string HSSELogId)
{
var responeData = new Model.ResponeData();
try
{
responeData.data = HSSELogService.getHSSELogData(HSSELogId);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
/// <summary>
/// 加载天气
/// </summary>
/// <returns></returns>
public Model.ResponeData getWeatherDataList()
{
var responeData = new Model.ResponeData();
try
{
responeData.data = ConstValue.drpConstItemList(BLL.ConstValue.Group_Weather);
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
}
return responeData;
}
/// <summary>
/// 保存日志
/// </summary>
/// <param name="licenseDataItem">作业票记录</param>
[HttpPost]
public Model.ResponeData SaveHSSELogData([FromBody] Model.Manager_HSSELog HSSELog)
{
var responeData = new Model.ResponeData();
HSSELog.IsVisible = true;
try
{
if (!string.IsNullOrEmpty(HSSELog.HSSELogId))
{
BLL.HSSELogService.UpdateHSSELog(HSSELog);
responeData.message = "修改成功";
}
else
{
HSSELog.HSSELogId = SQLHelper.GetNewID(typeof(Model.Manager_HSSELog));
BLL.HSSELogService.AddHSSELog(HSSELog);
responeData.message = "保存成功";
}
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.Message;
ErrLogInfo.WriteLog(string.Empty, ex);
}
return responeData;
}
}
}
+1
View File
@@ -181,6 +181,7 @@
<Compile Include="Controllers\FaceController.cs" />
<Compile Include="Controllers\DoorServerController.cs" />
<Compile Include="Controllers\HJGL\GetHJDataController.cs" />
<Compile Include="Controllers\HSSE\HSSELogController.cs" />
<Compile Include="Controllers\HSSE\TestingController.cs" />
<Compile Include="Controllers\Person\PersonCheckController.cs" />
<Compile Include="Controllers\CQMS\CheckEquipmentController.cs" />