项目主数据
This commit is contained in:
@@ -25,6 +25,7 @@ namespace BLL
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false) && project.ProjectState == "1"
|
||||
&& project.IsCNCECShow == true
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -71,6 +72,7 @@ namespace BLL
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false) && project.ProjectState == "2"
|
||||
&& project.IsCNCECShow == true
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -116,6 +118,7 @@ namespace BLL
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false) && project.ProjectState == "3"
|
||||
&& project.IsCNCECShow == true
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
@@ -153,7 +156,8 @@ namespace BLL
|
||||
join sysConst in Funs.DB.Sys_Const on new { ProjectState2 = project.ProjectState2, GroupId = BLL.ConstValue.GroupId_ProjectState } equals new { ProjectState2 = sysConst.ConstValue, GroupId = sysConst.GroupId } into sysConstJoin
|
||||
from sysConst in sysConstJoin.DefaultIfEmpty()
|
||||
where (project.ProjectAttribute == "GONGCHENG" || project.ProjectAttribute == null) && (project.IsDelete == null || project.IsDelete == false)
|
||||
select new ProjectOutput
|
||||
&& project.IsCNCECShow == true
|
||||
select new ProjectOutput
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
ProjectCode = project.ProjectCode,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
using System;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static BLL.UnitHazardRegisterService;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -38,6 +39,46 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表ID驳回所有明细
|
||||
/// </summary>
|
||||
/// <param name="registerId">主表ID</param>
|
||||
public static void RejectItemsByRegisterId(string registerId)
|
||||
{
|
||||
var items = (from x in Funs.DB.Supervise_UnitHazardRegisterItem
|
||||
where x.UnitHazardRegisterId == registerId && x.CompleteStatus == 1
|
||||
select x).ToList();
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.CompleteStatus = 0;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ItemID驳回明细整改
|
||||
/// </summary>
|
||||
/// <param name="ItemId">主表ID</param>
|
||||
public static void RejectItemByRegisterItemId(string ItemId)
|
||||
{
|
||||
var item = (from x in Funs.DB.Supervise_UnitHazardRegisterItem
|
||||
where x.UnitHazardRegisterItemId == ItemId && x.CompleteStatus == 1
|
||||
select x).FirstOrDefault();
|
||||
if (item != null)
|
||||
{
|
||||
item.CompleteStatus = 0;
|
||||
Funs.DB.SubmitChanges();
|
||||
var obj = (from x in Funs.DB.Supervise_UnitHazardRegister
|
||||
where x.UnitHazardRegisterId == item.UnitHazardRegisterId && x.States == (int)StateInt.已闭环
|
||||
select x).FirstOrDefault();
|
||||
if (obj != null)
|
||||
{
|
||||
obj.States = (int)StateInt.部分整改;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除明细记录
|
||||
/// </summary>
|
||||
|
||||
@@ -103,6 +103,22 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 驳回企业级检查记录
|
||||
/// </summary>
|
||||
/// <param name="registerId">检查记录ID</param>
|
||||
public static void RejectUnitHazardRegisterById(string registerId)
|
||||
{
|
||||
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
|
||||
{
|
||||
var register = db.Supervise_UnitHazardRegister.FirstOrDefault(e => e.UnitHazardRegisterId == registerId);
|
||||
if (register != null)
|
||||
{
|
||||
register.States = (int)StateInt.待整改;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据项目和时间段获取检查数量
|
||||
@@ -149,6 +165,22 @@ namespace BLL
|
||||
return register.States <= (int)StateInt.待提交;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否可以驳回检查记录整改结果
|
||||
/// </summary>
|
||||
/// <param name="registerId">检查记录ID</param>
|
||||
/// <returns>true=可以驳回,false=不能驳回</returns>
|
||||
public static bool CanRejectRegister(string registerId)
|
||||
{
|
||||
var register = GetUnitHazardRegisterById(registerId);
|
||||
if (register == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// 只有"已闭环"和"部分整改"状态可以撤回,其他状态不能撤回
|
||||
return register.States == (int)StateInt.已闭环 || register.States == (int)StateInt.部分整改;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业级检查列表(使用input对象,返回总数)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user