质量不符合清单
This commit is contained in:
+2
-3
@@ -302,6 +302,7 @@
|
||||
<Compile Include="BaseInfo\WorkPostService.cs" />
|
||||
<Compile Include="BaseInfo\WorkStageService.cs" />
|
||||
<Compile Include="Check\HSE\CheckProblemSafetyService.cs" />
|
||||
<Compile Include="Check\QMS\CheckProblemQualityService.cs" />
|
||||
<Compile Include="Common\AttachFileService.cs" />
|
||||
<Compile Include="Common\Captcha.cs" />
|
||||
<Compile Include="Common\CodeRecordsService.cs" />
|
||||
@@ -1207,9 +1208,7 @@
|
||||
<ItemGroup>
|
||||
<WCFMetadataStorage Include="Service References\CNCECHSSEService\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Check\QMS\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
@@ -85,12 +85,11 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 类型下拉框(末级)
|
||||
/// 类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitClassifyIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
public static void InitClassifyDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "ClassifyId";
|
||||
dropName.DataTextField = "ClassifyName";
|
||||
|
||||
@@ -94,17 +94,18 @@ namespace BLL
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 教材库下拉框
|
||||
/// 问题性质明细下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="workPostId">职务Id</param>
|
||||
/// <param name="natureId">性质Id</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string workPostId, bool isShowPlease)
|
||||
public static void InitNatureItemDownList(FineUIPro.DropDownList dropName, string natureId, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureItemId";
|
||||
dropName.DataTextField = "NatureItemName";
|
||||
dropName.DataSource = GetNatureItemList(workPostId);
|
||||
dropName.DataTextField = "NatureItemContent";
|
||||
dropName.DataSource = GetNatureItemList(natureId);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
@@ -115,14 +116,14 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 获取下拉项
|
||||
/// </summary>
|
||||
/// <param name="classifyId"></param>
|
||||
/// <param name="natureId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_QualityProblemNatureItem> GetNatureItemList(string classifyId)
|
||||
public static List<Model.Base_QualityProblemNatureItem> GetNatureItemList(string natureId)
|
||||
{
|
||||
var lst = (from x in Funs.DB.Base_QualityProblemNatureItem orderby x.NatureItemCode select x).ToList();
|
||||
if (!string.IsNullOrWhiteSpace(classifyId))
|
||||
if (!string.IsNullOrWhiteSpace(natureId))
|
||||
{
|
||||
lst = lst.Where(x => x.NatureId == classifyId).ToList();
|
||||
lst = lst.Where(x => x.NatureId == natureId).ToList();
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BLL
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitNatureIsEndDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
public static void InitNatureDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "NatureId";
|
||||
dropName.DataTextField = "NatureName";
|
||||
|
||||
@@ -88,7 +88,6 @@ namespace BLL
|
||||
/// 类型下拉框
|
||||
/// </summary>
|
||||
/// <param name="dropName"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="isShowPlease"></param>
|
||||
public static void InitClassifyDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量不符合项清单
|
||||
/// </summary>
|
||||
public static class CheckProblemQualityService
|
||||
{
|
||||
#region Fields
|
||||
|
||||
public static Dictionary<string, int> StateMap = new Dictionary<string, int>
|
||||
{
|
||||
{ "整改中" ,(int)StateInt.整改中},
|
||||
{ "已闭环" ,(int)StateInt.已闭环},
|
||||
};
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Enums
|
||||
|
||||
public enum StateInt : int
|
||||
{
|
||||
整改中 = 1,
|
||||
已闭环 = 0
|
||||
}
|
||||
|
||||
#endregion Enums
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID获取检查记录
|
||||
/// </summary>
|
||||
/// <param name="checkId">检查记录ID</param>
|
||||
/// <returns>检查记录</returns>
|
||||
public static Model.CheckProblem_Quality GetCheckProblemById(string checkId)
|
||||
{
|
||||
return Funs.DB.CheckProblem_Quality.FirstOrDefault(e => e.CheckId == checkId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加检查记录
|
||||
/// </summary>
|
||||
/// <param name="model">检查记录</param>
|
||||
public static void AddCheckProblem(Model.CheckProblem_Quality model)
|
||||
{
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
Model.CheckProblem_Quality newModel = new Model.CheckProblem_Quality
|
||||
{
|
||||
CheckId = model.CheckId,
|
||||
UnitId = model.UnitId,
|
||||
UnitName = model.UnitName,
|
||||
ProjectId = model.ProjectId,
|
||||
ProjectName = model.ProjectName,
|
||||
State = model.State,
|
||||
Address = model.Address,
|
||||
Description = model.Description,
|
||||
UnitType = model.UnitType,
|
||||
AssemblyName = model.AssemblyName,
|
||||
//CheckUserId = model.CheckUserId,
|
||||
//CheckUserName = model.CheckUserName,
|
||||
CheckTeamUser = model.CheckTeamUser,
|
||||
CheckDate = model.CheckDate,
|
||||
LimitDate = model.LimitDate,
|
||||
CloseTime = model.CloseTime,
|
||||
RectificationUserId = model.RectificationUserId,
|
||||
RectificationUserName = model.RectificationUserName,
|
||||
PMUserId = model.PMUserId,
|
||||
PMUserName = model.PMUserName,
|
||||
QCUserId = model.QCUserId,
|
||||
QCUserName = model.QCUserName,
|
||||
ClassifyId = model.ClassifyId,
|
||||
ClassifyItemId = model.ClassifyItemId,
|
||||
NatureId = model.NatureId,
|
||||
NatureItemId = model.NatureItemId,
|
||||
AttachUrl = model.AttachUrl,
|
||||
RectificationUrl = model.RectificationUrl,
|
||||
Remark = model.Remark,
|
||||
CompileMan = model.CompileMan,
|
||||
CompileManName = model.CompileManName,
|
||||
CompileDate = DateTime.Now
|
||||
};
|
||||
db.CheckProblem_Quality.InsertOnSubmit(newModel);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新检查记录
|
||||
/// </summary>
|
||||
/// <param name="model">检查记录</param>
|
||||
public static void UpdateCheckProblem(Model.CheckProblem_Quality model)
|
||||
{
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
Model.CheckProblem_Quality newModel = db.CheckProblem_Quality.FirstOrDefault(e => e.CheckId == model.CheckId);
|
||||
if (newModel != null)
|
||||
{
|
||||
newModel.CheckDate = model.CheckDate;
|
||||
newModel.UnitId = model.UnitId;
|
||||
newModel.UnitName = model.UnitName;
|
||||
newModel.ProjectId = model.ProjectId;
|
||||
newModel.ProjectName = model.ProjectName;
|
||||
newModel.State = model.State;
|
||||
newModel.Address = model.Address;
|
||||
newModel.Description = model.Description;
|
||||
newModel.UnitType = model.UnitType;
|
||||
newModel.AssemblyName = model.AssemblyName;
|
||||
//newModel.CheckUserId = model.CheckUserId;
|
||||
//newModel.CheckUserName = model.CheckUserName;
|
||||
newModel.CheckTeamUser = model.CheckTeamUser;
|
||||
newModel.CheckDate = model.CheckDate;
|
||||
newModel.LimitDate = model.LimitDate;
|
||||
newModel.CloseTime = model.CloseTime;
|
||||
newModel.RectificationUserId = model.RectificationUserId;
|
||||
newModel.RectificationUserName = model.RectificationUserName;
|
||||
newModel.PMUserId = model.PMUserId;
|
||||
newModel.PMUserName = model.PMUserName;
|
||||
newModel.QCUserId = model.QCUserId;
|
||||
newModel.QCUserName = model.QCUserName;
|
||||
newModel.ClassifyId = model.ClassifyId;
|
||||
newModel.ClassifyItemId = model.ClassifyItemId;
|
||||
newModel.NatureId = model.NatureId;
|
||||
newModel.NatureItemId = model.NatureItemId;
|
||||
newModel.AttachUrl = model.AttachUrl;
|
||||
newModel.RectificationUrl = model.RectificationUrl;
|
||||
newModel.Remark = model.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string ConvertState(int state)
|
||||
{
|
||||
string result = string.Empty;
|
||||
result = StateMap.First(c => c.Value == state).Key;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除检查记录
|
||||
/// </summary>
|
||||
/// <param name="checkId">检查记录ID</param>
|
||||
public static void DeleteCheckProblemById(string checkId)
|
||||
{
|
||||
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
|
||||
{
|
||||
var model = db.CheckProblem_Quality.FirstOrDefault(e => e.CheckId == checkId);
|
||||
if (model != null)
|
||||
{
|
||||
// 删除附件
|
||||
if (!string.IsNullOrEmpty(model.AttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.AttachUrl);
|
||||
}
|
||||
// 删除附件
|
||||
if (!string.IsNullOrEmpty(model.RectificationUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, model.RectificationUrl);
|
||||
}
|
||||
//// 删除编码记录
|
||||
//BLL.CodeRecordsService.DeleteCodeRecordsByDataId(checkId);
|
||||
// 删除附件
|
||||
BLL.CommonService.DeleteAttachFileById(checkId);
|
||||
|
||||
db.CheckProblem_Quality.DeleteOnSubmit(model);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目和时间段获取检查数量
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="startTime">开始时间</param>
|
||||
/// <param name="endTime">结束时间</param>
|
||||
/// <returns>检查数量</returns>
|
||||
public static int GetCount(string projectId, DateTime startTime, DateTime endTime)
|
||||
{
|
||||
return (from x in Funs.DB.CheckProblem_Quality
|
||||
where x.ProjectId == projectId && x.CheckDate >= startTime && x.CheckDate <= endTime
|
||||
select x).Count();
|
||||
}
|
||||
//public static int GetCount(string checkMainType)
|
||||
//{
|
||||
// return (from x in Funs.DB.CheckProblem_Quality
|
||||
// where x.CheckMainType == checkMainType
|
||||
// select x.CheckProblemId).Count();
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否可以删除检查记录
|
||||
/// </summary>
|
||||
/// <param name="checkId">检查记录ID</param>
|
||||
/// <returns>true=可以删除,false=不能删除</returns>
|
||||
public static bool CanDeleteCheckProblem(string checkId)
|
||||
{
|
||||
var model = GetCheckProblemById(checkId);
|
||||
if (model == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// 只有"整改中"状态可以删除,其他状态不能删除
|
||||
return model.State == (int)StateInt.整改中;
|
||||
}
|
||||
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,33 @@ namespace BLL
|
||||
|
||||
#endregion
|
||||
|
||||
#region 质量不符合项
|
||||
|
||||
/// <summary>
|
||||
/// Q1人员管理Id
|
||||
/// </summary>
|
||||
public const string QualityClassifyIdQ1 = "4a468578-e334-4a44-a43c-e2c7fc9b2b3a";
|
||||
/// <summary>
|
||||
/// Q2现场管理Id
|
||||
/// </summary>
|
||||
public const string QualityClassifyIdQ2 = "4fa4f5b2-421d-4636-aa58-37eaef20aad5";
|
||||
/// <summary>
|
||||
/// Q3施工质量Id
|
||||
/// </summary>
|
||||
public const string QualityClassifyIdQ3 = "343af0c9-045f-44e0-80c3-59bc891fa349";
|
||||
/// <summary>
|
||||
/// Q4质量文件和记录Id
|
||||
/// </summary>
|
||||
public const string QualityClassifyIdQ4 = "0d1a5bca-9443-4ce6-96e8-c9d5886b67e7";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// N1质量停工问题Id
|
||||
/// </summary>
|
||||
public const string QualityNatureIdN1 = "51a12920-99ee-4099-a978-457eba4fc935";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 焊条发放回收纪录
|
||||
@@ -1844,6 +1871,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string CheckProblemSafetyDataInTemplateUrl = "File\\Excel\\DataIn\\安全不符合项清单导入模板.xlsx";
|
||||
|
||||
/// <summary>
|
||||
/// 质量危害因素数据导入模板
|
||||
/// </summary>
|
||||
public const string CheckProblemQualityDataInTemplateUrl = "File\\Excel\\DataIn\\质量不符合项清单导入模板.xlsx";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 不符合项菜单
|
||||
@@ -1853,6 +1885,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string SafetyCheckProblemMenuId = "664ACF2F-6750-4389-AF11-F429010FC9A7";
|
||||
|
||||
/// <summary>
|
||||
/// 质量不符合清单
|
||||
/// </summary>
|
||||
public const string QualityCheckProblemMenuId = "758C599E-3686-4844-8A34-482B6537968C";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 不符合项基础字典
|
||||
|
||||
Reference in New Issue
Block a user