合并最新
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Timers;
|
||||
using System.DirectoryServices;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class ADDataInService
|
||||
{
|
||||
#region 启动监视器 系统启动5分钟
|
||||
/// <summary>
|
||||
/// 监视组件
|
||||
/// </summary>
|
||||
private static Timer messageTimer;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 系统启动5分钟
|
||||
/// </summary>
|
||||
public static void StartMonitor()
|
||||
{
|
||||
var adomain = ADomainService.getADomain();
|
||||
if (adomain != null && adomain.Intervaltime.HasValue)
|
||||
{
|
||||
int adTimeJ = adomain.Intervaltime ?? 600;
|
||||
if (messageTimer != null)
|
||||
{
|
||||
messageTimer.Stop();
|
||||
messageTimer.Dispose();
|
||||
messageTimer = null;
|
||||
}
|
||||
|
||||
messageTimer = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimer.Elapsed += new ElapsedEventHandler(AdUserInProcess);
|
||||
|
||||
messageTimer.Interval = 60000 * adTimeJ;
|
||||
messageTimer.Start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
/// </summary>
|
||||
/// <param name="sender">Timer组件</param>
|
||||
/// <param name="e">事件参数</param>
|
||||
private static void AdUserInProcess(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (messageTimer != null)
|
||||
{
|
||||
messageTimer.Stop();
|
||||
}
|
||||
|
||||
BLL.ADomainService.ADomainUserIn();
|
||||
|
||||
if (messageTimer != null)
|
||||
{
|
||||
messageTimer.Dispose();
|
||||
messageTimer = null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 启动监视器 定时0:05执行
|
||||
/// <summary>
|
||||
/// 监视组件
|
||||
/// </summary>
|
||||
private static Timer messageTimerEve;
|
||||
|
||||
/// <summary>
|
||||
/// 启动监视器,不一定能成功,根据系统设置决定对监视器执行的操作 定时
|
||||
/// </summary>
|
||||
public static void StartMonitorEve()
|
||||
{
|
||||
if (messageTimerEve != null)
|
||||
{
|
||||
messageTimerEve.Stop();
|
||||
messageTimerEve.Dispose();
|
||||
messageTimerEve = null;
|
||||
}
|
||||
|
||||
messageTimerEve = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimerEve.Elapsed += new ElapsedEventHandler(ColligateFormConfirmProcessEve);
|
||||
messageTimerEve.Interval = GetMessageTimerEveNextInterval();
|
||||
messageTimerEve.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 定时00:05 执行
|
||||
/// </summary>
|
||||
/// <param name="sender">Timer组件</param>
|
||||
/// <param name="e">事件参数</param>
|
||||
private static void ColligateFormConfirmProcessEve(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (messageTimerEve != null)
|
||||
{
|
||||
messageTimerEve.Stop();
|
||||
}
|
||||
|
||||
BLL.ADomainService.ADomainUserIn();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog("获取AD域", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
messageTimerEve.Interval = GetMessageTimerEveNextInterval();
|
||||
messageTimerEve.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算MessageTimerEve定时器的执行间隔
|
||||
/// </summary>
|
||||
/// <returns>执行间隔</returns>
|
||||
private static double GetMessageTimerEveNextInterval()
|
||||
{
|
||||
double returnValue = 0;
|
||||
TimeSpan curentTime = DateTime.Now.TimeOfDay;
|
||||
int hour = 10;
|
||||
//if (!String.IsNullOrEmpty(Funs.AdTimeD))
|
||||
//{
|
||||
// hour = int.Parse(Funs.AdTimeD);
|
||||
//}
|
||||
|
||||
TimeSpan triggerTime = new TimeSpan(hour, 07, 0);
|
||||
if (curentTime > triggerTime)
|
||||
{
|
||||
// 超过了执行时间
|
||||
returnValue = (new TimeSpan(23, 59, 59) - curentTime + triggerTime.Add(new TimeSpan(0, 0, 1))).TotalMilliseconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
returnValue = (triggerTime - curentTime).TotalMilliseconds;
|
||||
}
|
||||
|
||||
if (returnValue <= 0)
|
||||
{
|
||||
// 误差纠正
|
||||
returnValue = 1;
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
namespace BLL
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Collections;
|
||||
using System.Timers;
|
||||
using System.DirectoryServices;
|
||||
|
||||
public class ADomainService
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取AD域信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Model.Sys_ADomain getADomain()
|
||||
{
|
||||
return Funs.DB.Sys_ADomain.FirstOrDefault();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除AD域信息
|
||||
/// </summary>
|
||||
/// <param name="FlowSetId"></param>
|
||||
public static void DeleteADomain()
|
||||
{
|
||||
var aDomain = from x in Funs.DB.Sys_ADomain select x;
|
||||
if (aDomain.Count() > 0)
|
||||
{
|
||||
Funs.DB.Sys_ADomain.DeleteAllOnSubmit(aDomain);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加AD域设置信息
|
||||
/// </summary>
|
||||
/// <param name="FlowProjectSetName"></param>
|
||||
/// <param name="def"></param>
|
||||
public static void AddADomain(Model.Sys_ADomain aDomain)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
aDomain.ADomainId = SQLHelper.GetNewID();
|
||||
db.Sys_ADomain.InsertOnSubmit(aDomain);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
#region 是否连接到域
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="domainName">域名或IP</param>
|
||||
/// <param name="userName">用户名</param>
|
||||
/// <param name="userPwd">密码</param>
|
||||
/// <param name="entry">域</param>
|
||||
/// <returns></returns>
|
||||
public static DirectoryEntry IsConnected(string domainName, string userName, string userPwd)
|
||||
{
|
||||
DirectoryEntry domain = new DirectoryEntry();
|
||||
try
|
||||
{
|
||||
domain.Path = string.Format("LDAP://{0}", domainName);
|
||||
domain.Username = userName;
|
||||
domain.Password = userPwd;
|
||||
domain.AuthenticationType = AuthenticationTypes.Secure;
|
||||
domain.RefreshCache();
|
||||
return domain;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog(ex.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 域中是否存在组织单位
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="entry"></param>
|
||||
/// <param name="ou"></param>
|
||||
/// <returns></returns>
|
||||
public static DirectoryEntry IsExistOU(DirectoryEntry entry, string domainName, string domainOU)
|
||||
{
|
||||
DirectoryEntry ou = new DirectoryEntry();
|
||||
try
|
||||
{
|
||||
string[] ouItem = domainOU.Split(new string[1] { "/" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var item in ouItem)
|
||||
{
|
||||
if (!item.Equals(domainName, StringComparison.OrdinalIgnoreCase) && !item.Equals(domainName + ".com", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
entry = entry.Children.Find("OU=" + item);
|
||||
ou = entry;
|
||||
}
|
||||
}
|
||||
|
||||
return ou;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BLL.ErrLogInfo.WriteLog(ex.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 导入AD域用户
|
||||
/// </summary>
|
||||
public static void ADomainUserIn()
|
||||
{
|
||||
var adomain = ADomainService.getADomain();
|
||||
if (adomain != null)
|
||||
{
|
||||
DirectoryEntry domain = BLL.ADomainService.IsConnected(adomain.DomainName, adomain.UserName, adomain.Password);
|
||||
if (domain != null)
|
||||
{
|
||||
DirectoryEntry rootOU = BLL.ADomainService.IsExistOU(domain, adomain.DomainName, adomain.RootOU);
|
||||
if (rootOU != null)
|
||||
{
|
||||
SyncAll(rootOU);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region 同步所有事件
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="entryOU"></param>
|
||||
public static void SyncAll(DirectoryEntry entryOU)
|
||||
{
|
||||
DirectorySearcher mySearcher = new DirectorySearcher(entryOU, "(objectClass=organizationalUnit)"); //查询组织单位
|
||||
DirectoryEntry root = mySearcher.SearchRoot; //查找根OU
|
||||
SyncRootOU(root);
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Sys_User user = new Model.Sys_User();
|
||||
user.Account = item.Account;
|
||||
user.UserCode = item.UserCode;
|
||||
user.Password = item.Password;
|
||||
user.UserName = item.UserName;
|
||||
if (!String.IsNullOrEmpty(item.RoleName))
|
||||
{
|
||||
var role = BLL.RoleService.getRoleByName(item.RoleName);
|
||||
if (role != null)
|
||||
{
|
||||
user.RoleId = role.RoleId;
|
||||
user.IsOffice = true;
|
||||
}
|
||||
}
|
||||
|
||||
user.IsPost = item.IsPost;
|
||||
if (!String.IsNullOrEmpty(item.UnitName))
|
||||
{
|
||||
var unit = BLL.UnitService.getUnitByUnitName(item.UnitName);
|
||||
if (unit != null)
|
||||
{
|
||||
user.UnitId = unit.UnitId;
|
||||
}
|
||||
}
|
||||
if (!String.IsNullOrEmpty(item.DepartName))
|
||||
{
|
||||
var dep = BLL.DepartService.getDepartByDepartName(item.DepartName);
|
||||
if (dep != null)
|
||||
{
|
||||
user.DepartId = dep.DepartId;
|
||||
}
|
||||
}
|
||||
////根据登录名查询用户信息
|
||||
var userSelect = BLL.UserService.GetUserByAccount(item.Account);
|
||||
if (userSelect == null) ///不存在则增加
|
||||
{
|
||||
BLL.UserService.AddUser(user);
|
||||
}
|
||||
else
|
||||
{
|
||||
////存在则更新
|
||||
//user.UserId = userSelect.UserId;
|
||||
//user.UserCode = userSelect.UserCode;
|
||||
//user.Password = userSelect.Password;
|
||||
//user.RoleId = userSelect.RoleId;
|
||||
//user.UnitId = userSelect.UnitId;
|
||||
//user.DepartId = userSelect.DepartId;
|
||||
//BLL.UserService.UpdateUser(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 同步根组织单位
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="entry"></param>
|
||||
public static void SyncRootOU(DirectoryEntry entry)
|
||||
{
|
||||
if (entry.Properties.Contains("ou") && entry.Properties.Contains("objectGUID"))
|
||||
{
|
||||
byte[] bGUID = entry.Properties["objectGUID"][0] as byte[];
|
||||
string id = BitConverter.ToString(bGUID);
|
||||
SyncSubOU(entry, id);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 同步下属组织单位及下属用户
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="entry"></param>
|
||||
/// <param name="parentId"></param>
|
||||
public static void SyncSubOU(DirectoryEntry entry, string parentId)
|
||||
{
|
||||
foreach (DirectoryEntry subEntry in entry.Children)
|
||||
{
|
||||
string entrySchemaClsName = subEntry.SchemaClassName;
|
||||
|
||||
string[] arr = subEntry.Name.Split('=');
|
||||
string categoryStr = arr[0];
|
||||
string nameStr = arr[1];
|
||||
string id = string.Empty;
|
||||
|
||||
if (subEntry.Properties.Contains("objectGUID")) //SID
|
||||
{
|
||||
byte[] bGUID = subEntry.Properties["objectGUID"][0] as byte[];
|
||||
|
||||
id = BitConverter.ToString(bGUID);
|
||||
}
|
||||
|
||||
bool isExist = list.Exists(d => d.Id == id);
|
||||
|
||||
switch (entrySchemaClsName)
|
||||
{
|
||||
case "organizationalUnit":
|
||||
SyncSubOU(subEntry, id);
|
||||
break;
|
||||
case "user":
|
||||
string account = string.Empty;
|
||||
string userCode = string.Empty;
|
||||
string password = BLL.Funs.EncryptionPassword(BLL.Const.Password);
|
||||
string userName = string.Empty;
|
||||
string roleId = string.Empty;
|
||||
bool isPost = true;
|
||||
string unitId = string.Empty;
|
||||
string department = string.Empty;
|
||||
|
||||
if (subEntry.Properties.Contains("samaccountName"))
|
||||
{
|
||||
account = subEntry.Properties["samaccountName"][0].ToString();
|
||||
if (subEntry.Properties["initials"].Value != null)
|
||||
{
|
||||
userCode = subEntry.Properties["initials"].Value.ToString();
|
||||
}
|
||||
if (subEntry.Properties["displayName"].Value != null)
|
||||
{
|
||||
userName = subEntry.Properties["displayName"].Value.ToString();
|
||||
}
|
||||
//if (subEntry.Properties["title"].Value != null)
|
||||
//{
|
||||
// roleId = subEntry.Properties["title"].Value.ToString();
|
||||
//}
|
||||
if (subEntry.Properties["company"].Value != null)
|
||||
{
|
||||
unitId = subEntry.Properties["company"].Value.ToString();
|
||||
}
|
||||
if (subEntry.Properties["department"].Value != null)
|
||||
{
|
||||
department = subEntry.Properties["department"].Value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isExist && !String.IsNullOrEmpty(account))
|
||||
{
|
||||
list.Add(new AdModel(id, account, userCode, password, userName, roleId, isPost, unitId, department));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Ad域实体
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static List<AdModel> list = new List<AdModel>();
|
||||
|
||||
/// <summary>
|
||||
/// Ad域实体
|
||||
/// </summary>
|
||||
public class AdModel
|
||||
{
|
||||
public AdModel(string id, string account, string userCode, string password, string userName,
|
||||
string roleName, bool? isPost, string unitName, string departName)
|
||||
{
|
||||
Id = id;
|
||||
Account = account;
|
||||
UserCode = userCode;
|
||||
Password = password;
|
||||
UserName = userName;
|
||||
RoleName = roleName;
|
||||
IsPost = isPost;
|
||||
UnitName = unitName;
|
||||
DepartName = departName;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Account { get; set; }
|
||||
public string UserCode { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string RoleName { get; set; }
|
||||
public bool? IsPost { get; set; }
|
||||
public string UnitName { get; set; }
|
||||
public string DepartName { get; set; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -435,6 +435,23 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取部门信息
|
||||
/// <summary>
|
||||
/// 获取部门信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<Model.BaseInfoItem> getBaseDepart(string strParam)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Base_Depart
|
||||
where strParam == null || x.DepartName.Contains(strParam)
|
||||
orderby x.DepartName
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.DepartId, BaseInfoCode = x.DepartCode, BaseInfoName = x.DepartName }).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 获取岗位信息
|
||||
/// <summary>
|
||||
/// 获取岗位信息
|
||||
@@ -459,12 +476,12 @@ namespace BLL
|
||||
var getDataLists = (from x in db.Base_WorkPost
|
||||
where strParam == null || x.WorkPostName.Contains(strParam)
|
||||
orderby x.WorkPostName
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.WorkPostId, BaseInfoCode = x.WorkPostCode, BaseInfoName = x.WorkPostName }).ToList();
|
||||
select new Model.BaseInfoItem { BaseInfoId = x.WorkPostId.ToUpper(), BaseInfoCode = x.WorkPostCode, BaseInfoName = x.WorkPostName }).ToList();
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
var user = from u in db.SitePerson_Person
|
||||
where u.ProjectId == projectId
|
||||
select u.WorkPostId;
|
||||
select u.WorkPostId.ToUpper();
|
||||
var postIds = user.Distinct();
|
||||
|
||||
foreach (var item in getDataLists)
|
||||
|
||||
@@ -82,6 +82,7 @@ namespace BLL
|
||||
{
|
||||
miniprogram_state = "formal";
|
||||
}
|
||||
//miniprogram_state = "developer";
|
||||
string contenttype = "application/json;charset=utf-8";
|
||||
string url = $"https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token={access_token}";
|
||||
var tempData = new
|
||||
@@ -89,7 +90,7 @@ namespace BLL
|
||||
access_token,
|
||||
touser = getUser.OpenId,
|
||||
template_id = Const.WX_TemplateID,
|
||||
page = "pages/index/main",
|
||||
page = "pages/index/index",
|
||||
data = new
|
||||
{
|
||||
thing2 = new { value = thing2 },
|
||||
@@ -100,9 +101,10 @@ namespace BLL
|
||||
miniprogram_state,
|
||||
lang = "zh_CN",
|
||||
};
|
||||
string messages= APIGetHttpService.Http(url, "POST", contenttype, null, JsonConvert.SerializeObject(tempData));
|
||||
string joson = JsonConvert.SerializeObject(tempData);
|
||||
string messages= APIGetHttpService.Http(url, "POST", contenttype, null, joson);
|
||||
//// 记录
|
||||
SaveSysHttpLog(getUser.UserName, url, messages);
|
||||
SaveSysHttpLog(getUser.UserName, url+ "$joson$" + joson , messages);
|
||||
return messages;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BLL
|
||||
var getUser = from x in db.SitePerson_Person
|
||||
where (x.Telephone == userInfo.Account || x.PersonName == userInfo.Account)
|
||||
&& (x.Password == Funs.EncryptionPassword(userInfo.Password) || (x.IdentityCard != null && x.IdentityCard.Substring(x.IdentityCard.Length - 4) == userInfo.Password))
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now) && x.IsUsed == true
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now) && x.IsUsed == 1
|
||||
select x;
|
||||
if (!string.IsNullOrEmpty(userInfo.LoginProjectId))
|
||||
{
|
||||
@@ -95,8 +95,8 @@ namespace BLL
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
IsUsed = x.IsUsed,
|
||||
IsUsedName = x.IsUsed == false ? "不启用" : "启用",
|
||||
IsUsed = x.IsUsed == 1 ? true : false,
|
||||
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
|
||||
AuditorId = x.AuditorId,
|
||||
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
|
||||
IsForeign = x.IsForeign.HasValue ? x.IsForeign : false,
|
||||
@@ -202,8 +202,8 @@ namespace BLL
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
IsUsed = x.IsUsed,
|
||||
IsUsedName = x.IsUsed == false ? "不启用" : "启用",
|
||||
IsUsed = x.IsUsed==1?true:false,
|
||||
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
|
||||
AuditorId = x.AuditorId,
|
||||
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
|
||||
IsForeign = x.IsForeign.HasValue ? x.IsForeign : false,
|
||||
@@ -257,7 +257,7 @@ namespace BLL
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (getPerson != null)
|
||||
{
|
||||
getPerson.IsUsed = false;
|
||||
getPerson.IsUsed = 0;
|
||||
getPerson.AuditorId = userId;
|
||||
getPerson.AuditorDate = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
@@ -277,7 +277,7 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var persons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null) && x.IsUsed == true
|
||||
where x.ProjectId == projectId && (x.UnitId == unitId || unitId == null) && x.IsUsed == 1
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
|
||||
orderby x.CardNo descending
|
||||
select new Model.PersonItem
|
||||
@@ -354,19 +354,19 @@ namespace BLL
|
||||
}
|
||||
if (states == "0")
|
||||
{
|
||||
getViews = getViews.Where(x => x.IsUsed == false && !x.AuditorDate.HasValue);
|
||||
getViews = getViews.Where(x => x.IsUsed == 0 && !x.AuditorDate.HasValue);
|
||||
}
|
||||
else if (states == "1")
|
||||
{
|
||||
getViews = getViews.Where(x => x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now));
|
||||
getViews = getViews.Where(x => x.IsUsed == 1 && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now));
|
||||
}
|
||||
else if (states == "2")
|
||||
{
|
||||
getViews = getViews.Where(x => x.IsUsed == true && x.OutTime <= DateTime.Now);
|
||||
getViews = getViews.Where(x => x.IsUsed == 1 && x.OutTime <= DateTime.Now);
|
||||
}
|
||||
else if (states == "-1")
|
||||
{
|
||||
getViews = getViews.Where(x => x.IsUsed == false && x.AuditorDate.HasValue);
|
||||
getViews = getViews.Where(x => x.IsUsed == 0 && x.AuditorDate.HasValue);
|
||||
}
|
||||
getPersonListCount = getViews.Count();
|
||||
|
||||
@@ -400,8 +400,8 @@ namespace BLL
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
IsUsed = x.IsUsed,
|
||||
IsUsedName = (x.IsUsed == true ? "启用" : "未启用"),
|
||||
IsUsed = x.IsUsed==1?true:false,
|
||||
IsUsedName = (x.IsUsed == 1 ? "启用" : "未启用"),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
PostType = ReturnQuality(x.PersonId, x.WorkPostId),
|
||||
@@ -464,6 +464,100 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据培训类型获取项目培训人员信息
|
||||
/// <summary>
|
||||
/// 根据培训类型获取项目培训人员信息
|
||||
/// </summary>
|
||||
/// <param name="projectId">项目ID</param>
|
||||
/// <param name="unitIds">培训单位ID</param>
|
||||
/// <param name="departIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByDepartAndTrainTypeId( string unitIds, string departIds, string trainTypeId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
var getPersons = from x in db.Sys_User
|
||||
where unitIdList.Contains(x.UnitId)
|
||||
|
||||
select new Model.PersonItem
|
||||
{
|
||||
PersonId = x.UserId,
|
||||
PersonName = x.UserName,
|
||||
SexName = x.Sex,
|
||||
IdentityCard = x.IdentityCard,
|
||||
UnitId = x.UnitId,
|
||||
WorkPostId = x.WorkPostId,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartId = x.DepartId
|
||||
};
|
||||
if (!string.IsNullOrEmpty(departIds))
|
||||
{
|
||||
List<string> departIdList = Funs.GetStrListByStr(departIds, ',');
|
||||
getPersons = getPersons.Where(x => departIdList.Contains(x.DepartId));
|
||||
}
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
Model.Base_Unit unit = db.Base_Unit.FirstOrDefault(x => x.UnitId == item.UnitId);
|
||||
if (!string.IsNullOrEmpty(item.UnitId))
|
||||
{
|
||||
if (unit != null)
|
||||
{
|
||||
item.UnitCode = unit.UnitCode;
|
||||
item.UnitName = unit.UnitName;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(item.DepartId))
|
||||
{
|
||||
Model.Base_Depart depart = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
|
||||
if (depart != null)
|
||||
{
|
||||
item.DepartName = depart.DepartName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//List<Model.PersonItem> getTrainPersonList = new List<Model.PersonItem>();
|
||||
//var getTrainType = db.Base_TrainType.FirstOrDefault(e => e.TrainTypeId == trainTypeId);
|
||||
//if (getTrainType != null && (!getTrainType.IsRepeat.HasValue || getTrainType.IsRepeat == false))
|
||||
//{
|
||||
// foreach (var item in getPersons)
|
||||
// {
|
||||
// var getTrainPersonIdList1 = (from x in db.EduTrain_TrainRecordDetail
|
||||
// join y in db.EduTrain_TrainRecord on x.TrainingId equals y.TrainingId
|
||||
// where y.ProjectId ==null && y.TrainTypeId == trainTypeId && x.CheckResult == true && x.PersonId == item.PersonId
|
||||
// select x).FirstOrDefault();
|
||||
// if (getTrainPersonIdList1 == null)
|
||||
// {
|
||||
// var getTrainPersonIdList2 = (from x in db.Training_Task
|
||||
// join y in db.Training_Plan on x.PlanId equals y.PlanId
|
||||
// where y.ProjectId == null && y.TrainTypeId == trainTypeId && y.States != "3" && x.UserId == item.PersonId
|
||||
// select x).FirstOrDefault();
|
||||
// if (getTrainPersonIdList2 == null)
|
||||
// {
|
||||
// getTrainPersonList.Add(item);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return getTrainPersonList;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
return getPersons.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 根据培训类型获取项目培训人员信息
|
||||
/// <summary>
|
||||
/// 根据培训类型获取项目培训人员信息
|
||||
@@ -473,13 +567,13 @@ namespace BLL
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string trainTypeId)
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
var getPersons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == true
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
|
||||
select new Model.PersonItem
|
||||
{
|
||||
@@ -542,6 +636,11 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 人员信息保存方法
|
||||
@@ -626,11 +725,11 @@ namespace BLL
|
||||
}
|
||||
if (person.IsUsed == true)
|
||||
{
|
||||
newPerson.IsUsed = true;
|
||||
newPerson.IsUsed = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPerson.IsUsed = false;
|
||||
newPerson.IsUsed = 0;
|
||||
}
|
||||
newPerson.Password = PersonService.GetPersonPassWord(person.IdentityCard);
|
||||
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
|
||||
@@ -703,13 +802,13 @@ namespace BLL
|
||||
{
|
||||
getPerson.WorkAreaId = person.WorkAreaId;
|
||||
}
|
||||
if (getPerson.AuditorDate.HasValue && getPerson.IsUsed == false)
|
||||
if (getPerson.AuditorDate.HasValue && getPerson.IsUsed == 0)
|
||||
{
|
||||
getPerson.AuditorDate = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
getPerson.IsUsed = person.IsUsed;
|
||||
getPerson.IsUsed = person.IsUsed?1:0;
|
||||
getPerson.AuditorDate = DateTime.Now;
|
||||
}
|
||||
getPerson.AuditorId = person.AuditorId;
|
||||
@@ -1449,7 +1548,7 @@ namespace BLL
|
||||
else message = "识别不到人脸";
|
||||
if (isOK)
|
||||
{
|
||||
var faceResult = FaceClass.add(person.PersonId, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["CEMS_IMG_URL"].ToString() + person.PhotoUrl, AccessToken.getAccessToken());
|
||||
var faceResult = FaceClass.add(person.PersonId, person.IdentityCard, System.Configuration.ConfigurationManager.AppSettings["SGGLUrl"].ToString() + person.PhotoUrl, AccessToken.getAccessToken());
|
||||
var face = JsonConvert.DeserializeObject<dynamic>(faceResult);
|
||||
// JsonConvert.DeserializeObject<dynamic>(myPunishItem);
|
||||
if (face.error_code == 0 || face.error_code == 223105)
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace BLL
|
||||
join z in db.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
join y in db.QualityAudit_PersonQuality on x.PersonId equals y.PersonId into jonPerson
|
||||
from y in jonPerson.DefaultIfEmpty()
|
||||
where x.ProjectId == projectId && z.PostType == Const.PostType_2 && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
where x.ProjectId == projectId && z.PostType == Const.PostType_2 && x.IsUsed == 1 && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
orderby x.CardNo
|
||||
select new Model.PersonQualityItem
|
||||
{
|
||||
@@ -210,7 +210,7 @@ namespace BLL
|
||||
join z in db.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
join y in db.QualityAudit_SafePersonQuality on x.PersonId equals y.PersonId into jonPerson
|
||||
from y in jonPerson.DefaultIfEmpty()
|
||||
where x.ProjectId == projectId && z.IsHsse == true && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
where x.ProjectId == projectId && z.IsHsse == true && x.IsUsed == 1 && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
orderby y.LimitDate
|
||||
select new Model.PersonQualityItem
|
||||
{
|
||||
@@ -252,7 +252,7 @@ namespace BLL
|
||||
join z in db.Base_WorkPost on x.WorkPostId equals z.WorkPostId
|
||||
join y in db.QualityAudit_EquipmentPersonQuality on x.PersonId equals y.PersonId into jonPerson
|
||||
from y in jonPerson.DefaultIfEmpty()
|
||||
where x.ProjectId == projectId && z.PostType == Const.PostType_5 && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
where x.ProjectId == projectId && z.PostType == Const.PostType_5 && x.IsUsed == 1 && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
orderby y.LimitDate
|
||||
select new Model.PersonQualityItem
|
||||
{
|
||||
|
||||
@@ -24,24 +24,53 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanManId = x.PlanManId,
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
if (string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.ProjectId ==null && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
|
||||
TestPlanManId = x.PlanManId,
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null)
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanManId = x.PlanManId,
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.PlanManId).UserName,
|
||||
TestPalce = x.TestPalce,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -56,7 +85,7 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = from x in db.Training_TestPlan
|
||||
var getDataLists = (from x in db.Training_TestPlan
|
||||
where x.TestPlanId == testPlanId
|
||||
select new Model.TestPlanItem
|
||||
{
|
||||
@@ -65,7 +94,6 @@ namespace BLL
|
||||
TestPlanCode = x.PlanCode,
|
||||
TestPlanName = x.PlanName,
|
||||
TestPlanManId = x.PlanManId,
|
||||
TestPlanManName = db.Sys_User.First(y => y.UserId == x.TestPlanId).UserName,
|
||||
TestPlanDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.PlanDate),
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
@@ -80,11 +108,36 @@ namespace BLL
|
||||
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
WorkPostIds = x.WorkPostIds,
|
||||
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostIds),
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
|
||||
States = x.States,
|
||||
QRCodeUrl = x.QRCodeUrl.Replace('\\', '/'),
|
||||
TrainingPlanId = x.PlanId,
|
||||
};
|
||||
return getDataLists.FirstOrDefault();
|
||||
}).FirstOrDefault();
|
||||
|
||||
if (getDataLists != null)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(y => y.UserId == getDataLists.TestPlanManId);
|
||||
if (user != null)
|
||||
getDataLists.TestPlanManName = user.UserName;
|
||||
if (!string.IsNullOrEmpty(getDataLists.UnitIds))
|
||||
{
|
||||
string[] uids = getDataLists.UnitIds.Split(',');
|
||||
var units = db.Base_Unit.Where(x => uids.Contains(x.UnitId)).ToList();
|
||||
string unitName = "";
|
||||
foreach(var u in units)
|
||||
{
|
||||
unitName += u.UnitName + ",";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitName))
|
||||
{
|
||||
getDataLists.UnitNames = unitName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -102,7 +155,7 @@ namespace BLL
|
||||
Model.Training_TestPlan newTestPlan = new Model.Training_TestPlan
|
||||
{
|
||||
TestPlanId = getTestPlan.TestPlanId,
|
||||
ProjectId = getTestPlan.ProjectId,
|
||||
|
||||
PlanCode = getTestPlan.TestPlanCode,
|
||||
PlanName = getTestPlan.TestPlanName,
|
||||
PlanManId = getTestPlan.TestPlanManId,
|
||||
@@ -118,10 +171,14 @@ namespace BLL
|
||||
TestPalce = getTestPlan.TestPalce,
|
||||
UnitIds = getTestPlan.UnitIds,
|
||||
WorkPostIds = getTestPlan.WorkPostIds,
|
||||
DepartIds = getTestPlan.DepartIds,
|
||||
States = getTestPlan.States,
|
||||
PlanDate = DateTime.Now,
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(getTestPlan.ProjectId))
|
||||
{
|
||||
newTestPlan.ProjectId = getTestPlan.ProjectId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getTestPlan.TrainingPlanId))
|
||||
{
|
||||
newTestPlan.PlanId = getTestPlan.TrainingPlanId;
|
||||
@@ -162,6 +219,7 @@ namespace BLL
|
||||
isUpdate.TestPalce = newTestPlan.TestPalce;
|
||||
isUpdate.UnitIds = newTestPlan.UnitIds;
|
||||
isUpdate.WorkPostIds = newTestPlan.WorkPostIds;
|
||||
isUpdate.DepartIds = newTestPlan.DepartIds;
|
||||
////删除 考生记录
|
||||
var deleteRecords = from x in db.Training_TestRecord
|
||||
where x.TestPlanId == isUpdate.TestPlanId
|
||||
@@ -230,8 +288,9 @@ namespace BLL
|
||||
////新增考试人员明细
|
||||
foreach (var item in getTestPlan.TestRecordItems)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(e => e.UserId == item.TestManId);
|
||||
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == item.TestManId);
|
||||
if (person != null)
|
||||
if (user != null || person != null)
|
||||
{
|
||||
Model.Training_TestRecord newTrainDetail = new Model.Training_TestRecord
|
||||
{
|
||||
@@ -245,6 +304,7 @@ namespace BLL
|
||||
db.Training_TestRecord.InsertOnSubmit(newTrainDetail);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (getTestPlan.TestPlanTrainingItems.Count() > 0)
|
||||
@@ -357,6 +417,8 @@ namespace BLL
|
||||
UnitNames = UnitService.getUnitNamesUnitIds(getTrainingPlan.UnitIds),
|
||||
WorkPostIds = getTrainingPlan.WorkPostId,
|
||||
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(getTrainingPlan.WorkPostId),
|
||||
DepartIds=getTrainingPlan.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIds(getTrainingPlan.DepartIds),
|
||||
PlanId = getTrainingPlan.PlanId,
|
||||
States = "0",
|
||||
};
|
||||
|
||||
@@ -36,6 +36,27 @@ namespace BLL
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
}).ToList();
|
||||
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(p => p.UserId == item.TestManId);
|
||||
if (user != null)
|
||||
{
|
||||
item.TestManName = user.UserName;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var person = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == item.TestManId);
|
||||
if (person != null)
|
||||
{
|
||||
item.TestManName = person.PersonName;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +91,24 @@ namespace BLL
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
};
|
||||
return getDataLists.FirstOrDefault();
|
||||
var res = getDataLists.FirstOrDefault();
|
||||
if (res != null)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(x => x.UserId == res.TestManId);
|
||||
if (user != null)
|
||||
{
|
||||
res.TestManName = user.UserName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var person = db.SitePerson_Person.First(u => u.PersonId == res.TestManId);
|
||||
if (person != null)
|
||||
{
|
||||
res.TestManName = person.PersonName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -81,7 +119,152 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="testPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateTestRecordItem(Model.Training_TestPlan getTestPlan, string testRecordId, Model.SitePerson_Person person)
|
||||
public static string CreateTestRecordItem(Model.Training_TestPlan getTestPlan, string testRecordId, Model.SitePerson_Person person,Model.Sys_User user)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getTestRecord = db.Training_TestRecord.FirstOrDefault(x => x.TestRecordId == testRecordId);
|
||||
if (getTestRecord != null && !getTestRecord.TestStartTime.HasValue)
|
||||
{
|
||||
////考试时长
|
||||
getTestRecord.Duration = getTestPlan.Duration;
|
||||
getTestRecord.TestStartTime = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
////当前人考试记录 未加入考试计划的 当考试开始扫码时 不允许再参与考试
|
||||
var item = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordId == getTestRecord.TestRecordId);
|
||||
if (item == null)
|
||||
{
|
||||
List<Model.Training_TestTrainingItem> getTestTrainingItemList = new List<Model.Training_TestTrainingItem>();
|
||||
var testPlanTrainings = from x in db.Training_TestPlanTraining
|
||||
where x.TestPlanId == getTestPlan.TestPlanId
|
||||
select x;
|
||||
//// 计划考试中单选、多选、判断题总数
|
||||
int sumTestType1Count = testPlanTrainings.Sum(x => x.TestType1Count) ?? 0;
|
||||
int sumTestType2Count = testPlanTrainings.Sum(x => x.TestType2Count) ?? 0;
|
||||
int sumTestType3Count = testPlanTrainings.Sum(x => x.TestType3Count) ?? 0;
|
||||
|
||||
////获取类型下适合岗位试题集合
|
||||
List<Model.Training_TestTrainingItem> getTestTrainingItemALLs;
|
||||
string WorkPostId = "";
|
||||
string DepartId = "";
|
||||
if (person != null)
|
||||
{
|
||||
WorkPostId = person.WorkPostId;
|
||||
}
|
||||
if (user != null)
|
||||
{
|
||||
DepartId = user.DepartId;
|
||||
}
|
||||
|
||||
getTestTrainingItemALLs = (from x in db.Training_TestTrainingItem
|
||||
where x.TrainingId != null && (x.WorkPostIds == null || string.IsNullOrEmpty( WorkPostId ) || x.WorkPostIds.Contains(WorkPostId))||(x.DepartIds == null || string.IsNullOrEmpty(DepartId ) || x.DepartIds.Contains(DepartId))
|
||||
|
||||
select x).ToList();
|
||||
foreach (var itemT in testPlanTrainings)
|
||||
{
|
||||
//// 获取类型下的题目
|
||||
var getTestTrainingItems = getTestTrainingItemALLs.Where(x => x.TrainingId == itemT.TrainingId).ToList();
|
||||
if (getTestTrainingItems.Count() > 0)
|
||||
{
|
||||
////单选题
|
||||
var getSItem = getTestTrainingItems.Where(x => x.TestType == "1").OrderBy(x => Guid.NewGuid()).Take(itemT.TestType1Count ?? 1);
|
||||
if (getSItem.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getSItem);
|
||||
}
|
||||
///多选题
|
||||
var getMItem = getTestTrainingItems.Where(x => x.TestType == "2").OrderBy(x => Guid.NewGuid()).Take(itemT.TestType2Count ?? 1);
|
||||
if (getMItem.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getMItem);
|
||||
}
|
||||
///判断题
|
||||
var getJItem = getTestTrainingItems.Where(x => x.TestType == "3").OrderBy(x => Guid.NewGuid()).Take(itemT.TestType3Count ?? 1);
|
||||
if (getJItem.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getJItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
//// 获取得到的单选题、多选题、判断题 数量
|
||||
int getDiffTestType1Count = sumTestType1Count - getTestTrainingItemList.Where(x => x.TestType == "1").Count();
|
||||
int getDiffTestType2Count = sumTestType2Count - getTestTrainingItemList.Where(x => x.TestType == "2").Count();
|
||||
int getDiffTestType3Count = sumTestType3Count - getTestTrainingItemList.Where(x => x.TestType == "3").Count();
|
||||
if (getDiffTestType1Count > 0 || getDiffTestType2Count > 0 || getDiffTestType3Count > 0)
|
||||
{
|
||||
var getTestTrainingItemNulls = getTestTrainingItemALLs.Where(x => x.WorkPostIds == null).ToList();
|
||||
if (getTestTrainingItemNulls.Count() > 0)
|
||||
{
|
||||
/// 通用且未选择的题目
|
||||
var getTestTrainingItemDiffs = getTestTrainingItemNulls.Except(getTestTrainingItemList).ToList();
|
||||
////单选题
|
||||
if (getDiffTestType1Count > 0)
|
||||
{
|
||||
var getSItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "1").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType1Count);
|
||||
if (getSItemD.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getSItemD);
|
||||
}
|
||||
}
|
||||
///多选题
|
||||
if (getDiffTestType2Count > 0)
|
||||
{
|
||||
var getMItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "2").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType2Count);
|
||||
if (getMItemD.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getMItemD);
|
||||
}
|
||||
}
|
||||
///判断题
|
||||
if (getDiffTestType3Count > 0)
|
||||
{
|
||||
var getJItemD = getTestTrainingItemDiffs.Where(x => x.TestType == "3").OrderBy(x => Guid.NewGuid()).Take(getDiffTestType3Count);
|
||||
if (getJItemD.Count() > 0)
|
||||
{
|
||||
getTestTrainingItemList.AddRange(getJItemD);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getTestTrainingItemList.Count() > 0)
|
||||
{
|
||||
var getItems = from x in getTestTrainingItemList
|
||||
select new Model.Training_TestRecordItem
|
||||
{
|
||||
TestRecordItemId = SQLHelper.GetNewID(),
|
||||
TestRecordId = getTestRecord.TestRecordId,
|
||||
TrainingItemName = x.TrainingItemName,
|
||||
TrainingItemCode = x.TrainingItemCode,
|
||||
Abstracts = x.Abstracts,
|
||||
AttachUrl = x.AttachUrl,
|
||||
TestType = x.TestType,
|
||||
AItem = x.AItem,
|
||||
BItem = x.BItem,
|
||||
CItem = x.CItem,
|
||||
DItem = x.DItem,
|
||||
EItem = x.EItem,
|
||||
AnswerItems = x.AnswerItems,
|
||||
Score = x.TestType == "1" ? getTestPlan.SValue : (x.TestType == "2" ? getTestPlan.MValue : getTestPlan.JValue),
|
||||
};
|
||||
|
||||
db.Training_TestRecordItem.InsertAllOnSubmit(getItems);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
return testRecordId;
|
||||
}
|
||||
#endregion
|
||||
#region 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
||||
/// <summary>
|
||||
/// 根据PersonId、TestPlanId生成试卷 扫码生成试卷
|
||||
/// </summary>
|
||||
/// <param name="testPlanId"></param>
|
||||
/// <returns></returns>
|
||||
public static string CreateFixTestRecordItem(Model.Training_TestPlan getTestPlan, string testRecordId, Model.SitePerson_Person person)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
@@ -207,7 +390,6 @@ namespace BLL
|
||||
return testRecordId;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 根据ProjectId、PersonId获取试卷列表
|
||||
/// <summary>
|
||||
/// 根据ProjectId、PersonId获取试卷列表
|
||||
@@ -219,29 +401,48 @@ namespace BLL
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
where x.ProjectId == projectId && x.TestManId == personId && x.TestStartTime.HasValue
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestRecordItem
|
||||
{
|
||||
TestRecordId = x.TestRecordId,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanName = y.PlanName,
|
||||
TestManId = x.TestManId,
|
||||
TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
Duration = x.Duration,
|
||||
TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)),
|
||||
TotalScore = y.TotalScore ?? 0,
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
}).ToList();
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
var getDataLists = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && x.TestManId == personId && x.TestStartTime.HasValue
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestRecordItem
|
||||
{
|
||||
TestRecordId = x.TestRecordId,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanName = y.PlanName,
|
||||
TestManId = x.TestManId,
|
||||
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
Duration = x.Duration,
|
||||
TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)),
|
||||
TotalScore = y.TotalScore ?? 0,
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
}).ToList();
|
||||
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(x=>x.UserId==item.TestManId);
|
||||
if (user != null)
|
||||
{
|
||||
item.TestManName = user.UserName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var person = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == item.TestManId);
|
||||
item.TestManName = person.PersonName;
|
||||
}
|
||||
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -258,7 +459,7 @@ namespace BLL
|
||||
var getDataLists = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
join z in db.SitePerson_Person on x.TestManId equals z.PersonId
|
||||
where x.ProjectId == projectId && x.TestStartTime.HasValue && x.TestEndTime.HasValue
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId ==null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && x.TestStartTime.HasValue && x.TestEndTime.HasValue
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestRecordItem
|
||||
{
|
||||
@@ -308,6 +509,73 @@ namespace BLL
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
}
|
||||
public static List<Model.TestRecordItem> getTrainingTestRecordListByDepartId( string unitId, string departId, string strPass, string strParam)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
join z in db.Sys_User on x.TestManId equals z.UserId
|
||||
where x.ProjectId == null && x.TestStartTime.HasValue && x.TestEndTime.HasValue
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestRecordItem
|
||||
{
|
||||
TestRecordId = x.TestRecordId,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanName = y.PlanName,
|
||||
UnitId = z.UnitId,
|
||||
UnitName = getUnitName(z.UnitId),
|
||||
WorkPostId = z.WorkPostId,
|
||||
WorkPostName = db.Base_WorkPost.FirstOrDefault(p => p.WorkPostId == z.WorkPostId).WorkPostName,
|
||||
DepartId = z.DepartId,
|
||||
TestManId = x.TestManId,
|
||||
TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
Duration = x.Duration,
|
||||
TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)),
|
||||
TotalScore = y.TotalScore ?? 0,
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
});
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(departId))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.DepartId == departId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(strParam))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestManName.Contains(strParam));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(strPass))
|
||||
{
|
||||
int PassingScore = SysConstSetService.getPassScore();
|
||||
if (strPass == "0")
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestScores < PassingScore);
|
||||
}
|
||||
else
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestScores >= PassingScore);
|
||||
}
|
||||
}
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var depart = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
|
||||
if (depart != null)
|
||||
{
|
||||
item.DepartName = depart.DepartName;
|
||||
}
|
||||
|
||||
}
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -319,10 +587,18 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string name = string.Empty;
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == testManId);
|
||||
if (getPerson != null)
|
||||
var user = db.Sys_User.FirstOrDefault(x => x.UserId == testManId);
|
||||
if (user != null)
|
||||
{
|
||||
name = UnitService.GetUnitNameByUnitId(getPerson.UnitId);
|
||||
name = UnitService.GetUnitNameByUnitId(user.UnitId);
|
||||
}
|
||||
else
|
||||
{
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == testManId);
|
||||
if (getPerson != null)
|
||||
{
|
||||
name = UnitService.GetUnitNameByUnitId(getPerson.UnitId);
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
@@ -542,7 +818,8 @@ namespace BLL
|
||||
/// <param name="testRecord"></param>
|
||||
public static string getResitTestRecord(Model.Training_TestRecord getTestRecord)
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{ Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = getTestRecord.ProjectId,
|
||||
@@ -554,16 +831,18 @@ namespace BLL
|
||||
// TestStartTime = DateTime.Now,
|
||||
};
|
||||
|
||||
Funs.DB.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
Funs.DB.SubmitChanges();
|
||||
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
db.SubmitChanges();
|
||||
|
||||
var getTestPlan = Funs.DB.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person);
|
||||
var getTestPlan = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var user = db.Sys_User.FirstOrDefault(x => x.UserId == newTestRecord.TestManId);
|
||||
var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person, user);
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.EduTrain_TrainRecord
|
||||
where x.ProjectId == projectId && x.TrainTypeId == trainTypeId
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && x.TrainTypeId == trainTypeId
|
||||
orderby x.TrainStartDate descending
|
||||
select new Model.TrainRecordItem
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TrainTestRecord
|
||||
where x.ProjectId == projectId
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId))
|
||||
orderby x.DateA descending
|
||||
select new Model.HSSE.TrainTestRecordItem
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_Plan
|
||||
where x.ProjectId == projectId && (x.States == states || states == null) && x.TrainTypeId == trainTypeId
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && (x.States == states || states == null) && x.TrainTypeId == trainTypeId
|
||||
orderby x.TrainStartDate descending
|
||||
select new Model.TrainingPlanItem
|
||||
{
|
||||
@@ -76,6 +76,8 @@ namespace BLL
|
||||
TeachMan = x.TeachMan,
|
||||
UnitIds = x.UnitIds,
|
||||
WorkPostId = x.WorkPostId,
|
||||
DepartIds = x.DepartIds,
|
||||
DepartNames = WorkPostService.getDepartNamesByIds(x.DepartIds),
|
||||
TrainContent = x.TrainContent,
|
||||
UnitNames = UnitService.getUnitNamesUnitIds(x.UnitIds),
|
||||
WorkPostNames = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId),
|
||||
@@ -136,7 +138,7 @@ namespace BLL
|
||||
{
|
||||
PlanId = trainingPlan.PlanId,
|
||||
PlanCode = trainingPlan.PlanCode,
|
||||
ProjectId = trainingPlan.ProjectId,
|
||||
|
||||
DesignerId = trainingPlan.DesignerId,
|
||||
PlanName = trainingPlan.PlanName,
|
||||
TrainContent = trainingPlan.TrainContent,
|
||||
@@ -147,9 +149,15 @@ namespace BLL
|
||||
TrainTypeId = trainingPlan.TrainTypeId,
|
||||
UnitIds = trainingPlan.UnitIds,
|
||||
WorkPostId = trainingPlan.WorkPostId,
|
||||
DepartIds = trainingPlan.DepartIds,
|
||||
DepartNames = trainingPlan.DepartNames,
|
||||
States = trainingPlan.States,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(trainingPlan.ProjectId))
|
||||
{
|
||||
newTrainingPlan.ProjectId = trainingPlan.ProjectId;
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(trainingPlan.TrainLevelId))
|
||||
{
|
||||
newTrainingPlan.TrainLevelId = trainingPlan.TrainLevelId;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BLL
|
||||
personId = PersonService.GetPersonIdByUserId(personId);
|
||||
var getDataLists = (from x in db.Training_Task
|
||||
join y in db.Training_Plan on x.PlanId equals y.PlanId
|
||||
where x.ProjectId == projectId && x.UserId == personId && y.States != "0"
|
||||
where ((string.IsNullOrEmpty(projectId) && x.ProjectId == null) || (!string.IsNullOrEmpty(projectId) && x.ProjectId == projectId)) && x.UserId == personId && y.States != "0"
|
||||
orderby x.TaskDate descending
|
||||
select new Model.TrainingTaskItem
|
||||
{
|
||||
@@ -31,13 +31,27 @@ namespace BLL
|
||||
PlanName = y.PlanName,
|
||||
TrainStartDate = string.Format("{0:yyyy-MM-dd HH:mm}", y.TrainStartDate),
|
||||
TeachAddress = y.TeachAddress,
|
||||
//PersonId = x.UserId,
|
||||
PersonName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.UserId).PersonName,
|
||||
PersonId = x.UserId,
|
||||
TaskDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TaskDate),
|
||||
TrainTypeName = db.Base_TrainType.FirstOrDefault(b => b.TrainTypeId == y.TrainTypeId).TrainTypeName,
|
||||
TrainLevelName = db.Base_TrainLevel.FirstOrDefault(b => b.TrainLevelId == y.TrainLevelId).TrainLevelName,
|
||||
PlanStatesName = y.States == "3" ? "已完成" : "培训中",
|
||||
}).ToList();
|
||||
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(x=>x.UserId==item.PersonId);
|
||||
if (user != null)
|
||||
{
|
||||
item.PersonName = user.UserName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var person = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == item.PersonId);
|
||||
item.PersonName = person.PersonName ;
|
||||
}
|
||||
|
||||
}
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
@@ -102,9 +116,11 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
var user = db.Sys_User.FirstOrDefault(e => e.UserId == personId);
|
||||
var person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId);
|
||||
if (person != null && plan.ProjectId == person.ProjectId && plan.UnitIds.Contains(person.UnitId)
|
||||
&& (string.IsNullOrEmpty(plan.WorkPostId) || plan.WorkPostId.Contains(person.WorkPostId)))
|
||||
if ((person != null && plan.ProjectId == person.ProjectId && plan.UnitIds.Contains(person.UnitId)
|
||||
&& (string.IsNullOrEmpty(plan.WorkPostId) || plan.WorkPostId.Contains(person.WorkPostId)))|| (user != null && plan.UnitIds.Contains(person.UnitId)
|
||||
&& (string.IsNullOrEmpty(plan.DepartIds) || plan.DepartIds.Contains(person.DepartId))))
|
||||
{
|
||||
var trainType = db.Base_TrainType.FirstOrDefault(e => e.TrainTypeId == plan.TrainTypeId);
|
||||
if (trainType != null)
|
||||
@@ -205,10 +221,29 @@ namespace BLL
|
||||
TaskId = x.TaskId,
|
||||
PlanId = x.PlanId,
|
||||
PersonId = x.UserId,
|
||||
PersonName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.UserId).PersonName,
|
||||
|
||||
TaskDate = string.Format("{0:yyyy-MM-dd HH:mm}", x.TaskDate),
|
||||
States = x.States,
|
||||
}).ToList();
|
||||
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var person = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == item.PersonId);
|
||||
if (person != null)
|
||||
{
|
||||
item.PersonName = person.PersonName;
|
||||
}
|
||||
else
|
||||
{
|
||||
var sysUser = db.Sys_User.FirstOrDefault(p => p.UserId == item.PersonId);
|
||||
if (sysUser != null)
|
||||
{
|
||||
item.PersonName = sysUser.UserName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return getDataLists;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-1
@@ -95,10 +95,12 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="ThoughtWorks.QRCode">
|
||||
<HintPath>..\..\..\SGGL\SGGL\FineUIPro.Web\bin\ThoughtWorks.QRCode.dll</HintPath>
|
||||
<HintPath>..\..\..\..\五环施工平台\SGGL_CWCEC\SGGL\BLL\bin\Debug\ThoughtWorks.QRCode.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ADomain\ADDataInService.cs" />
|
||||
<Compile Include="ADomain\ADomainService.cs" />
|
||||
<Compile Include="API\APIBaseInfoService.cs" />
|
||||
<Compile Include="API\APICommonService.cs" />
|
||||
<Compile Include="API\APIGetHttpService.cs" />
|
||||
@@ -188,6 +190,7 @@
|
||||
<Compile Include="Common\CommonService.cs" />
|
||||
<Compile Include="Common\CreateQRCodeService.cs" />
|
||||
<Compile Include="Common\FastReport.cs" />
|
||||
<Compile Include="Common\FileManager\FileManagerService.cs" />
|
||||
<Compile Include="Common\IDCardValid.cs" />
|
||||
<Compile Include="Common\NPOIExcel.cs" />
|
||||
<Compile Include="Common\NPOIHelper.cs" />
|
||||
@@ -201,6 +204,7 @@
|
||||
<Compile Include="CostGoods\MeasuresPlanService.cs" />
|
||||
<Compile Include="CostGoods\PayRegistrationService.cs" />
|
||||
<Compile Include="CostGoods\SubPayRegistrationService.cs" />
|
||||
<Compile Include="CQMS\Check\CheckFineApproveService.cs" />
|
||||
<Compile Include="CQMS\Check\CheckFineService.cs" />
|
||||
<Compile Include="CQMS\Check\RewardAndPunishService.cs" />
|
||||
<Compile Include="CQMS\Comprehensive\DesignDrawingsApproveService.cs" />
|
||||
@@ -417,6 +421,7 @@
|
||||
<Compile Include="HSSE\EduTrain\EduTrain_TrainRecordDetailService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\EduTrain_TrainRecordService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\EduTrain_TrainTestService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\TaskNoticeService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\TestPlanService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\TestRecordItemService.cs" />
|
||||
<Compile Include="HSSE\EduTrain\TrainTestRecordService.cs" />
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="dropName">下拉框名字</param>
|
||||
/// <param name="isShowPlease">是否显示请选择</param>
|
||||
public static void InitSpecialSchemeTypeDropDownList(FineUIPro.DropDownList dropName,int type,bool isShowPlease)
|
||||
public static void InitSpecialSchemeTypeDropDownList(FineUIPro.DropDownList dropName, int type, bool isShowPlease)
|
||||
{
|
||||
dropName.Items.Clear();
|
||||
dropName.DataValueField = "SpecialSchemeTypeId";
|
||||
|
||||
@@ -20,6 +20,11 @@ namespace BLL
|
||||
return Funs.DB.Base_WorkPost.FirstOrDefault(e => e.WorkPostId == workPostId);
|
||||
}
|
||||
|
||||
public static Model.Base_WorkPost GetWorkPostByName(string name)
|
||||
{
|
||||
return Funs.DB.Base_WorkPost.FirstOrDefault(e => e.WorkPostName == name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
@@ -255,5 +260,59 @@ namespace BLL
|
||||
return workPostName;
|
||||
}
|
||||
#endregion
|
||||
#region 根据岗位ID得到岗位名称
|
||||
/// <summary>
|
||||
/// 根据岗位ID得到岗位名称
|
||||
/// </summary>
|
||||
/// <param name="workPostId"></param>
|
||||
/// <returns></returns>
|
||||
public static string getDepartNameById(string workPostId)
|
||||
{
|
||||
string workPostName = string.Empty;
|
||||
if (!string.IsNullOrEmpty(workPostId))
|
||||
{
|
||||
var q = GetWorkPostById(workPostId);
|
||||
if (q != null)
|
||||
{
|
||||
workPostName = q.WorkPostName;
|
||||
}
|
||||
}
|
||||
|
||||
return workPostName;
|
||||
}
|
||||
#endregion
|
||||
public static Model.Base_Depart GetDepartById(string departId)
|
||||
{
|
||||
return Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartId == departId);
|
||||
}
|
||||
#region 根据多岗位ID得到岗位名称字符串
|
||||
/// <summary>
|
||||
/// 根据多岗位ID得到岗位名称字符串
|
||||
/// </summary>
|
||||
/// <param name="bigType"></param>
|
||||
/// <returns></returns>
|
||||
public static string getDepartNamesByIds(object departIdsIds)
|
||||
{
|
||||
string departName = string.Empty;
|
||||
if (departIdsIds != null)
|
||||
{
|
||||
string[] ids = departIdsIds.ToString().Split(',');
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var q = GetDepartById(id);
|
||||
if (q != null)
|
||||
{
|
||||
departName += q.DepartName + ",";
|
||||
}
|
||||
}
|
||||
if (departName != string.Empty)
|
||||
{
|
||||
departName = departName.Substring(0, departName.Length - 1); ;
|
||||
}
|
||||
}
|
||||
|
||||
return departName;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class CheckFineApproveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
/// <summary>
|
||||
/// 获取质量巡检模板列表
|
||||
/// </summary>
|
||||
/// <param name="satartRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static DataTable getListData(string CheckFineId)
|
||||
{
|
||||
var res = from x in db.Check_CheckFineApprove
|
||||
where x.CheckFineId == CheckFineId && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.CheckFineApproveId,
|
||||
x.CheckFineId,
|
||||
ApproveMan = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
return Funs.LINQToDataTable(res);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据质量巡检编号删除对应的所有质量巡检审批信息
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId">质量巡检编号</param>
|
||||
public static void DeleteCheckFineApprovesByCheckFineId(string CheckFineId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Check_CheckFineApprove where x.CheckFineId == CheckFineId select x).ToList();
|
||||
db.Check_CheckFineApprove.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取登录人的通知信息
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static IQueryable getList(string userId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var res = from x in db.Check_CheckFineApprove
|
||||
join ca in db.Check_CheckFine on x.CheckFineId equals ca.CheckFineId
|
||||
where x.ApproveDate == null && x.ApproveType == "S" && x.ApproveMan == userId
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
//x.CheckFineApproveId,
|
||||
x.CheckFineId,
|
||||
//x.ApproveDate,
|
||||
//x.IsAgree,
|
||||
//x.ApproveIdea,
|
||||
//x.ApproveType,
|
||||
ca.DocCode
|
||||
};
|
||||
return res.AsQueryable().Distinct();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新通知信息提醒
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Check_CheckFineApprove GetSee(string CheckFineId, string userId)
|
||||
{
|
||||
return db.Check_CheckFineApprove.FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
}
|
||||
public static void See(string CheckFineId, string userId)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var res = db.Check_CheckFineApprove.FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null);
|
||||
if (res != null)
|
||||
{
|
||||
res.ApproveDate = DateTime.Now;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据质量巡检编号获取一个质量巡检审批信息
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId">质量巡检编号</param>
|
||||
/// <returns>一个质量巡检审批实体</returns>
|
||||
public static Model.Check_CheckFineApprove GetCheckFineApproveByCheckFineId(string CheckFineId)
|
||||
{
|
||||
return db.Check_CheckFineApprove.FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType != "S" && x.ApproveDate == null);
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改质量巡检审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">质量巡检审批实体</param>
|
||||
public static void UpdateCheckFineApprove(Model.Check_CheckFineApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Check_CheckFineApprove newApprove = db.Check_CheckFineApprove.First(e => e.CheckFineApproveId == approve.CheckFineApproveId && e.ApproveDate == null);
|
||||
newApprove.CheckFineId = approve.CheckFineId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加质量巡检审批信息
|
||||
/// </summary>
|
||||
/// <param name="managerRuleApprove">质量巡检审批实体</param>
|
||||
public static void AddCheckFineApprove(Model.Check_CheckFineApprove approve)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_CheckFineApprove));
|
||||
Model.Check_CheckFineApprove newApprove = new Model.Check_CheckFineApprove();
|
||||
newApprove.CheckFineApproveId = newKeyID;
|
||||
newApprove.CheckFineId = approve.CheckFineId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
db.Check_CheckFineApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
|
||||
}
|
||||
public static string AddCheckFineApproveForApi(Model.Check_CheckFineApprove approve)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Check_CheckFineApprove));
|
||||
Model.Check_CheckFineApprove newApprove = new Model.Check_CheckFineApprove();
|
||||
newApprove.CheckFineApproveId = newKeyID;
|
||||
newApprove.CheckFineId = approve.CheckFineId;
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.Check_CheckFineApprove.InsertOnSubmit(newApprove);
|
||||
db.SubmitChanges();
|
||||
return newKeyID;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 现场质量经理审核信息
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Check_CheckFineApprove GetAudit1(string CheckFineId)
|
||||
{
|
||||
return db.Check_CheckFineApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType == BLL.Const.CheckFine_Audit1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 现场经理/施工经理审批信息
|
||||
/// </summary>
|
||||
/// <param name="CheckFineId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Check_CheckFineApprove GetAudit2(string CheckFineId)
|
||||
{
|
||||
return db.Check_CheckFineApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType == BLL.Const.CheckFine_Audit2);
|
||||
}
|
||||
|
||||
public static Model.Check_CheckFineApprove GetComplie(string CheckFineId)
|
||||
{
|
||||
return db.Check_CheckFineApprove.FirstOrDefault(x => x.CheckFineId == CheckFineId && x.ApproveType == BLL.Const.CheckFine_Compile);
|
||||
}
|
||||
public static List<Model.Check_CheckFineApprove> GetListDataByCodeForApi(string code)
|
||||
{
|
||||
using (var db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var q = from x in db.Check_CheckFineApprove
|
||||
where x.CheckFineId == code && x.ApproveDate != null && x.ApproveType != "S"
|
||||
orderby x.ApproveDate
|
||||
select new
|
||||
{
|
||||
x.CheckFineApproveId,
|
||||
x.CheckFineId,
|
||||
x.ApproveMan,
|
||||
ApproveManName = (from y in db.Sys_User where y.UserId == x.ApproveMan select y.UserName).First(),
|
||||
x.ApproveDate,
|
||||
x.IsAgree,
|
||||
x.ApproveIdea,
|
||||
x.ApproveType,
|
||||
};
|
||||
List<Model.Check_CheckFineApprove> res = new List<Model.Check_CheckFineApprove>();
|
||||
var list = q.ToList();
|
||||
foreach (var item in list)
|
||||
{
|
||||
Model.Check_CheckFineApprove approve = new Model.Check_CheckFineApprove();
|
||||
approve.CheckFineApproveId = item.CheckFineApproveId;
|
||||
approve.CheckFineId = item.CheckFineId;
|
||||
approve.ApproveMan = item.ApproveMan + "$" + item.ApproveManName;
|
||||
approve.ApproveDate = item.ApproveDate;
|
||||
approve.IsAgree = item.IsAgree;
|
||||
approve.ApproveIdea = item.ApproveIdea;
|
||||
approve.ApproveType = item.ApproveType;
|
||||
res.Add(approve);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
public static Model.Check_CheckFineApprove getCurrApproveForApi(string checkFineCode)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Check_CheckFineApprove newApprove = db.Check_CheckFineApprove.FirstOrDefault(e => e.CheckFineId == checkFineCode && e.ApproveType != "S" && e.ApproveDate == null);
|
||||
if (newApprove != null)
|
||||
{
|
||||
Model.Sys_User user = BLL.UserService.GetUserByUserId(newApprove.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
newApprove.ApproveIdea = user.UserName;
|
||||
}
|
||||
}
|
||||
return newApprove;
|
||||
}
|
||||
}
|
||||
public static void UpdateCheckFineApproveForApi(Model.Check_CheckFineApprove approve)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Check_CheckFineApprove newApprove = db.Check_CheckFineApprove.FirstOrDefault(e => e.CheckFineApproveId == approve.CheckFineApproveId && e.ApproveDate == null);
|
||||
if (newApprove != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(approve.CheckFineId))
|
||||
{
|
||||
newApprove.CheckFineId = approve.CheckFineId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
newApprove.ApproveMan = approve.ApproveMan;
|
||||
if (approve.ApproveDate.HasValue)
|
||||
newApprove.ApproveDate = approve.ApproveDate;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveIdea))
|
||||
newApprove.ApproveIdea = approve.ApproveIdea;
|
||||
if (approve.IsAgree.HasValue)
|
||||
newApprove.IsAgree = approve.IsAgree;
|
||||
if (!string.IsNullOrEmpty(approve.ApproveType))
|
||||
newApprove.ApproveType = approve.ApproveType;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,47 @@ namespace BLL
|
||||
|
||||
}
|
||||
|
||||
public static void Init(FineUIPro.DropDownList dropName, string state, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = GetDHandleTypeByState(state);
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据状态选择下一步办理类型
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetDHandleTypeByState(string state)
|
||||
{
|
||||
if (state == Const.CheckFine_Compile || state == Const.CheckFine_ReCompile) //无是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[1];
|
||||
lis[0] = new ListItem("现场质量经理审核", Const.CheckFine_Audit1);
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.CheckFine_Audit1)//有是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("现场经理/施工经理审批", Const.CheckFine_Audit2);//是 加载
|
||||
lis[1] = new ListItem("重新编制", Const.CheckFine_ReCompile);//否加载
|
||||
return lis;
|
||||
}
|
||||
else if (state == Const.CheckFine_Audit2)//无是否同意
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("审批完成", Const.CheckFine_Complete);
|
||||
lis[1] = new ListItem("重新编制", Const.CheckFine_ReCompile);
|
||||
return lis;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace BLL
|
||||
ListItem[] list = new ListItem[2];
|
||||
|
||||
list[0] = new ListItem("奖励通知单", "0");
|
||||
list[1] = new ListItem("奖励通知单", "1");
|
||||
list[1] = new ListItem("处罚通知单", "1");
|
||||
dropName.DataValueField = "Value";
|
||||
dropName.DataTextField = "Text";
|
||||
dropName.DataSource = list;
|
||||
|
||||
@@ -60,6 +60,15 @@ namespace BLL.CQMS.Comprehensive
|
||||
|
||||
}
|
||||
|
||||
public static Model.Comprehensive_InspectionPersonApprove GetApprove2(string InspectionPersonId)
|
||||
{
|
||||
var q = from x in Funs.DB.Comprehensive_InspectionPersonApprove
|
||||
where x.InspectionPersonId == InspectionPersonId && x.ApproveType != "S" && x.ApproveDate == null && x.ApproveType=="2"
|
||||
select x;
|
||||
return q.FirstOrDefault();
|
||||
|
||||
}
|
||||
|
||||
public static Model.Comprehensive_InspectionPersonApprove GetState(string InspectionPersonId)
|
||||
{
|
||||
var q = from x in Funs.DB.Comprehensive_InspectionPersonApprove
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace BLL
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.IsHSSE = constructSolution.IsHSSE;
|
||||
newConstructSolution.CompileMan = constructSolution.CompileMan;
|
||||
newConstructSolution.CompileDate = constructSolution.CompileDate;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
@@ -67,6 +68,27 @@ namespace BLL
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
db.Solution_CQMSConstructSolution.InsertOnSubmit(newConstructSolution);
|
||||
db.SubmitChanges();
|
||||
if (newConstructSolution.IsHSSE == true)
|
||||
{
|
||||
Model.Solution_HSSEConstructSolution newHSSEConstructSolution = new Model.Solution_HSSEConstructSolution();
|
||||
newHSSEConstructSolution.ConstructSolutionId = SQLHelper.GetNewID();
|
||||
newHSSEConstructSolution.Code = constructSolution.Code;
|
||||
newHSSEConstructSolution.ProjectId = constructSolution.ProjectId;
|
||||
newHSSEConstructSolution.UnitId = constructSolution.UnitId;
|
||||
newHSSEConstructSolution.SolutionName = constructSolution.SolutionName;
|
||||
newHSSEConstructSolution.SolutionType = constructSolution.SolutionType;
|
||||
newHSSEConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newHSSEConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newHSSEConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newHSSEConstructSolution.CompileMan = constructSolution.CompileMan;
|
||||
newHSSEConstructSolution.CompileDate = constructSolution.CompileDate;
|
||||
newHSSEConstructSolution.State = constructSolution.State;
|
||||
newHSSEConstructSolution.Edition = constructSolution.Edition;
|
||||
newHSSEConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
newHSSEConstructSolution.CQMSConstructSolutionId= constructSolution.ConstructSolutionId;
|
||||
db.Solution_HSSEConstructSolution.InsertOnSubmit(newHSSEConstructSolution);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改方案审查信息
|
||||
@@ -91,6 +113,7 @@ namespace BLL
|
||||
newConstructSolution.UnitWorkIds = constructSolution.UnitWorkIds;
|
||||
newConstructSolution.CNProfessionalCodes = constructSolution.CNProfessionalCodes;
|
||||
newConstructSolution.AttachUrl = constructSolution.AttachUrl;
|
||||
newConstructSolution.IsHSSE = constructSolution.IsHSSE;
|
||||
newConstructSolution.State = constructSolution.State;
|
||||
newConstructSolution.Edition = constructSolution.Edition;
|
||||
newConstructSolution.SpecialSchemeTypeId = constructSolution.SpecialSchemeTypeId;
|
||||
|
||||
@@ -152,6 +152,16 @@ namespace BLL
|
||||
return Funs.DB.WBS_DivisionProject.FirstOrDefault(x => x.DivisionProjectId == divisionProjectId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键返回一个分部/子分部信息
|
||||
/// </summary>
|
||||
/// <param name="cnProfessionalCode">分部/子分部编号</param>
|
||||
/// <returns></returns>
|
||||
public static Model.WBS_DivisionProject GetDivisionProjectByUnitWorkIdAndOldDivisionId(string unitWorkId, string oldDivisionId)
|
||||
{
|
||||
return Funs.DB.WBS_DivisionProject.FirstOrDefault(x => x.UnitWorkId == unitWorkId && x.OldDivisionId == oldDivisionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断分部/子分部编号是否存在
|
||||
/// </summary>
|
||||
|
||||
@@ -150,12 +150,12 @@ namespace BLL
|
||||
/// <param name="menuId"></param>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
public static void InsertCodeRecordsByMenuIdProjectIdUnitId(string menuId, string projectId, string unitId, string dataId, DateTime? compileDate)
|
||||
public static string InsertCodeRecordsByMenuIdProjectIdUnitId(string menuId, string projectId, string unitId, string dataId, DateTime? compileDate)
|
||||
{
|
||||
string ruleCode = string.Empty;
|
||||
var IsHaveCodeRecords = Funs.DB.Sys_CodeRecords.FirstOrDefault(x => x.DataId == dataId);
|
||||
if (IsHaveCodeRecords == null) ///是否已存在编码
|
||||
{
|
||||
string ruleCode = string.Empty;
|
||||
string ruleCodeower = string.Empty;
|
||||
int digit = 4; ///流水位数
|
||||
string symbolower = "-"; ///业主间隔符
|
||||
@@ -269,6 +269,12 @@ namespace BLL
|
||||
Funs.DB.Sys_CodeRecords.InsertOnSubmit(newCodeRecords);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
ruleCode = IsHaveCodeRecords.Code;
|
||||
}
|
||||
|
||||
return ruleCode;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -100,13 +100,11 @@ namespace BLL
|
||||
{
|
||||
if (userId == Const.sysglyId || userId == Const.hfnbdId) ////|| getUser.DepartId == Const.Depart_constructionId
|
||||
{
|
||||
return new List<string>() { Const.Menu_Server, Const.Menu_HSSE, Const.Menu_CQMS, Const.Menu_HJGL,Const.Menu_PHTGL, Const.Menu_JDGL
|
||||
,Const.Menu_DigitalSite,Const.Menu_PPerson,Const.Menu_PZHGL};
|
||||
var getMenuType = from x in db.Sys_Const
|
||||
where x.GroupId == ConstValue.Group_MenuType_S || x.GroupId == ConstValue.Group_MenuType_P
|
||||
select x.ConstValue;
|
||||
return getMenuType.ToList();
|
||||
}
|
||||
//else if (userId == Const.sedinId)
|
||||
//{
|
||||
// return new List<string>() { Const.Menu_CQMS };
|
||||
//}
|
||||
else
|
||||
{
|
||||
List<string> returnList = new List<string>();
|
||||
@@ -222,7 +220,7 @@ namespace BLL
|
||||
{
|
||||
returnValue = true;
|
||||
}
|
||||
else if (menu.MenuType == Const.Menu_Personal)
|
||||
else if (menu.MenuType == Const.Menu_Personal || menu.MenuType == Const.Menu_ToDo)
|
||||
{
|
||||
returnValue = true;
|
||||
}
|
||||
|
||||
+181
-31
@@ -17,6 +17,7 @@ namespace BLL
|
||||
/// 焊条发放回收纪录
|
||||
/// </summary>
|
||||
public const string HJGL_ElectrodeRecoveryReportId = "13";
|
||||
|
||||
#region 焊接材料
|
||||
/// <summary>
|
||||
/// 焊丝烘烤记录
|
||||
@@ -78,9 +79,21 @@ namespace BLL
|
||||
public const string TrustReport4Id = "106";
|
||||
|
||||
/// <summary>
|
||||
/// 无损检测结果通知单
|
||||
/// 无损检测结果通知单(管线)
|
||||
/// </summary>
|
||||
public const string CheckReportId = "107";
|
||||
public const string CheckReport1Id = "107";
|
||||
/// <summary>
|
||||
/// 无损检测结果通知单(设备)
|
||||
/// </summary>
|
||||
public const string CheckReport2Id = "109";
|
||||
/// <summary>
|
||||
/// 管道无损检测结果汇总表
|
||||
/// </summary>
|
||||
public const string CheckReport3Id = "110";
|
||||
/// <summary>
|
||||
/// 管道无损检测数量统计表
|
||||
/// </summary>
|
||||
public const string CheckReport4Id = "111";
|
||||
|
||||
/// <summary>
|
||||
/// 管道对接焊接接头报检/检查记录
|
||||
@@ -196,10 +209,10 @@ namespace BLL
|
||||
/// 管道等级
|
||||
/// </summary>
|
||||
public const string HJGL_PipingClassMenuId = "DD70CA50-C41B-4555-8ACC-10B2336733D5";
|
||||
///// <summary>
|
||||
///// 管道等级
|
||||
///// </summary>
|
||||
//public const string HJGL_PipingClassMenuId = "DD70CA50-C41B-4555-8ACC-10B2336733D5";
|
||||
/// <summary>
|
||||
/// 管道等级
|
||||
/// </summary>
|
||||
public const string PHJGL_PipingClassMenuId = "4C41FC4C-659E-495E-8BD3-0702F35F534E";
|
||||
|
||||
/// <summary>
|
||||
/// 焊接方法
|
||||
@@ -379,7 +392,7 @@ namespace BLL
|
||||
public const string HJGL_PointManageMenuId = "3ACE25CE-C5CE-4CEC-AD27-0D5CF1DF2F01";
|
||||
#endregion
|
||||
|
||||
#region 工程签证确认单流程定义
|
||||
#region 工程签证确认单流程定义
|
||||
|
||||
///// <summary>
|
||||
///// 重报
|
||||
@@ -697,8 +710,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 微信订阅模板ID
|
||||
/// </summary>
|
||||
//public const string WX_TemplateID = "rG2tJ2ByE9I4SziW-zKglA56Ux1q0sZF0WCFLfK70Cs";
|
||||
public const string WX_TemplateID = "rG2tJ2ByE9I4SziW-zKglF9s6bk6eyV0WVrT5tqFq8I";
|
||||
public const string WX_TemplateID = "ZL5BwMWr5wHOWFItiIQ_4wTzFn9u3fqllueow21Ny_o";
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -830,11 +842,11 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 成达
|
||||
/// </summary>
|
||||
public const string AppID_CD = "";
|
||||
public const string AppID_CD = "wx7642299cac4edbc4";
|
||||
/// <summary>
|
||||
/// 成达
|
||||
/// </summary>
|
||||
public const string AppSecret_CD = "";
|
||||
public const string AppSecret_CD = "b34be452f71e15f97c58ff5def2b5fe1";
|
||||
/// <summary>
|
||||
///施工部门id
|
||||
/// </summary>
|
||||
@@ -1088,7 +1100,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 专业工程师(总包)
|
||||
/// </summary>
|
||||
public const string ZBCNEngineer = "b2be5e3b-b46c-4569-b84b-6c2d95714a03";
|
||||
public const string ZBCNEngineer = "d2d397ae-1370-47e9-a377-95bce1fa745a";
|
||||
/// <summary>
|
||||
/// 费控工程师
|
||||
/// </summary>
|
||||
@@ -1233,45 +1245,52 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string Menu_ProjectSet = "Menu_ProjectSet";
|
||||
/// <summary>
|
||||
/// 施工管理
|
||||
/// </summary>
|
||||
public const string Menu_PZHGL = "Menu_PZHGL";
|
||||
/// <summary>
|
||||
/// 质量
|
||||
/// </summary>
|
||||
public const string Menu_CQMS = "Menu_CQMS";
|
||||
/// <summary>
|
||||
/// 安全
|
||||
/// </summary>
|
||||
public const string Menu_HSSE = "Menu_HSSE";
|
||||
/// <summary>
|
||||
/// 进度
|
||||
/// 进度/计划
|
||||
/// </summary>
|
||||
public const string Menu_JDGL = "Menu_JDGL";
|
||||
/// <summary>
|
||||
/// 安全(HSE)管理
|
||||
/// </summary>
|
||||
public const string Menu_HSSE = "Menu_HSSE";
|
||||
/// <summary>
|
||||
/// 焊接管理
|
||||
/// </summary>
|
||||
public const string Menu_HJGL = "Menu_HJGL";
|
||||
/// <summary>
|
||||
/// 项目合同
|
||||
/// </summary>
|
||||
public const string Menu_PHTGL = "Menu_PHTGL";
|
||||
/// <summary>
|
||||
/// 试车管理
|
||||
/// </summary>
|
||||
public const string Menu_TestRun = "Menu_TestRun";
|
||||
|
||||
/// <summary>
|
||||
/// 施工综合
|
||||
/// 变更管理
|
||||
/// </summary>
|
||||
public const string Menu_PZHGL = "Menu_PZHGL";
|
||||
public const string Menu_Change = "Menu_Change";
|
||||
/// <summary>
|
||||
/// 数字工地
|
||||
/// 文控管理
|
||||
/// </summary>
|
||||
public const string Menu_DigitalSite = "Menu_DigitalSite";
|
||||
public const string Menu_DocControl = "Menu_DocControl";
|
||||
/// <summary>
|
||||
/// 项目人员
|
||||
/// 现场考勤
|
||||
/// </summary>
|
||||
public const string Menu_PPerson = "Menu_PPerson";
|
||||
public const string Menu_Attendance = "Menu_Attendance";
|
||||
/// <summary>
|
||||
/// 项目大数据
|
||||
/// 视频监控
|
||||
/// </summary>
|
||||
public const string Menu_PDigData = "Menu_PDigData";
|
||||
public const string Menu_Video = "Menu_Video";
|
||||
|
||||
/// <summary>
|
||||
/// 待办
|
||||
/// </summary>
|
||||
public const string Menu_ToDo = "Menu_ToDo";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 考勤方式定义
|
||||
@@ -1390,6 +1409,11 @@ namespace BLL
|
||||
/// 问题类型
|
||||
/// </summary>
|
||||
public const string QuestionTypeMenuId = "3044D68E-5018-4B57-BFC4-FBE4BCCA8B8B";
|
||||
|
||||
/// <summary>
|
||||
/// AD域设置
|
||||
/// </summary>
|
||||
public const string ADomainMenuId = "2C4A7BDA-D682-4A77-ACE5-AAC0574DA6AD";
|
||||
#endregion
|
||||
|
||||
#region 基础信息
|
||||
@@ -3710,6 +3734,21 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string DivisionId15 = "BD0C9DC9-C621-497E-B947-A85F46D86AA4";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理体系
|
||||
/// </summary>
|
||||
public const string ZlgltxMenuId = "063601B5-EF75-418B-90E8-4255C0DB06D7";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理规定/程序文件
|
||||
/// </summary>
|
||||
public const string ZlglgdMenuId = "098307DA-C53D-4EDB-8587-339CD782031F";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理实施计划
|
||||
/// </summary>
|
||||
public const string ZlssjhMenuId = "AC145EE1-4E5C-4CEF-A85A-AAC331A041DB";
|
||||
|
||||
#region 质量管理
|
||||
#region 基础设置
|
||||
/// <summary>
|
||||
@@ -4283,6 +4322,33 @@ namespace BLL
|
||||
|
||||
#endregion
|
||||
|
||||
#region 质量罚款单流程定义
|
||||
/// <summary>
|
||||
/// 重新编制
|
||||
/// </summary>
|
||||
public const string CheckFine_ReCompile = "0";//总包
|
||||
|
||||
/// <summary>
|
||||
/// 编制
|
||||
/// </summary>
|
||||
public const string CheckFine_Compile = "1";//总包
|
||||
|
||||
/// <summary>
|
||||
/// 现场质量经理审核
|
||||
/// </summary>
|
||||
public static string CheckFine_Audit1 = "2";//总包
|
||||
|
||||
/// <summary>
|
||||
/// 现场经理/施工经理审批
|
||||
/// </summary>
|
||||
public static string CheckFine_Audit2 = "3";//分包
|
||||
|
||||
/// <summary>
|
||||
/// 审批完成
|
||||
/// </summary>
|
||||
public static string CheckFine_Complete = "4";
|
||||
#endregion
|
||||
|
||||
#region 质量巡检流程定义
|
||||
/// <summary>
|
||||
/// 重新编制
|
||||
@@ -4972,7 +5038,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 质量罚款单的虚拟路径
|
||||
/// </summary>
|
||||
public const string CheckFineTemplateUrl = "File\\Word\\CQMS\\Check\\质量罚款单.doc";
|
||||
public const string CheckFineTemplateUrl = "File\\Word\\CQMS\\Check\\现场质量违规罚款通知单.doc";
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
@@ -4998,6 +5064,42 @@ namespace BLL
|
||||
/// 项目级施工日志
|
||||
/// </summary>
|
||||
public const string WorkHandoverMenuId = "CD88CE2A-A8E2-4F07-9A90-9161BD1C345C";
|
||||
|
||||
/// <summary>
|
||||
/// 公司/部门施工管理规定
|
||||
/// </summary>
|
||||
public const string GsBmGlgdMenuId = "67CEE910-DDFB-4E69-B4B7-DA29B9F43E1D";
|
||||
|
||||
/// <summary>
|
||||
/// 临设策划
|
||||
/// </summary>
|
||||
public const string LschMenuId = "6979A259-25A1-4A60-93A2-32FEA577CE70";
|
||||
|
||||
/// <summary>
|
||||
/// 大件吊装策划
|
||||
/// </summary>
|
||||
public const string DjdzchMenuId = "8DE7DD60-712B-4545-9784-D3D96BFD2419";
|
||||
|
||||
/// <summary>
|
||||
/// 项目施工管理规定
|
||||
/// </summary>
|
||||
public const string XmsgGlgdMenuId = "90217D8E-D2AC-4B8D-A1A7-A27317890408";
|
||||
|
||||
/// <summary>
|
||||
/// 分包策划
|
||||
/// </summary>
|
||||
public const string FbchMenuId = "971D3B85-9ECE-4325-BB84-AE9CF7577476";
|
||||
|
||||
/// <summary>
|
||||
/// 人力动员策划
|
||||
/// </summary>
|
||||
public const string RldychMenuId = "DC14E545-F8B5-40C1-A604-73A8DA8741CC";
|
||||
|
||||
/// <summary>
|
||||
/// 施工重点难点分析及处理
|
||||
/// </summary>
|
||||
public const string SgzdNdMenuId = "5B794B48-2FB6-4AC5-8628-0B7364A2B6CE";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 施工综合流程定义
|
||||
@@ -5534,6 +5636,51 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string RectificationMeasureMenuId = "0629BAB1-DB1C-42CE-A333-49F3813617D7";
|
||||
|
||||
/// <summary>
|
||||
/// 项目进度管理规定
|
||||
/// </summary>
|
||||
public const string XmjdGlgdMenuId = "1B0A2B51-F2A9-4587-AF6A-461A26A9004F";
|
||||
|
||||
/// <summary>
|
||||
/// 公司/部门进度管理规定
|
||||
/// </summary>
|
||||
public const string GsbmJdGlgdMenuId = "C558CF83-5F61-47B2-9207-0690C01867B6";
|
||||
|
||||
/// <summary>
|
||||
/// 施工总进度计划
|
||||
/// </summary>
|
||||
public const string SgzjdjhMenuId = "6D216501-84E3-46EC-815E-F9C21A2955CF";
|
||||
|
||||
/// <summary>
|
||||
/// 编制施工总进度计划资料准备
|
||||
/// </summary>
|
||||
public const string ZlzbMenuId = "7BE0E727-5358-4E2E-8C0A-8E04E99672E2";
|
||||
|
||||
/// <summary>
|
||||
/// EPC计划
|
||||
/// </summary>
|
||||
public const string EPCJhMenuId = "9091DE55-F124-4684-AAF1-88AC0AC7CA19";
|
||||
|
||||
/// <summary>
|
||||
/// 施工月进度计划
|
||||
/// </summary>
|
||||
public const string YjdjhMenuId = "2161ED3A-4F46-4B38-BE96-5EE7FE7D6661";
|
||||
|
||||
/// <summary>
|
||||
/// 施工周进度计划
|
||||
/// </summary>
|
||||
public const string ZjdjhMenuId = "20ADF080-50FD-433D-9A13-450CAD4A81C9";
|
||||
|
||||
/// <summary>
|
||||
/// 施工月报
|
||||
/// </summary>
|
||||
public const string SgybMenuId = "A3AE8F7C-E8F8-4239-8F5E-41DF2EA6A33A";
|
||||
|
||||
/// <summary>
|
||||
/// 施工周/日报
|
||||
/// </summary>
|
||||
public const string SgzrbMenuId = "D3B48891-F15E-40DA-B90F-A6130F26324F";
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -5584,7 +5731,10 @@ namespace BLL
|
||||
public const string IsoCompreInfoMenuId = "CF3CB43C-4031-4CFD-905F-154DC1CB881E";
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 考试记录
|
||||
/// </summary>
|
||||
public const string HSSETestRecordMenuId = "0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A";
|
||||
|
||||
#region 焊材申请流程定义
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public class FileManagerService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
/// </summary>
|
||||
/// <param name="fileId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Common_FileManager GetFileById(string fileId)
|
||||
{
|
||||
return Funs.DB.Common_FileManager.FirstOrDefault(e => e.FileId == fileId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加文件信息
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
public static void AddFile(Model.Common_FileManager file)
|
||||
{
|
||||
Model.Common_FileManager newFile = new Model.Common_FileManager();
|
||||
newFile.FileId = file.FileId;
|
||||
newFile.FileName = file.FileName;
|
||||
newFile.UploadMan = file.UploadMan;
|
||||
newFile.UploadDate = file.UploadDate;
|
||||
newFile.Remark = file.Remark;
|
||||
newFile.AttachUrl = file.AttachUrl;
|
||||
newFile.ToMenu = file.ToMenu;
|
||||
Funs.DB.Common_FileManager.InsertOnSubmit(newFile);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改文件信息
|
||||
/// </summary>
|
||||
/// <param name="template"></param>
|
||||
public static void UpdateFile(Model.Common_FileManager file)
|
||||
{
|
||||
Model.Common_FileManager newFile = Funs.DB.Common_FileManager.FirstOrDefault(e => e.FileId == file.FileId);
|
||||
if (newFile != null)
|
||||
{
|
||||
newFile.FileName = file.FileName;
|
||||
newFile.UploadMan = file.UploadMan;
|
||||
newFile.UploadDate = file.UploadDate;
|
||||
newFile.ToMenu = file.ToMenu;
|
||||
newFile.Remark = file.Remark;
|
||||
newFile.AttachUrl = file.AttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除文件信息
|
||||
/// </summary>
|
||||
/// <param name="template"></param>
|
||||
public static void DeleteFileById(string fileId)
|
||||
{
|
||||
Model.Common_FileManager del = Funs.DB.Common_FileManager.FirstOrDefault(e => e.FileId == fileId);
|
||||
if (del != null)
|
||||
{
|
||||
Funs.DB.Common_FileManager.DeleteOnSubmit(del);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -804,6 +804,13 @@ namespace BLL
|
||||
return month;
|
||||
}
|
||||
|
||||
public static Int32 ConvertDateTimeToInt32(DateTime dtime)
|
||||
{
|
||||
string dt = string.Format("{0:yyyy-MM-dd HH:mm:ss}", dtime);
|
||||
DateTime dt1 = new DateTime(1970, 1, 1, 8, 0, 0);
|
||||
DateTime dt2 = Convert.ToDateTime(dt);
|
||||
return Convert.ToInt32((dt2 - dt1).TotalSeconds);
|
||||
}
|
||||
|
||||
public static DateTime GetQuarterlyMonths(string year, string quarterly)
|
||||
{
|
||||
@@ -995,6 +1002,23 @@ namespace BLL
|
||||
return str;
|
||||
}
|
||||
|
||||
public static bool? getBoolByString(string strValue)
|
||||
{
|
||||
bool? returnV = null;
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(strValue))
|
||||
{
|
||||
returnV = Convert.ToBoolean(strValue);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
}
|
||||
return returnV;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将IEnumerable<T>类型的集合转换为DataTable类型
|
||||
/// </summary>
|
||||
|
||||
@@ -92,66 +92,72 @@ namespace BLL.Common
|
||||
var rows = sheet.GetRowEnumerator();
|
||||
rows.MoveNext();
|
||||
var row = (HSSFRow)rows.Current;
|
||||
for (var j = 0; j < row.LastCellNum; j++)
|
||||
try
|
||||
{
|
||||
var cell = row.GetCell(j);
|
||||
if (cell != null)
|
||||
for (var j = 0; j < row.LastCellNum; j++)
|
||||
{
|
||||
dt.Columns.Add(cell.StringCellValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
dt.Columns.Add("collum" + j);
|
||||
}
|
||||
|
||||
}
|
||||
while (rows.MoveNext())
|
||||
{
|
||||
row = (HSSFRow)rows.Current;
|
||||
var dr = dt.NewRow();
|
||||
for (var i = 0; i < row.LastCellNum; i++)
|
||||
{
|
||||
var cell = row.GetCell(i);
|
||||
if (cell == null)
|
||||
var cell = row.GetCell(j);
|
||||
if (cell != null)
|
||||
{
|
||||
dr[i] = null;
|
||||
dt.Columns.Add(cell.StringCellValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (cell.CellType)
|
||||
dt.Columns.Add("collum" + j);
|
||||
}
|
||||
|
||||
}
|
||||
while (rows.MoveNext())
|
||||
{
|
||||
row = (HSSFRow)rows.Current;
|
||||
var dr = dt.NewRow();
|
||||
for (var i = 0; i < row.LastCellNum; i++)
|
||||
{
|
||||
var cell = row.GetCell(i);
|
||||
if (cell == null)
|
||||
{
|
||||
case CellType.Blank:
|
||||
//dr[i] = "[null]";
|
||||
break;
|
||||
case CellType.Boolean:
|
||||
dr[i] = cell.BooleanCellValue;
|
||||
break;
|
||||
case CellType.Numeric:
|
||||
dr[i] = cell.ToString();
|
||||
break;
|
||||
case CellType.String:
|
||||
dr[i] = cell.StringCellValue;
|
||||
break;
|
||||
case CellType.Error:
|
||||
dr[i] = cell.ErrorCellValue;
|
||||
break;
|
||||
case CellType.Formula:
|
||||
try
|
||||
{
|
||||
dr[i] = cell.NumericCellValue;
|
||||
}
|
||||
catch
|
||||
{
|
||||
dr[i] = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (cell.CellType)
|
||||
{
|
||||
case CellType.Blank:
|
||||
//dr[i] = "[null]";
|
||||
break;
|
||||
case CellType.Boolean:
|
||||
dr[i] = cell.BooleanCellValue;
|
||||
break;
|
||||
case CellType.Numeric:
|
||||
dr[i] = cell.ToString();
|
||||
break;
|
||||
case CellType.String:
|
||||
dr[i] = cell.StringCellValue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dr[i] = "=" + cell.CellFormula;
|
||||
break;
|
||||
break;
|
||||
case CellType.Error:
|
||||
dr[i] = cell.ErrorCellValue;
|
||||
break;
|
||||
case CellType.Formula:
|
||||
try
|
||||
{
|
||||
dr[i] = cell.NumericCellValue;
|
||||
}
|
||||
catch
|
||||
{
|
||||
dr[i] = cell.StringCellValue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dr[i] = "=" + cell.CellFormula;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dt.Rows.Add(dr);
|
||||
}
|
||||
dt.Rows.Add(dr);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
return dt;
|
||||
|
||||
@@ -1876,7 +1876,7 @@
|
||||
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"0\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr style=\"height: 55px\">");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 15%;\" >{0}</td> ", imgStrUrl);
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 85%;font-size: 10pt;font-weight: bold;\">{0}</td> ", "中国化学工程第十一建设有限公司");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 85%;font-size: 10pt;font-weight: bold;\">{0}</td> ", "中国成达工程有限公司");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
@@ -1920,7 +1920,7 @@
|
||||
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"0\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr style=\"height: 55px\">");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 15%;\" >{0}</td> ", imgStrUrl);
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 85%;font-size: 10pt;font-weight: bold;\">{0}</td> ", "中国化学工程第十一建设有限公司");
|
||||
sb.AppendFormat("<td align=\"center\" style=\"width: 85%;font-size: 10pt;font-weight: bold;\">{0}</td> ", "中国成达工程有限公司");
|
||||
sb.Append("</tr>");
|
||||
sb.Append("</table>");
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BLL
|
||||
Model.Weather getWeather = new Model.Weather();
|
||||
string appkey = "7416f4dd68c9352e02be31b12f15d74f"; //配置您申请的appkey
|
||||
var project = ProjectService.GetProjectByProjectId(projectId);
|
||||
string city = "开封";
|
||||
string city = "成都";
|
||||
if (project != null && !string.IsNullOrEmpty(project.City))
|
||||
{
|
||||
city = project.City;
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace BLL
|
||||
return Funs.DB.T_d_EmployInOutRecord.FirstOrDefault(e => e.NewID == id);
|
||||
}
|
||||
|
||||
|
||||
#region 根据出入记录 写入考勤记录
|
||||
/// <summary>
|
||||
/// 根据出入记录 写入考勤记录
|
||||
|
||||
@@ -14,9 +14,13 @@
|
||||
#region 报表类型
|
||||
public static ListItem[] NDTCheckSelectPrint()
|
||||
{
|
||||
ListItem[] lis = new ListItem[2];
|
||||
lis[0] = new ListItem("无损检测结果通知单", BLL.Const.CheckReportId);
|
||||
lis[1] = new ListItem("管道对接焊接接头报检/检查记录", BLL.Const.WeldJointCheckReportId);
|
||||
ListItem[] lis = new ListItem[4];
|
||||
lis[0] = new ListItem("管道焊口无损检测结果通知单", BLL.Const.CheckReport1Id);
|
||||
lis[1] = new ListItem("设备焊口无损检测结果通知单", BLL.Const.CheckReport2Id);
|
||||
lis[2] = new ListItem("管道对接焊接接头报检/检查记录", BLL.Const.WeldJointCheckReportId);
|
||||
lis[3] = new ListItem("管道无损检测结果汇总表", BLL.Const.CheckReport3Id);
|
||||
lis[3] = new ListItem("管道无损检测数量统计表", BLL.Const.CheckReport4Id);
|
||||
|
||||
return lis;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -30,7 +30,15 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.View_CH_CheckItem.FirstOrDefault(e => e.JOT_ID == jotId);
|
||||
}
|
||||
public static Model.View_CH_CheckItem GetNoCheckViewCheckItemByJOTID(string jotId)
|
||||
{
|
||||
return Funs.DB.View_CH_CheckItem.FirstOrDefault(e => e.JOT_ID == jotId && e.CHT_CheckID == null);
|
||||
}
|
||||
|
||||
public static Model.View_CH_CheckItem GetNoCheckViewCheckItemByJOTID(string jotId, string CH_TrustID)
|
||||
{
|
||||
return Funs.DB.View_CH_CheckItem.FirstOrDefault(e => e.JOT_ID == jotId && e.CH_TrustID == CH_TrustID);
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据焊口ID获取检测明细信息
|
||||
/// </summary>
|
||||
@@ -78,7 +86,10 @@ namespace BLL
|
||||
newCheckItem.CHT_FloorWelder2 = checkItem.CHT_FloorWelder2;
|
||||
newCheckItem.FilmSpecifications = checkItem.FilmSpecifications;
|
||||
newCheckItem.DefectLength = checkItem.DefectLength;
|
||||
newCheckItem.DefectDepth = checkItem.DefectDepth;
|
||||
newCheckItem.DefectHeight = checkItem.DefectHeight;
|
||||
newCheckItem.ExtendingRice = checkItem.ExtendingRice;
|
||||
newCheckItem.Defects_Definition = checkItem.Defects_Definition;
|
||||
|
||||
Funs.DB.CH_CheckItem.InsertOnSubmit(newCheckItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
@@ -208,6 +219,10 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.CH_CheckItem.FirstOrDefault(e => e.JOT_ID == jotId);
|
||||
}
|
||||
public static Model.CH_CheckItem GetCheckItemByJotId(string jotId, string checkId)
|
||||
{
|
||||
return Funs.DB.CH_CheckItem.FirstOrDefault(e => e.JOT_ID == jotId && e.CHT_CheckID == checkId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据检测id获取明细视图
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 检测主表
|
||||
/// </summary>
|
||||
public class CheckManageService
|
||||
public class CheckManageService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据检测Id获取检测信息
|
||||
@@ -229,7 +229,5 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.CH_Check.FirstOrDefault(e => e.CHT_CheckCode == checkCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +343,56 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
#region 批量删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Model.ResponeData DelAllJots(string projectId, string isoId,string JointNo)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
int pcount = 0;
|
||||
IQueryable<Model.PW_JointInfo> getDataList = Funs.DB.PW_JointInfo.Where(x => x.ProjectId == projectId && x.ISO_ID == isoId);
|
||||
if (!string.IsNullOrEmpty(JointNo))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.JOT_JointNo.Contains(JointNo));
|
||||
}
|
||||
|
||||
pcount = getDataList.Count();
|
||||
if (pcount == 0)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "没有符合条件数据!";
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDJot = getDataList.FirstOrDefault(x => x.DReportID != null);
|
||||
if (getDJot != null)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "存在已做日报的焊口!";
|
||||
}
|
||||
else
|
||||
{
|
||||
Funs.DB.PW_JointInfo.DeleteAllOnSubmit(getDataList);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
responeData.code = 1;
|
||||
responeData.message = "删除焊口:" + pcount.ToString() + "个。";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
|
||||
@@ -1,14 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class PipelineService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 获取管线信息
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.HJGL_View_IsoInfoList> getDataLists = from x in db.HJGL_View_IsoInfoList
|
||||
select x;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId,string workAreaId,string unitId,string standard, string isoNo, string testMediumId
|
||||
,string detectionTypeId,string isoNumber,string materialId,string specification,Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.HJGL_View_IsoInfoList> getDataList = getDataLists.Where(x=>x.ProjectId == projectId);
|
||||
if (!string.IsNullOrEmpty(workAreaId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.WorkAreaId == workAreaId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(standard))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.Is_Standard == standard);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(isoNo))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ISO_IsoNo.Contains(isoNo));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(testMediumId) && testMediumId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.TestMediumId == testMediumId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(detectionTypeId) && detectionTypeId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.DetectionTypeId == detectionTypeId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(isoNumber))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ISO_IsoNumber.Contains(isoNumber));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(materialId) && materialId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.MaterialId == materialId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(specification))
|
||||
{
|
||||
// getDataList = getDataList.Where(x => x.ISO_Specification.Contains(specification));
|
||||
}
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (Grid1.PageSize > count)
|
||||
{
|
||||
Grid1.PageSize = count;
|
||||
}
|
||||
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.ISO_ID,
|
||||
x.ProjectId,
|
||||
x.ISO_IsoNo,
|
||||
x.UnitId,
|
||||
x.UnitName,
|
||||
x.TestMediumId,
|
||||
x.MediumName,
|
||||
x.DetectionRateId,
|
||||
x.DetectionRateValue,
|
||||
x.DetectionTypeId,
|
||||
x.DetectionTypeName,
|
||||
x.WorkAreaId,
|
||||
x.WorkAreaCode,
|
||||
//x.ISO_SysNo,
|
||||
//x.ISO_SubSysNo,
|
||||
//x.ISO_CwpNo,
|
||||
x.ISO_IsoNumber,
|
||||
//x.ISO_Rev,
|
||||
//x.ISO_Sheet,
|
||||
//x.ISO_PipeQty,
|
||||
//x.ISO_Paint,
|
||||
//x.ISO_Insulator,
|
||||
x.MaterialId,
|
||||
x.MaterialType,
|
||||
//x.ISO_Executive,
|
||||
//x.ISO_Modifier,
|
||||
//x.ISO_ModifyDate,
|
||||
//x.ISO_Creator,
|
||||
//x.ISO_CreateDate,
|
||||
//x.ISO_DesignPress,
|
||||
//x.ISO_DesignTemperature,
|
||||
//x.ISO_TestPress,
|
||||
//x.ISO_TestTemperature,
|
||||
x.ISO_NDTClass,
|
||||
x.ISO_PTRate,
|
||||
x.Is_Standard,
|
||||
x.PipingClassId,
|
||||
x.PipingClassName,
|
||||
// x.ISO_PTClass,
|
||||
//ISO_IfPickling = (x.ISO_IfPickling == true ? "是" : "否"),
|
||||
//ISO_IfChasing = (x.ISO_IfChasing == true ? "是" : "否"),
|
||||
//x.ISO_Remark,
|
||||
x.TotalDin,
|
||||
x.JointCount
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 批量删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Model.ResponeData DelAllPopeline(string projectId, string workAreaId, string unitId, string standard, string isoNo, string testMediumId
|
||||
, string detectionTypeId, string isoNumber, string materialId, string specification)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
int pcount = 0;
|
||||
IQueryable<Model.PW_IsoInfo> getDataList = Funs.DB.PW_IsoInfo.Where(x => x.ProjectId == projectId);
|
||||
if (!string.IsNullOrEmpty(workAreaId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.WorkAreaId == workAreaId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(standard))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.Is_Standard == Convert.ToBoolean(standard));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(isoNo))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ISO_IsoNo.Contains(isoNo));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(testMediumId) && testMediumId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.TestMediumId == testMediumId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(detectionTypeId) && testMediumId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.DetectionTypeId == detectionTypeId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(isoNumber))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ISO_IsoNumber.Contains(isoNumber));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(materialId) && testMediumId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.MaterialId == materialId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(specification))
|
||||
{
|
||||
getDataList = getDataList.Where(x => x.ISO_Specification.Contains(specification));
|
||||
}
|
||||
|
||||
pcount = getDataList.Count();
|
||||
if (pcount == 0)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "没有符合条件数据!";
|
||||
}
|
||||
else
|
||||
{
|
||||
var getJots = from x in Funs.DB.PW_JointInfo
|
||||
join y in getDataList on x.ISO_ID equals y.ISO_ID
|
||||
select x;
|
||||
|
||||
var getDJot = getJots.FirstOrDefault(x => x.DReportID != null);
|
||||
if (getDJot != null)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "当前管线中,存在已做日报的焊口!";
|
||||
}
|
||||
else
|
||||
{
|
||||
int jcount = getJots.Count();
|
||||
Funs.DB.PW_JointInfo.DeleteAllOnSubmit(getJots);
|
||||
|
||||
Funs.DB.PW_IsoInfo.DeleteAllOnSubmit(getDataList);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
responeData.code = 1;
|
||||
responeData.message = "删除管线:"+ pcount.ToString()+"条;焊口:"+ jcount .ToString()+ "个。";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据管线ID获取管线信息
|
||||
/// </summary>
|
||||
|
||||
@@ -113,11 +113,11 @@ namespace BLL
|
||||
var q = (from x in db.Check_CheckSpecialDetail where x.CheckSpecialId == checkSpecialId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
foreach (var item in q)
|
||||
{
|
||||
////删除附件表
|
||||
BLL.CommonService.DeleteAttachFileById(item.CheckSpecialDetailId);
|
||||
}
|
||||
//foreach (var item in q)
|
||||
//{
|
||||
// ////删除附件表
|
||||
// BLL.CommonService.DeleteAttachFileById(item.CheckSpecialDetailId);
|
||||
//}
|
||||
db.Check_CheckSpecialDetail.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class EduTrain_TaskNoticeService
|
||||
{
|
||||
|
||||
public static Model.EduTrain_TaskNotice GetEduTrain_TaskNoticeById(string TaskNoticeId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TaskNoticeId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == TaskNoticeId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void AddEduTrain_TaskNotice(Model.EduTrain_TaskNotice newtable)
|
||||
{
|
||||
Model.EduTrain_TaskNotice table = new Model.EduTrain_TaskNotice();
|
||||
table.TaskNoticeId = newtable.TaskNoticeId;
|
||||
table.CycleStartDate = newtable.CycleStartDate;
|
||||
table.CycleEndDate = newtable.CycleEndDate;
|
||||
table.TrainContent = newtable.TrainContent;
|
||||
table.CreatMan = newtable.CreatMan;
|
||||
table.CreatDate = newtable.CreatDate;
|
||||
table.TrainTitle = newtable.TrainTitle;
|
||||
table.TrainType = newtable.TrainType;
|
||||
table.TeachHour = newtable.TeachHour;
|
||||
table.Units = newtable.Units;
|
||||
table.TeachAddress = newtable.TeachAddress;
|
||||
table.TeachMan = newtable.TeachMan;
|
||||
table.TrainStartDate = newtable.TrainStartDate;
|
||||
table.Cycle = newtable.Cycle;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.AheadOfTime = newtable.AheadOfTime;
|
||||
table.DayOfWeek = newtable.DayOfWeek;
|
||||
table.WeekOfMonth = newtable.WeekOfMonth;
|
||||
table.State = newtable.State;
|
||||
|
||||
Funs.DB.EduTrain_TaskNotice.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateEduTrain_TaskNotice(Model.EduTrain_TaskNotice newtable)
|
||||
{
|
||||
Model.EduTrain_TaskNotice table = Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == newtable.TaskNoticeId);
|
||||
|
||||
if (table != null)
|
||||
{
|
||||
table.TaskNoticeId = newtable.TaskNoticeId;
|
||||
table.CycleStartDate = newtable.CycleStartDate;
|
||||
table.CycleEndDate = newtable.CycleEndDate;
|
||||
table.TrainContent = newtable.TrainContent;
|
||||
table.CreatMan = newtable.CreatMan;
|
||||
table.CreatDate = newtable.CreatDate;
|
||||
table.TrainTitle = newtable.TrainTitle;
|
||||
table.TrainType = newtable.TrainType;
|
||||
table.TeachHour = newtable.TeachHour;
|
||||
table.Units = newtable.Units;
|
||||
table.TeachAddress = newtable.TeachAddress;
|
||||
table.TeachMan = newtable.TeachMan;
|
||||
table.TrainStartDate = newtable.TrainStartDate;
|
||||
table.Cycle = newtable.Cycle;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.AheadOfTime = newtable.AheadOfTime;
|
||||
table.DayOfWeek = newtable.DayOfWeek;
|
||||
table.WeekOfMonth = newtable.WeekOfMonth;
|
||||
table.State = newtable.State;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteEduTrain_TaskNoticeById(string TaskNoticeId)
|
||||
{
|
||||
Model.EduTrain_TaskNotice table = Funs.DB.EduTrain_TaskNotice.FirstOrDefault(e => e.TaskNoticeId == TaskNoticeId);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.EduTrain_TaskNotice.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,8 @@ namespace BLL
|
||||
TestType = TestTrainingItem.TestType,
|
||||
WorkPostIds = TestTrainingItem.WorkPostIds,
|
||||
WorkPostNames = TestTrainingItem.WorkPostNames,
|
||||
DepartIds = TestTrainingItem.DepartIds,
|
||||
DepartNames = TestTrainingItem.DepartNames,
|
||||
AItem = TestTrainingItem.AItem,
|
||||
BItem = TestTrainingItem.BItem,
|
||||
CItem = TestTrainingItem.CItem,
|
||||
@@ -68,6 +70,8 @@ namespace BLL
|
||||
newTestTrainingItem.TestType = TestTrainingItem.TestType;
|
||||
newTestTrainingItem.WorkPostIds = TestTrainingItem.WorkPostIds;
|
||||
newTestTrainingItem.WorkPostNames = TestTrainingItem.WorkPostNames;
|
||||
newTestTrainingItem.DepartIds = TestTrainingItem.DepartIds;
|
||||
newTestTrainingItem.DepartNames = TestTrainingItem.DepartNames;
|
||||
newTestTrainingItem.AItem = TestTrainingItem.AItem;
|
||||
newTestTrainingItem.BItem = TestTrainingItem.BItem;
|
||||
newTestTrainingItem.CItem = TestTrainingItem.CItem;
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace BLL
|
||||
FileContent = completionReport.FileContent,
|
||||
CompileMan = completionReport.CompileMan,
|
||||
CompileDate = completionReport.CompileDate,
|
||||
Remark = completionReport.Remark,
|
||||
States = completionReport.States
|
||||
};
|
||||
db.Manager_CompletionReport.InsertOnSubmit(newCompletionReport);
|
||||
@@ -60,6 +61,7 @@ namespace BLL
|
||||
newCompletionReport.CompileMan = completionReport.CompileMan;
|
||||
newCompletionReport.CompileDate = completionReport.CompileDate;
|
||||
newCompletionReport.States = completionReport.States;
|
||||
newCompletionReport.Remark = completionReport.Remark;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace BLL
|
||||
/// <returns>人员的数量</returns>
|
||||
public static int GetPersonCountByUnitId(string unitId, string projectId)
|
||||
{
|
||||
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.IsUsed == true select x).ToList();
|
||||
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.IsUsed == 1 select x).ToList();
|
||||
return q.Count();
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace BLL
|
||||
/// <returns>HSE人员的数量</returns>
|
||||
public static int GetHSEPersonCountByUnitId(string unitId, string projectId)
|
||||
{
|
||||
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && (x.WorkPostId == BLL.Const.WorkPost_HSSEEngineer || x.WorkPostId == BLL.Const.WorkPost_SafetyManager) && x.IsUsed == true select x).ToList();
|
||||
var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && (x.WorkPostId == BLL.Const.WorkPost_HSSEEngineer || x.WorkPostId == BLL.Const.WorkPost_SafetyManager) && x.IsUsed == 1 select x).ToList();
|
||||
return q.Count();
|
||||
}
|
||||
|
||||
@@ -519,6 +519,27 @@ namespace BLL
|
||||
return (from x in Funs.DB.SitePerson_Person where x.WorkAreaId == workAreaId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 人员离岗
|
||||
/// </summary>
|
||||
/// <param name="person"></param>
|
||||
public static void PersonOut(string personId, DateTime date)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var person = db.SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (person != null)
|
||||
{
|
||||
person.OutTime = date;
|
||||
person.IsUsed = 1;
|
||||
person.ExchangeTime = null;
|
||||
person.ExchangeTime2 = null;
|
||||
person.RealNameUpdateTime = null;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 表下拉框
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
@@ -592,7 +613,7 @@ namespace BLL
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getInPersonLists = from x in db.SitePerson_Person
|
||||
where x.IsUsed == true && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
where x.IsUsed == 1 && x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -110,6 +110,11 @@ namespace BLL
|
||||
public static void AddLargerHazardList(Model.Solution_LargerHazardList LargerHazardList)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string code= CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectExpertArgumentMenuId, LargerHazardList.ProjectId, null, LargerHazardList.LargerHazardListId, LargerHazardList.RecordTime);
|
||||
if (string.IsNullOrEmpty(LargerHazardList.HazardCode))
|
||||
{
|
||||
LargerHazardList.HazardCode = code;
|
||||
}
|
||||
Model.Solution_LargerHazardList newLargerHazardList = new Model.Solution_LargerHazardList
|
||||
{
|
||||
LargerHazardListId = LargerHazardList.LargerHazardListId,
|
||||
@@ -124,7 +129,7 @@ namespace BLL
|
||||
db.Solution_LargerHazardList.InsertOnSubmit(newLargerHazardList);
|
||||
db.SubmitChanges();
|
||||
|
||||
CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectExpertArgumentMenuId, LargerHazardList.ProjectId, null, LargerHazardList.LargerHazardListId, LargerHazardList.RecordTime);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -164,10 +169,6 @@ namespace BLL
|
||||
}
|
||||
|
||||
#region 危大工程清单明细
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static List<Model.View_Solution_LargerHazardListItem> getViewLargerHazardListItem = new List<Model.View_Solution_LargerHazardListItem>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取危大工程清单明细
|
||||
|
||||
@@ -43,6 +43,19 @@ namespace BLL
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据方案审查Id删除一个方案审查信息
|
||||
/// </summary>
|
||||
/// <param name="constructSolutionCode">方案审查Id</param>
|
||||
public static void DeleteConstructSolutionByCQMSConstructSolutionId(string CQMSConstructSolutionId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Solution_HSSEConstructSolution constructSolution = db.Solution_HSSEConstructSolution.First(e => e.CQMSConstructSolutionId == CQMSConstructSolutionId);
|
||||
|
||||
db.Solution_HSSEConstructSolution.DeleteOnSubmit(constructSolution);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加方案审查信息
|
||||
/// </summary>
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.WBS_CnProfessionInit> GetCnProfessionDropDownList2()
|
||||
{
|
||||
var list = (from x in Funs.DB.WBS_CnProfessionInit where x.CnProfessionId != 19 orderby x.CnProfessionId select x).ToList();
|
||||
var list = (from x in Funs.DB.WBS_CnProfessionInit where x.CnProfessionId != 23 orderby x.CnProfessionId select x).ToList();
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,5 +306,25 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.Wbs_WbsSet.FirstOrDefault(e => e.WbsSetId == wbsSetId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分部/子分部/分项/子分项工程Id获取分部/子分部/分项/子分项工程信息
|
||||
/// </summary>
|
||||
/// <param name="unitProjectId">分部/子分部/分项/子分项工程Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Wbs_WbsSet> GetWbsSetsBySuperWbsSetIdAndWbsSetId(string superWbsSetId, string wbsSetId)
|
||||
{
|
||||
return (from x in Funs.DB.Wbs_WbsSet where x.SuperWbsSetId == superWbsSetId && x.WbsSetId != wbsSetId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据分部/子分部/分项/子分项工程Id获取分部/子分部/分项/子分项工程信息
|
||||
/// </summary>
|
||||
/// <param name="unitProjectId">分部/子分部/分项/子分项工程Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Wbs_WbsSet> GetWbsSetsByUnitProjectId(string unitProjectId)
|
||||
{
|
||||
return (from x in Funs.DB.Wbs_WbsSet where x.UnitProjectId == unitProjectId && x.SuperWbsSetId == null select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,38 @@ namespace BLL
|
||||
page.Response.Cookies["UserInfo"].Expires = DateTime.Now.AddDays(-1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户登录成功方法
|
||||
/// </summary>
|
||||
/// <param name="loginname">登录成功名</param>
|
||||
/// <param name="password">未加密密码</param>
|
||||
/// <param name="rememberMe">记住我开关</param>
|
||||
/// <param name="page">调用页面</param>
|
||||
/// <returns>是否登录成功</returns>
|
||||
public static bool UserLogOnByAccount(string account, System.Web.UI.Page page)
|
||||
{
|
||||
var x = (from y in Funs.DB.Sys_User
|
||||
where y.Account == account && y.IsPost == true
|
||||
select y);
|
||||
if (x.Any())
|
||||
{
|
||||
string accValue = HttpUtility.UrlEncode(account);
|
||||
FormsAuthentication.SetAuthCookie(accValue, false);
|
||||
page.Session[SessionName.CurrUser] = x.First();
|
||||
|
||||
// 当选择不保存用户名时,Cookies过期时间设置为昨天.
|
||||
page.Response.Cookies["UserInfo"].Expires = DateTime.Now.AddDays(-1);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -272,13 +272,13 @@ namespace BLL
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getPersons = from x in db.SitePerson_Person
|
||||
where x.OutTime < DateTime.Now && x.IsUsed == true
|
||||
where x.OutTime < DateTime.Now && x.IsUsed == 1
|
||||
select x;
|
||||
if (getPersons.Count() > 0)
|
||||
{
|
||||
foreach (var item in getPersons)
|
||||
{
|
||||
item.IsUsed = false;
|
||||
item.IsUsed = 0;
|
||||
item.ExchangeTime2 = null;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,20 @@
|
||||
{
|
||||
return Funs.DB.Base_Project.FirstOrDefault(e => e.ProjectId == projectId);
|
||||
}
|
||||
public static Model.Base_Project GetProjectByProjectCode(string code)
|
||||
{
|
||||
return Funs.DB.Base_Project.FirstOrDefault(e => e.ProjectCode == code);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取安全经理
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Project_ProjectUser getHSSEManager(string projectId)
|
||||
{
|
||||
return Funs.DB.Project_ProjectUser.FirstOrDefault(x => x.ProjectId == projectId && x.RoleId.Contains(BLL.Const.HSSEManager));
|
||||
}
|
||||
/// <summary>
|
||||
///根据ID获取项目名称
|
||||
/// </summary>
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace BLL
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return (from x in Funs.DB.SitePerson_Person
|
||||
where x.TeamGroupId == teamGroupId && x.IsUsed == true && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
where x.TeamGroupId == teamGroupId && x.IsUsed == 1 && (!x.OutTime.HasValue || x.OutTime > DateTime.Now)
|
||||
select x).Count();
|
||||
}
|
||||
|
||||
@@ -124,6 +124,11 @@ namespace BLL
|
||||
orderby x.TeamGroupCode select x).ToList();
|
||||
}
|
||||
|
||||
public static Model.ProjectData_TeamGroup getTeamGroupByTeamGroupName(string projectId, string unitId, string name)
|
||||
{
|
||||
return Funs.DB.ProjectData_TeamGroup.FirstOrDefault(x => x.ProjectId == projectId && x.UnitId == unitId && x.TeamGroupName == name);
|
||||
}
|
||||
|
||||
#region 表下拉框
|
||||
/// <summary>
|
||||
/// 表下拉框
|
||||
|
||||
@@ -12,6 +12,11 @@ namespace BLL
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
public static Model.WBS_UnitWork GetUnitWorkByUnitWorkName(string projectId, string unitWorkName)
|
||||
{
|
||||
return Funs.DB.WBS_UnitWork.FirstOrDefault(e => e.ProjectId == projectId && e.UnitWorkName == unitWorkName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加单位工程信息
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,11 @@ namespace BLL
|
||||
return Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartId == departId);
|
||||
}
|
||||
|
||||
public static Model.Base_Depart getDepartByDepartName(string name)
|
||||
{
|
||||
return Funs.DB.Base_Depart.FirstOrDefault(e => e.DepartName == name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
|
||||
@@ -19,6 +19,11 @@
|
||||
return Funs.DB.Sys_Role.FirstOrDefault(x => x.RoleId == roleId);
|
||||
}
|
||||
|
||||
public static Model.Sys_Role getRoleByName(string roleName)
|
||||
{
|
||||
return Funs.DB.Sys_Role.FirstOrDefault(x => x.RoleName == roleName);
|
||||
}
|
||||
|
||||
public static string GetRoleTypeByRoleId(string roleId)
|
||||
{
|
||||
string type = string.Empty;
|
||||
|
||||
@@ -45,6 +45,19 @@ namespace BLL
|
||||
return (unit != null);
|
||||
}
|
||||
|
||||
public static Model.Base_Unit getUnitByCollCropCodeUnitName(string CollCropCode, string unitName)
|
||||
{
|
||||
var getUnit = Funs.DB.Base_Unit.FirstOrDefault(e => e.CollCropCode == CollCropCode);
|
||||
if (getUnit != null)
|
||||
{
|
||||
return getUnit;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Funs.DB.Base_Unit.FirstOrDefault(e => e.UnitName == unitName);
|
||||
}
|
||||
}
|
||||
|
||||
#region 单位信息维护
|
||||
/// <summary>
|
||||
/// 添加单位信息
|
||||
|
||||
@@ -28,6 +28,10 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.UserName == userName);
|
||||
}
|
||||
public static Model.Sys_User GetUserByAccount(string account)
|
||||
{
|
||||
return Funs.DB.Sys_User.FirstOrDefault(e => e.Account == account);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户项目上角色List
|
||||
@@ -192,7 +196,7 @@ namespace BLL
|
||||
public static void AddUser(Model.Sys_User user)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
string newKeyID = SQLHelper.GetNewID(typeof(Model.Sys_User));
|
||||
string newKeyID = SQLHelper.GetNewID();
|
||||
Model.Sys_User newUser = new Model.Sys_User
|
||||
{
|
||||
UserId = newKeyID,
|
||||
@@ -314,6 +318,26 @@ namespace BLL
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// ÐÞ¸ÄÔ±¹¤ÐÅÏ¢
|
||||
/// </summary>
|
||||
/// <param name="user">ÈËԱʵÌå</param>
|
||||
public static void UpdateUserInfo(Model.Sys_User user)
|
||||
{
|
||||
Model.Sys_User newUser = Funs.DB.Sys_User.FirstOrDefault(e => e.UserId == user.UserId);
|
||||
if (newUser != null)
|
||||
{
|
||||
newUser.Account = user.Account;
|
||||
newUser.UserName = user.UserName;
|
||||
newUser.UserCode = user.UserCode;
|
||||
newUser.IdentityCard = user.IdentityCard;
|
||||
newUser.Email = user.Email;
|
||||
newUser.Telephone = user.Telephone;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据人员Id删除一个人员信息
|
||||
/// </summary>
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BLL
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in db.SitePerson_Person
|
||||
where x.IsUsed == true
|
||||
where x.IsUsed == 1
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -182,5 +182,196 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 启动监视器 定时清理推送日志
|
||||
/// <summary>
|
||||
/// 监视组件
|
||||
/// </summary>
|
||||
private static Timer messageTimer1;
|
||||
|
||||
/// <summary>
|
||||
/// 定时清理推送日志
|
||||
/// </summary>
|
||||
public static void StartMonitorDeletePushLog()
|
||||
{
|
||||
int adTimeJ = 60 * 12;
|
||||
if (messageTimer1 != null)
|
||||
{
|
||||
messageTimer1.Stop();
|
||||
messageTimer1.Dispose();
|
||||
messageTimer1 = null;
|
||||
}
|
||||
if (adTimeJ > 0)
|
||||
{
|
||||
messageTimer1 = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimer1.Elapsed += new ElapsedEventHandler(DeletePushLog);
|
||||
messageTimer1.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
|
||||
messageTimer1.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
/// </summary>
|
||||
/// <param name="sender">Timer组件</param>
|
||||
/// <param name="e">事件参数</param>
|
||||
private static void DeletePushLog(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
/// 3天推送实名制日志
|
||||
var getPushLogs = Funs.DB.RealName_PushLog.Where(x => x.PushTime.Value.AddDays(3) < DateTime.Now);
|
||||
if (getPushLogs.Count() > 0)
|
||||
{
|
||||
Funs.DB.RealName_PushLog.DeleteAllOnSubmit(getPushLogs);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
/// 3个月操作日志
|
||||
var getSys_Logs = Funs.DB.Sys_Log.Where(x => x.OperationTime.Value.AddMonths(3) < DateTime.Now);
|
||||
if (getSys_Logs.Count() > 0)
|
||||
{
|
||||
Funs.DB.Sys_Log.DeleteAllOnSubmit(getSys_Logs);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
/// 1个月推送消息日志
|
||||
var getSys_HttpLogs = Funs.DB.Sys_HttpLog.Where(x => x.LogTime.Value.AddMonths(1) < DateTime.Now);
|
||||
if (getSys_HttpLogs.Count() > 0)
|
||||
{
|
||||
Funs.DB.Sys_HttpLog.DeleteAllOnSubmit(getSys_HttpLogs);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 启动监视器 定时清理推送日志
|
||||
/// <summary>
|
||||
/// 监视组件
|
||||
/// </summary>
|
||||
private static Timer messageTimer2;
|
||||
|
||||
/// <summary>
|
||||
/// 定时清理推送日志
|
||||
/// </summary>
|
||||
public static void StartMonitorCleanAttendance()
|
||||
{
|
||||
int adTimeJ = 60 * 12;
|
||||
if (messageTimer2 != null)
|
||||
{
|
||||
messageTimer2.Stop();
|
||||
messageTimer2.Dispose();
|
||||
messageTimer2 = null;
|
||||
}
|
||||
if (adTimeJ > 0)
|
||||
{
|
||||
messageTimer2 = new Timer
|
||||
{
|
||||
AutoReset = true
|
||||
};
|
||||
messageTimer2.Elapsed += new ElapsedEventHandler(CleanAttendance);
|
||||
messageTimer2.Interval = 1000 * 60 * adTimeJ;// 60分钟 60000 * adTimeJ;
|
||||
messageTimer2.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程确认 定时执行 系统启动5分钟
|
||||
/// </summary>
|
||||
/// <param name="sender">Timer组件</param>
|
||||
/// <param name="e">事件参数</param>
|
||||
private static void CleanAttendance(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
/// 清理出入记录
|
||||
var getRecords = from x in Funs.DB.T_d_facerecord where x.DateTimeRecord.Value.AddDays(1) < DateTime.Now select x;
|
||||
if (getRecords.Count() > 0)
|
||||
{
|
||||
foreach (var item in getRecords)
|
||||
{
|
||||
if (item.InOrOut == "进门")
|
||||
{
|
||||
var getDelRecordsIn = from x in Funs.DB.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord > item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsIn.Count() > 0)
|
||||
{
|
||||
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsIn);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDelRecordsOut = from x in Funs.DB.T_d_facerecord
|
||||
where x.ProjectId == item.ProjectId && x.EmployNO == item.EmployNO && x.InOrOut == item.InOrOut
|
||||
&& x.DateTimeRecord.Value.Year == item.DateTimeRecord.Value.Year
|
||||
&& x.DateTimeRecord.Value.Month == item.DateTimeRecord.Value.Month
|
||||
&& x.DateTimeRecord.Value.Day == item.DateTimeRecord.Value.Day
|
||||
&& x.DateTimeRecord < item.DateTimeRecord
|
||||
select x;
|
||||
if (getDelRecordsOut.Count() > 0)
|
||||
{
|
||||
Funs.DB.T_d_facerecord.DeleteAllOnSubmit(getDelRecordsOut);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var getVRecords = from x in Funs.DB.T_d_validcardevent
|
||||
where x.RecordDateTime.Value.AddDays(1) < DateTime.Now
|
||||
select x;
|
||||
if (getVRecords.Count() > 0)
|
||||
{
|
||||
foreach (var item in getVRecords)
|
||||
{
|
||||
if (item.InOrOut == 1)
|
||||
{
|
||||
var getDelVRecordsIn = from x in Funs.DB.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime > item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsIn.Count() > 0)
|
||||
{
|
||||
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsIn);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var getDelVRecordsOut = from x in Funs.DB.T_d_validcardevent
|
||||
where x.ProjectId == item.ProjectId && x.IDCardNo == item.IDCardNo && x.InOrOut == item.InOrOut
|
||||
&& x.RecordDateTime.Value.Year == item.RecordDateTime.Value.Year
|
||||
&& x.RecordDateTime.Value.Month == item.RecordDateTime.Value.Month
|
||||
&& x.RecordDateTime.Value.Day == item.RecordDateTime.Value.Day
|
||||
&& x.RecordDateTime < item.RecordDateTime
|
||||
select x;
|
||||
if (getDelVRecordsOut.Count() > 0)
|
||||
{
|
||||
Funs.DB.T_d_validcardevent.DeleteAllOnSubmit(getDelVRecordsOut);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1005,7 +1005,7 @@ namespace BLL
|
||||
where (identityCard == null || x.IdentityCard == identityCard)
|
||||
&& y.ContractNo == proCode && v.TeamId.HasValue
|
||||
&& ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue && x.RealNameAddTime.HasValue)
|
||||
|| (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed && !x.OutTime.HasValue
|
||||
|| (type != Const.BtnModify && !x.RealNameAddTime.HasValue && x.IsUsed==1 && !x.OutTime.HasValue
|
||||
&& x.HeadImage != null && x.HeadImage.Length > 0))
|
||||
&& x.IsCardNoOK == true && pu.IsSynchro == true && z.JTproCode != null
|
||||
select new
|
||||
|
||||
@@ -77,16 +77,9 @@
|
||||
LabelAlign="right">
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true">
|
||||
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程" LabelAlign="Right" EnableEdit="true" Hidden="true">
|
||||
</f:DropDownList>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
|
||||
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime"
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="开始日期" ID="txtStartTime"
|
||||
LabelAlign="right" >
|
||||
</f:DatePicker>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="结束日期" ID="txtEndTime"
|
||||
@@ -101,10 +94,8 @@
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
@@ -118,25 +109,13 @@
|
||||
SortField="DocCode" FieldType="String" HeaderText="文件编号" TextAlign="Left" MinWidth="140px"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="UnitWorkName" DataField="UnitWorkName"
|
||||
SortField="UnitWorkName" FieldType="String" HeaderText="单位工程名称" TextAlign="Center"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UnitName" DataField="UnitName"
|
||||
SortField="UnitName" FieldType="String" HeaderText="施工单位" TextAlign="Left"
|
||||
SortField="UnitName" FieldType="String" HeaderText="被罚单位" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" ColumnID="Fee" DataField="Fee" SortField="Fee"
|
||||
FieldType="String" HeaderText="罚款金额" TextAlign="Center" HeaderTextAlign="Center">
|
||||
<f:RenderField Width="270px" ColumnID="QuestionDef" DataField="QuestionDef" SortField="QuestionDef"
|
||||
FieldType="String" HeaderText="处罚金额及理由" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="tfImageUrl1" Width="120px" HeaderText="整改前" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImageUrl" runat="server" Text='<%# ConvertImageUrlByImage(Eval("CheckFineId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
||||
|
||||
<f:RenderField Width="95px" ColumnID="CheckDate" DataField="CheckDate" SortField="CheckDate"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="日期" TextAlign="Center" HeaderTextAlign="Center">
|
||||
@@ -144,7 +123,18 @@
|
||||
<f:RenderField Width="95px" ColumnID="userName" DataField="userName" SortField="userName"
|
||||
FieldType="String" HeaderText="编制人" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
<f:TemplateField ColumnID="State" Width="100px" HeaderText="审批状态" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labState" runat="server" Text='<%# ConvertState(Eval("State")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="AuditMan" Width="80px" HeaderText="办理人" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbAuditMan" runat="server" Text='<%# ConvertMan(Eval("CheckFineId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
@@ -172,14 +162,16 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="质量罚款单" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||
Width="1000px" Height="450px">
|
||||
Width="1000px" Height="650px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
|
||||
OnClick="btnMenuModify_Click">
|
||||
</f:MenuButton>
|
||||
|
||||
<f:MenuButton ID="btnMenuView" EnablePostBack="true" runat="server" Text="查看" Icon="ApplicationViewIcons"
|
||||
OnClick="btnMenuView_Click">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="MenuButton1" EnablePostBack="true" EnableAjax="false" runat="server" DisableControlBeforePostBack="false" Text="质量罚款单打印" Icon="ApplicationViewIcons"
|
||||
OnClick="btnMenuNotice_Click">
|
||||
</f:MenuButton>
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
protected DataTable ChecklistData()
|
||||
{
|
||||
string strSql = @"SELECT Fee,chec.CheckFineId,chec.CheckControlCode,chec.ProjectId,chec.unitId,
|
||||
string strSql = @"SELECT Fee,chec.CheckFineId,chec.CheckControlCode,chec.ProjectId,chec.unitId,chec.QuestionDef,
|
||||
chec.checkman,chec.CheckDate,chec.DocCode,chec.state,
|
||||
unit.UnitName,unitWork.UnitWorkName+(case unitWork.ProjectType when '1' then '(建筑)' else '(安装)' end) as UnitWorkName,u.userName
|
||||
FROM Check_CheckFine chec
|
||||
@@ -136,12 +136,13 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(registrationId.ToString(), BLL.Const.CheckFineListMenuId);
|
||||
|
||||
if (sourlist != null&& sourlist.Count>0)
|
||||
if (sourlist != null && sourlist.Count > 0)
|
||||
{
|
||||
string AttachUrl = "";
|
||||
foreach(var item in sourlist)
|
||||
{ if(!string.IsNullOrEmpty(item.AttachUrl)&& item.AttachUrl.ToLower().EndsWith(".jpg")|| item.AttachUrl.ToLower().EndsWith(".jpeg")|| item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',')+",";
|
||||
foreach (var item in sourlist)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
||||
}
|
||||
url = BLL.UploadAttachmentService.ShowImage("../../", AttachUrl.TrimEnd(','));
|
||||
}
|
||||
@@ -153,7 +154,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
string url = string.Empty;
|
||||
if (registrationId != null)
|
||||
{
|
||||
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(registrationId.ToString()+"r", BLL.Const.CheckListMenuId);
|
||||
IList<Model.AttachFile> sourlist = AttachFileService.Getfilelist(registrationId.ToString() + "r", BLL.Const.CheckListMenuId);
|
||||
|
||||
if (sourlist != null && sourlist.Count > 0)
|
||||
{
|
||||
@@ -291,12 +292,37 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
|
||||
if (checks != null)
|
||||
{
|
||||
if (checks.CheckMan.Equals(Const.CheckControl_Complete))
|
||||
if (checks.CheckMan.Equals(Const.CheckFine_Complete))
|
||||
{
|
||||
Alert.ShowInTop("记录已审批完成!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.Check_CheckFineApprove approve = BLL.CheckFineApproveService.GetCheckFineApproveByCheckFineId(codes);
|
||||
if (approve != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(approve.ApproveMan))
|
||||
{
|
||||
if (this.CurrUser.UserId == approve.ApproveMan || CurrUser.UserId == Const.sysglyId)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListEdit.aspx?CheckFineId={0}", codes, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您不是当前办理人,无法编辑,请右键查看!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListEdit.aspx?CheckFineId={0}", codes, "编辑 - ")));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -304,6 +330,24 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查看
|
||||
protected void btnMenuView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string codes = Grid1.SelectedRowID.Split(',')[0];
|
||||
var checks = BLL.CheckFineService.CheckFine(codes);
|
||||
|
||||
if (checks != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckFineListView.aspx?CheckFineId={0}", codes, "查看 - ")));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
@@ -320,7 +364,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
string codes = Grid1.SelectedRowID.Split(',')[0];
|
||||
var checks = BLL.CheckFineService.CheckFine(codes);
|
||||
|
||||
BLL.CheckFineApproveService.DeleteCheckFineApprovesByCheckFineId(codes);
|
||||
BLL.CheckFineService.DeleteCheckList(codes);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, checks.DocCode, codes, BLL.Const.CheckListMenuId, "删除质量罚款单记录");
|
||||
Grid1.DataBind();
|
||||
@@ -381,21 +425,6 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
//}
|
||||
}
|
||||
|
||||
protected void btnMenuView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string codes = Grid1.SelectedRowID.Split(',')[0];
|
||||
var checks = BLL.CheckControlService.GetCheckControl(codes);
|
||||
|
||||
if (checks != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckListView.aspx?CheckFineId={0}", codes, "查看 - ")));
|
||||
}
|
||||
}
|
||||
protected void btnMenuNotice_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
@@ -429,8 +458,8 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
|
||||
if (project != null)
|
||||
{
|
||||
bookmarkProjectName.Text = string.IsNullOrEmpty(project.ShortName) ? project.ProjectName : project.ShortName;
|
||||
|
||||
//bookmarkProjectName.Text = string.IsNullOrEmpty(project.ShortName) ? project.ProjectName : project.ShortName;
|
||||
bookmarkProjectName.Text = project.ProjectName;
|
||||
}
|
||||
}
|
||||
if (bookmarkProjectCode != null)
|
||||
@@ -473,14 +502,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
bookmarkWorkArea.Text = unitWork.UnitWorkCode + "-" + unitWork.UnitWorkName;
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
|
||||
if (bookmarkCheckDate != null)
|
||||
{
|
||||
if (checkControl.CheckDate.HasValue)
|
||||
{
|
||||
bookmarkCheckDate.Text = checkControl.CheckDate.Value.ToString("yyyy年MM月dd日");
|
||||
}
|
||||
}
|
||||
|
||||
Bookmark bookmarkFine = doc.Range.Bookmarks["Fine"];
|
||||
if (bookmarkFine != null)
|
||||
{
|
||||
@@ -531,129 +553,189 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
bookmarkCheckMan.Text = user.UserName;
|
||||
}
|
||||
}
|
||||
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(checkControl.CheckFineId, BLL.Const.CheckFineListMenuId);
|
||||
|
||||
if (sourlist != null && sourlist.Count > 0)
|
||||
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
|
||||
if (bookmarkCheckDate != null)
|
||||
{
|
||||
int indexPic = 1;
|
||||
string AttachUrl = "";
|
||||
foreach (var item in sourlist)
|
||||
if (checkControl.CheckDate.HasValue)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
{
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
||||
|
||||
}
|
||||
|
||||
bookmarkCheckDate.Text = checkControl.CheckDate.Value.ToString("yyyy年MM月dd日");
|
||||
}
|
||||
string[] pics = AttachUrl.Split(',');
|
||||
foreach (string item in pics)
|
||||
}
|
||||
Model.Check_CheckFineApprove approve1 = BLL.CheckFineApproveService.GetAudit1(codes);
|
||||
if (approve1 != null)
|
||||
{
|
||||
Bookmark bookmarkOpinions1 = doc.Range.Bookmarks["Opinions1"];
|
||||
if (bookmarkOpinions1 != null)
|
||||
{
|
||||
switch (indexPic)
|
||||
bookmarkOpinions1.Text = approve1.ApproveIdea;
|
||||
}
|
||||
Bookmark bookmarkApproveMan1 = doc.Range.Bookmarks["ApproveMan1"];
|
||||
if (bookmarkApproveMan1 != null)
|
||||
{
|
||||
var user = UserService.GetUserByUserId(approve1.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic1");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic2");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic3");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic4");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
bookmarkApproveMan1.Text = user.UserName;
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkApproveDate1 = doc.Range.Bookmarks["ApproveDate1"];
|
||||
if (bookmarkApproveDate1 != null)
|
||||
{
|
||||
if (approve1.ApproveDate.HasValue)
|
||||
{
|
||||
bookmarkApproveDate1.Text = approve1.ApproveDate.Value.ToString("yyyy年MM月dd日");
|
||||
}
|
||||
}
|
||||
}
|
||||
Model.Check_CheckFineApprove approve2 = BLL.CheckFineApproveService.GetAudit2(codes);
|
||||
if (approve2 != null)
|
||||
{
|
||||
Bookmark bookmarkOpinions2 = doc.Range.Bookmarks["Opinions2"];
|
||||
if (bookmarkOpinions2 != null)
|
||||
{
|
||||
bookmarkOpinions2.Text = approve2.ApproveIdea;
|
||||
}
|
||||
Bookmark bookmarkApproveMan2 = doc.Range.Bookmarks["ApproveMan2"];
|
||||
if (bookmarkApproveMan2 != null)
|
||||
{
|
||||
var user = UserService.GetUserByUserId(approve2.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
bookmarkApproveMan2.Text = user.UserName;
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkApproveDate2 = doc.Range.Bookmarks["ApproveDate2"];
|
||||
if (bookmarkApproveDate2 != null)
|
||||
{
|
||||
if (approve2.ApproveDate.HasValue)
|
||||
{
|
||||
bookmarkApproveDate2.Text = approve2.ApproveDate.Value.ToString("yyyy年MM月dd日");
|
||||
}
|
||||
}
|
||||
}
|
||||
//IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(checkControl.CheckFineId, BLL.Const.CheckFineListMenuId);
|
||||
|
||||
//if (sourlist != null && sourlist.Count > 0)
|
||||
//{
|
||||
// int indexPic = 1;
|
||||
// string AttachUrl = "";
|
||||
// foreach (var item in sourlist)
|
||||
// {
|
||||
// if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
// {
|
||||
// AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
||||
|
||||
// }
|
||||
|
||||
// }
|
||||
// string[] pics = AttachUrl.Split(',');
|
||||
// foreach (string item in pics)
|
||||
// {
|
||||
// switch (indexPic)
|
||||
// {
|
||||
// case 1:
|
||||
// {
|
||||
// string url = rootPath + item.TrimEnd(',');
|
||||
// //查找书签
|
||||
// DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
// builder.MoveToBookmark("Pic1");
|
||||
// if (!string.IsNullOrEmpty(url))
|
||||
// {
|
||||
// System.Drawing.Size JpgSize;
|
||||
// float Wpx;
|
||||
// float Hpx;
|
||||
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
// double i = 1;
|
||||
// i = JpgSize.Width / 180.0;
|
||||
// if (File.Exists(url))
|
||||
// {
|
||||
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// indexPic++;
|
||||
// }
|
||||
// break;
|
||||
// case 2:
|
||||
// {
|
||||
// string url = rootPath + item.TrimEnd(',');
|
||||
// //查找书签
|
||||
// DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
// builder.MoveToBookmark("Pic2");
|
||||
// if (!string.IsNullOrEmpty(url))
|
||||
// {
|
||||
// System.Drawing.Size JpgSize;
|
||||
// float Wpx;
|
||||
// float Hpx;
|
||||
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
// double i = 1;
|
||||
// i = JpgSize.Width / 180.0;
|
||||
// if (File.Exists(url))
|
||||
// {
|
||||
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// indexPic++;
|
||||
// }
|
||||
// break;
|
||||
// case 3:
|
||||
// {
|
||||
// string url = rootPath + item.TrimEnd(',');
|
||||
// //查找书签
|
||||
// DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
// builder.MoveToBookmark("Pic3");
|
||||
// if (!string.IsNullOrEmpty(url))
|
||||
// {
|
||||
// System.Drawing.Size JpgSize;
|
||||
// float Wpx;
|
||||
// float Hpx;
|
||||
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
// double i = 1;
|
||||
// i = JpgSize.Width / 180.0;
|
||||
// if (File.Exists(url))
|
||||
// {
|
||||
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// indexPic++;
|
||||
// }
|
||||
// break;
|
||||
// case 4:
|
||||
// {
|
||||
// string url = rootPath + item.TrimEnd(',');
|
||||
// //查找书签
|
||||
// DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
// builder.MoveToBookmark("Pic4");
|
||||
// if (!string.IsNullOrEmpty(url))
|
||||
// {
|
||||
// System.Drawing.Size JpgSize;
|
||||
// float Wpx;
|
||||
// float Hpx;
|
||||
// UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
// double i = 1;
|
||||
// i = JpgSize.Width / 180.0;
|
||||
// if (File.Exists(url))
|
||||
// {
|
||||
// builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// indexPic++;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
@@ -992,7 +1074,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
|
||||
|
||||
IList<Model.AttachFile> reSourlist = AttachFileService.GetBeforeFileList(checks.CheckControlCode+"r", BLL.Const.CheckListMenuId);
|
||||
IList<Model.AttachFile> reSourlist = AttachFileService.GetBeforeFileList(checks.CheckControlCode + "r", BLL.Const.CheckListMenuId);
|
||||
|
||||
if (reSourlist != null && reSourlist.Count > 0)
|
||||
{
|
||||
@@ -1169,5 +1251,66 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
txtEndTime.Text = "";
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.CheckFine_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit1)
|
||||
{
|
||||
return "现场质量经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit2)
|
||||
{
|
||||
return "现场经理/施工经理审批";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
//<summary>
|
||||
//获取办理人姓名
|
||||
//</summary>
|
||||
//<param name="state"></param>
|
||||
//<returns></returns>
|
||||
protected string ConvertMan(object CheckFineId)
|
||||
{
|
||||
if (CheckFineId != null)
|
||||
{
|
||||
Model.Check_CheckFineApprove a = BLL.CheckFineApproveService.GetCheckFineApproveByCheckFineId(CheckFineId.ToString());
|
||||
if (a != null)
|
||||
{
|
||||
if (a.ApproveMan != null)
|
||||
{
|
||||
return BLL.UserService.GetUserByUserId(a.ApproveMan).UserName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
-15
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Check {
|
||||
|
||||
|
||||
public partial class CheckFineList
|
||||
{
|
||||
public partial class CheckFineList {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -77,15 +75,6 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitWork;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtStartTime 控件。
|
||||
/// </summary>
|
||||
@@ -141,13 +130,22 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// lbImageUrl 控件。
|
||||
/// labState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbImageUrl;
|
||||
protected global::System.Web.UI.WebControls.Label labState;
|
||||
|
||||
/// <summary>
|
||||
/// lbAuditMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbAuditMan;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
@@ -203,6 +201,15 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuModify;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuView 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuView;
|
||||
|
||||
/// <summary>
|
||||
/// MenuButton1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -79,39 +79,35 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
if (!IsPostBack)
|
||||
{
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false);
|
||||
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, false);
|
||||
|
||||
CheckFineId = Request.Params["CheckFineId"];
|
||||
CheckControlCode = Request.Params["CheckControlCode"];
|
||||
plApprove1.Hidden = true;
|
||||
plApprove2.Hidden = true;
|
||||
rblIsAgree.Hidden = true;
|
||||
rblIsAgree.SelectedValue = "true";
|
||||
if (!string.IsNullOrEmpty(CheckFineId))
|
||||
{
|
||||
this.hdCheckControlCode.Text = CheckFineId;
|
||||
|
||||
Model.Check_CheckFine checkControl = CheckFineService.CheckFine(CheckFineId);
|
||||
txtDocCode.Text = checkControl.DocCode;
|
||||
if (checkControl.Fee.HasValue)
|
||||
{
|
||||
txtCheckSite.Text = checkControl.Fee.Value.ToString("#.##");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(checkControl.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = checkControl.UnitId;
|
||||
}
|
||||
|
||||
if (checkControl.UnitWorkId != null)
|
||||
{
|
||||
this.drpUnitWork.SelectedValue = checkControl.UnitWorkId.ToString();
|
||||
}
|
||||
|
||||
|
||||
this.txtCheckMan.Text = BLL.UserService.GetUserNameByUserId(checkControl.CheckMan);
|
||||
if (checkControl.CheckDate != null)
|
||||
{
|
||||
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkControl.CheckDate);
|
||||
}
|
||||
this.txtQuestionDef.Text = checkControl.QuestionDef;
|
||||
|
||||
var dt = CheckFineApproveService.getListData(CheckFineId);
|
||||
gvApprove.DataSource = dt;
|
||||
gvApprove.DataBind();
|
||||
//设置页面图片附件是否可以编辑
|
||||
if (checkControl.CheckMan==CurrUser.UserId)
|
||||
if (checkControl.CheckMan == CurrUser.UserId)
|
||||
{
|
||||
QuestionImg = 0;
|
||||
|
||||
@@ -125,14 +121,71 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
btnSaveAndDownLoad.Hidden = true;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(checkControl.State))
|
||||
{
|
||||
State = checkControl.State;
|
||||
}
|
||||
else
|
||||
{
|
||||
State = BLL.Const.CheckFine_Compile;
|
||||
this.rblIsAgree.Visible = false;
|
||||
}
|
||||
if (State != BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
//Funs.Bind(drpHandleType, CheckControlService.GetDHandleTypeByState(State));
|
||||
CheckFineService.Init(drpHandleType, State, false);
|
||||
}
|
||||
if (State == BLL.Const.CheckFine_Compile || State == BLL.Const.CheckFine_ReCompile)
|
||||
{
|
||||
this.rblIsAgree.Visible = false;
|
||||
this.plApprove1.Hidden = true;
|
||||
UserService.InitUserDropDownList(drpHandleMan, CurrUser.LoginProjectId, true, string.Empty);
|
||||
//this.drpHandleMan.SelectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.plApprove1.Hidden = false;
|
||||
UserService.InitUserDropDownList(drpHandleMan, CurrUser.LoginProjectId, true, string.Empty);
|
||||
this.rblIsAgree.Visible = true;
|
||||
|
||||
}
|
||||
if (State == BLL.Const.CheckFine_Audit1 || State == BLL.Const.CheckFine_Audit2)
|
||||
{
|
||||
this.txtProjectName.Enabled = false;
|
||||
this.txtDocCode.Enabled = false;
|
||||
this.drpUnit.Enabled = false;
|
||||
this.txtCheckDate.Enabled = false;
|
||||
this.txtQuestionDef.Enabled = false;
|
||||
this.txtCheckMan.Enabled = false;
|
||||
this.txtCheckDate.Enabled = false;
|
||||
}
|
||||
|
||||
//设置流程上是否有同意不同意
|
||||
if (State == Const.CheckFine_Audit1 || State == Const.CheckFine_Audit2)
|
||||
{
|
||||
rblIsAgree.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
rblIsAgree.Hidden = true;
|
||||
}
|
||||
if (State == BLL.Const.CheckFine_Audit2)
|
||||
{
|
||||
this.drpHandleMan.Enabled = false;
|
||||
}
|
||||
if (State != BLL.Const.CheckFine_Compile)
|
||||
{
|
||||
plApprove2.Hidden = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtDocCode.Text = "";
|
||||
State = Const.CheckControl_Compile;
|
||||
|
||||
txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); ;
|
||||
State = Const.CheckFine_Compile;
|
||||
UserService.InitUserDropDownList(drpHandleMan, CurrUser.LoginProjectId, true, string.Empty);
|
||||
CheckFineService.Init(drpHandleType, State, false);
|
||||
txtCheckMan.Text = this.CurrUser.UserName;
|
||||
txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
|
||||
QuestionImg = 0;
|
||||
string code = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "-QC-CD-XJ-";
|
||||
@@ -145,19 +198,15 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
this.drpUnit.SelectedValue = checkControl.UnitId;
|
||||
}
|
||||
|
||||
if (checkControl.UnitWorkId != null)
|
||||
{
|
||||
this.drpUnitWork.SelectedValue = checkControl.UnitWorkId.ToString();
|
||||
}
|
||||
if (checkControl.CheckDate != null)
|
||||
{
|
||||
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkControl.CheckDate);
|
||||
}
|
||||
this.txtQuestionDef.Text = checkControl.QuestionDef;
|
||||
|
||||
this.txtCheckMan.Text = this.CurrUser.UserName;
|
||||
this.hdCheckControlCode.Text = SQLHelper.GetNewID(typeof(Model.Check_CheckFine));
|
||||
|
||||
SaveAttachFile(this.hdCheckControlCode.Text, Const.CheckFineListMenuId, AttachFileService.getFileUrl(checkControl.CheckControlCode));
|
||||
//SaveAttachFile(this.hdCheckControlCode.Text, Const.CheckFineListMenuId, AttachFileService.getFileUrl(checkControl.CheckControlCode));
|
||||
|
||||
}
|
||||
|
||||
@@ -183,6 +232,42 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
APIUpLoadFileService.SaveAttachUrl(toDoItem);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.CheckFine_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit1)
|
||||
{
|
||||
return "现场质量经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit2)
|
||||
{
|
||||
return "现场经理/施工经理审批";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
protected void imgBtnFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -202,6 +287,27 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (BLL.CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.CheckFineListMenuId, BLL.Const.BtnSave))
|
||||
{
|
||||
if (this.drpHandleMan.SelectedValue == BLL.Const._Null && this.drpHandleType.SelectedValue != BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
Alert.ShowInTop("请选择办理人员!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
SavePauseNotice("submit");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -249,7 +355,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
}
|
||||
if (bookmarkProjectCode != null)
|
||||
{
|
||||
if (project != null)
|
||||
if (project != null)
|
||||
{
|
||||
bookmarkProjectCode.Text = project.ProjectCode;
|
||||
|
||||
@@ -340,7 +446,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
if (bookmarkCheckMan != null)
|
||||
{
|
||||
var user = UserService.GetUserByUserId(checkControl.CheckMan);
|
||||
if (user!=null)
|
||||
if (user != null)
|
||||
{
|
||||
bookmarkCheckMan.Text = user.UserName;
|
||||
}
|
||||
@@ -517,36 +623,77 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
checkControl.UnitId = this.drpUnit.SelectedValue;
|
||||
}
|
||||
|
||||
if (this.drpUnitWork.SelectedValue != Const._Null)
|
||||
{
|
||||
checkControl.UnitWorkId = drpUnitWork.SelectedValue;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtCheckSite.Text))
|
||||
{
|
||||
checkControl.Fee = decimal.Parse(this.txtCheckSite.Text.Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtCheckDate.Text.Trim()))
|
||||
{
|
||||
checkControl.CheckDate = Convert.ToDateTime(this.txtCheckDate.Text.Trim());
|
||||
}
|
||||
checkControl.QuestionDef = this.txtQuestionDef.Text.Trim();
|
||||
if (saveType == "submit")
|
||||
{
|
||||
checkControl.State = drpHandleType.SelectedValue.Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Check_CheckFine checkControl1 = BLL.CheckFineService.CheckFine(CheckControlCode);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (checkControl1 != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(checkControl1.State))
|
||||
{
|
||||
checkControl.State = BLL.Const.CheckFine_Compile;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkControl.State = checkControl1.State;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
checkControl.State = BLL.Const.CheckFine_Compile;
|
||||
}
|
||||
}
|
||||
string initPath = "FileUpload\\" + BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectCode + "\\Check\\CheckControl\\";
|
||||
if (!string.IsNullOrEmpty(CheckFineId))
|
||||
{
|
||||
checkControl.CheckFineId = CheckFineId;
|
||||
|
||||
Model.Check_CheckFineApprove approve1 = BLL.CheckFineApproveService.GetCheckFineApproveByCheckFineId(CheckFineId);
|
||||
if (approve1 != null && saveType == "submit")
|
||||
{
|
||||
approve1.ApproveDate = DateTime.Now;
|
||||
approve1.ApproveIdea = txtOpinions.Text.Trim();
|
||||
approve1.IsAgree = Convert.ToBoolean(this.rblIsAgree.SelectedValue);
|
||||
BLL.CheckFineApproveService.UpdateCheckFineApprove(approve1);
|
||||
}
|
||||
if (saveType == "submit")
|
||||
{
|
||||
checkControl.SaveHandleMan = null;
|
||||
Model.Check_CheckFineApprove approve = new Model.Check_CheckFineApprove();
|
||||
approve.CheckFineId = CheckFineId;
|
||||
if (this.drpHandleMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
approve.ApproveMan = this.drpHandleMan.SelectedValue;
|
||||
}
|
||||
approve.ApproveType = this.drpHandleType.SelectedValue;
|
||||
if (this.drpHandleType.SelectedValue == BLL.Const.CheckControl_Complete)
|
||||
{
|
||||
approve.ApproveDate = DateTime.Now.AddMinutes(1);
|
||||
}
|
||||
BLL.CheckFineApproveService.AddCheckFineApprove(approve);
|
||||
//APICommonService.SendSubscribeMessage(approve.ApproveMan, "质量巡检问题待办理", this.CurrUser.UserName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now));
|
||||
}
|
||||
if (saveType == "save")
|
||||
{
|
||||
checkControl.SaveHandleMan = this.drpHandleMan.SelectedValue;
|
||||
}
|
||||
BLL.CheckFineService.UpdateCheckControl(checkControl);
|
||||
}
|
||||
else
|
||||
{
|
||||
checkControl.CheckMan = this.CurrUser.UserId;
|
||||
|
||||
if (saveType == "save")
|
||||
{
|
||||
checkControl.SaveHandleMan = this.drpHandleMan.SelectedValue;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.hdCheckControlCode.Text))
|
||||
{
|
||||
checkControl.CheckFineId = this.hdCheckControlCode.Text;
|
||||
@@ -556,13 +703,103 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
checkControl.CheckFineId = SQLHelper.GetNewID(typeof(Model.Check_CheckFine));
|
||||
}
|
||||
BLL.CheckFineService.AddCheckFine(checkControl);
|
||||
if (saveType == "submit")
|
||||
{
|
||||
Model.Check_CheckFineApprove approve1 = new Model.Check_CheckFineApprove();
|
||||
approve1.CheckFineId = checkControl.CheckFineId;
|
||||
approve1.ApproveDate = DateTime.Now;
|
||||
approve1.ApproveMan = this.CurrUser.UserId;
|
||||
approve1.ApproveType = BLL.Const.CheckFine_Compile;
|
||||
BLL.CheckFineApproveService.AddCheckFineApprove(approve1);
|
||||
|
||||
Model.Check_CheckFineApprove approve = new Model.Check_CheckFineApprove();
|
||||
approve.CheckFineId = checkControl.CheckFineId;
|
||||
if (this.drpHandleMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
approve.ApproveMan = this.drpHandleMan.SelectedValue;
|
||||
}
|
||||
approve.ApproveType = this.drpHandleType.SelectedValue;
|
||||
|
||||
BLL.CheckFineApproveService.AddCheckFineApprove(approve);
|
||||
//APICommonService.SendSubscribeMessage(approve.ApproveMan, "质量巡检问题待办理", this.CurrUser.UserName, string.Format("{0:yyyy-MM-dd HH:mm:ss}", DateTime.Now));
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Check_CheckFineApprove approve1 = new Model.Check_CheckFineApprove();
|
||||
approve1.CheckFineId = checkControl.CheckFineId;
|
||||
approve1.ApproveMan = this.CurrUser.UserId;
|
||||
approve1.ApproveType = BLL.Const.CheckFine_Compile;
|
||||
BLL.CheckFineApproveService.AddCheckFineApprove(approve1);
|
||||
}
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, checkControl.DocCode, CheckFineId, BLL.Const.CheckListMenuId, "编辑质量罚款记录");
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void rblIsAgree_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
drpHandleType.Items.Clear();
|
||||
CheckFineService.Init(drpHandleType, State, false);
|
||||
string res = null;
|
||||
List<string> list = new List<string>();
|
||||
list.Add(Const.CheckFine_ReCompile);
|
||||
var count = drpHandleType.Items.Count;
|
||||
List<ListItem> listitem = new List<ListItem>();
|
||||
if (rblIsAgree.SelectedValue.Equals("true"))
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
res = drpHandleType.Items[i].Value;
|
||||
if (list.Contains(res))
|
||||
{
|
||||
var item = (drpHandleType.Items[i]);
|
||||
listitem.Add(item);
|
||||
}
|
||||
}
|
||||
if (listitem.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < listitem.Count; i++)
|
||||
{
|
||||
drpHandleType.Items.Remove(listitem[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
|
||||
res = drpHandleType.Items[i].Value;
|
||||
if (!list.Contains(res))
|
||||
{
|
||||
var item = drpHandleType.Items[i];
|
||||
listitem.Add(item);
|
||||
}
|
||||
}
|
||||
if (listitem.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < listitem.Count; i++)
|
||||
{
|
||||
drpHandleType.Items.Remove(listitem[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (count > 0)
|
||||
{
|
||||
drpHandleType.SelectedIndex = 0;
|
||||
if (this.drpHandleType.SelectedValue == BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
this.drpHandleMan.Enabled = false;
|
||||
this.drpHandleMan.SelectedValue = BLL.Const._Null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpHandleMan.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+105
-17
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Check {
|
||||
|
||||
|
||||
public partial class CheckFineListEdit
|
||||
{
|
||||
public partial class CheckFineListEdit {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -78,22 +76,22 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitWork 控件。
|
||||
/// txtQuestionDef 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitWork;
|
||||
protected global::FineUIPro.TextArea txtQuestionDef;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckSite 控件。
|
||||
/// txtCheckMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtCheckSite;
|
||||
protected global::FineUIPro.TextBox txtCheckMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckDate 控件。
|
||||
@@ -104,15 +102,6 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCheckDate;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuestionDef 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtQuestionDef;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
@@ -131,6 +120,96 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel5;
|
||||
|
||||
/// <summary>
|
||||
/// Form5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form5;
|
||||
|
||||
/// <summary>
|
||||
/// rblIsAgree 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsAgree;
|
||||
|
||||
/// <summary>
|
||||
/// drpHandleType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpHandleType;
|
||||
|
||||
/// <summary>
|
||||
/// drpHandleMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// plApprove1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow plApprove1;
|
||||
|
||||
/// <summary>
|
||||
/// txtOpinions 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtOpinions;
|
||||
|
||||
/// <summary>
|
||||
/// plApprove2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow plApprove2;
|
||||
|
||||
/// <summary>
|
||||
/// gvApprove 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid gvApprove;
|
||||
|
||||
/// <summary>
|
||||
/// lbtype 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbtype;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
@@ -167,6 +246,15 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveAndDownLoad 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckFineListView.aspx.cs" Inherits="FineUIPro.Web.CQMS.Check.CheckFineListView" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>质量罚款单</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.labcenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.f-grid-row.red {
|
||||
background-color: #FF7575;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.fontred {
|
||||
color: #FF7575;
|
||||
background-image: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProjectName" runat="server" Readonly="true" Label="项目名称" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtDocCode" runat="server" Required="true" ShowRedStar="true" Label="文件编号" LabelAlign="Right" Readonly="true"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" ShowRedStar="true" runat="server" Required="true" Label="被罚单位" LabelAlign="Right" Readonly="true" EmptyText="--请选择--" AutoSelectFirstItem="false" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtQuestionDef" ShowRedStar="true" Required="true" runat="server" Label="处罚金额及理由" MaxLength="500" Readonly="true">
|
||||
</f:TextArea>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCheckMan" runat="server" Readonly="true" Label="提出人" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtCheckDate" ShowRedStar="true" runat="server" Label="罚款时间" Required="true" LabelAlign="Right" Readonly="true"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ID="plApprove2">
|
||||
<Items>
|
||||
|
||||
<f:ContentPanel Title="质量罚款单审批列表" ShowBorder="true"
|
||||
BodyPadding="10px" EnableCollapse="true" ShowHeader="true" AutoScroll="true"
|
||||
runat="server">
|
||||
<f:Grid ID="gvApprove" IsFluid="true" CssClass="blockpanel" ShowBorder="true" ShowHeader="false" runat="server" EnableCollapse="false"
|
||||
DataKeyNames="CheckFineApproveId" EnableColumnLines="true" ForceFit="true">
|
||||
<Columns>
|
||||
<f:RowNumberField Width="20px" />
|
||||
<f:TemplateField ColumnID="State" Width="250px" HeaderText="办理类型" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbtype" runat="server" Text='<%# ConvertState(Eval("ApproveType")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField Width="180px" DataField="ApproveMan" HeaderTextAlign="Center" HeaderText="办理人员" TextAlign="Center" />
|
||||
<f:BoundField Width="200px" DataField="ApproveDate" HeaderTextAlign="Center" TextAlign="Center" DataFormatString="{0:yyyy-MM-dd}" HeaderText="办理时间" />
|
||||
<f:BoundField Width="180px" DataField="ApproveIdea" HeaderTextAlign="Center" TextAlign="Center" HeaderText="办理意见" />
|
||||
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:HiddenField ID="hdCheckControlCode" runat="server"></f:HiddenField>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSaveAndDownLoad" OnClick="btnDown_Click" EnableAjax="false" DisableControlBeforePostBack="false" Icon="SystemSave" runat="server" ToolTip="下载通知单" Text="下载通知单" Hidden="true">
|
||||
</f:Button>
|
||||
<%-- <f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" OnClick="btnClose_Click" runat="server" Icon="SystemClose">
|
||||
</f:Button>--%>
|
||||
<f:HiddenField ID="hdId" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:HiddenField ID="hdAttachUrl" runat="server">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="编辑检查项明细" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true"
|
||||
Width="1100px" Height="520px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" EnablePostBack="true"
|
||||
Icon="Pencil" runat="server" Text="">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="确定删除当前数据?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script>
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['CheckItemType']);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,425 @@
|
||||
using Apache.NMS.ActiveMQ.Threads;
|
||||
using Aspose.Words;
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
public partial class CheckFineListView : PageBase
|
||||
{
|
||||
#region 公共字段
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string CheckFineId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["CheckFineId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["CheckFineId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string CheckControlCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["CheckControlCode"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["CheckControlCode"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 办理类型
|
||||
/// </summary>
|
||||
public string State
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["State"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["State"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false);
|
||||
|
||||
CheckFineId = Request.Params["CheckFineId"];
|
||||
if (!string.IsNullOrEmpty(CheckFineId))
|
||||
{
|
||||
this.hdCheckControlCode.Text = CheckFineId;
|
||||
|
||||
Model.Check_CheckFine checkControl = CheckFineService.CheckFine(CheckFineId);
|
||||
txtDocCode.Text = checkControl.DocCode;
|
||||
if (!string.IsNullOrEmpty(checkControl.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = checkControl.UnitId;
|
||||
}
|
||||
|
||||
this.txtCheckMan.Text = BLL.UserService.GetUserNameByUserId(checkControl.CheckMan);
|
||||
if (checkControl.CheckDate != null)
|
||||
{
|
||||
this.txtCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkControl.CheckDate);
|
||||
}
|
||||
this.txtQuestionDef.Text = checkControl.QuestionDef;
|
||||
var dt = CheckFineApproveService.getListData(CheckFineId);
|
||||
gvApprove.DataSource = dt;
|
||||
gvApprove.DataBind();
|
||||
}
|
||||
|
||||
txtProjectName.Text = ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName;
|
||||
//是否同意触发
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把状态转换代号为文字形式
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertState(object state)
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
if (state.ToString() == BLL.Const.CheckFine_ReCompile)
|
||||
{
|
||||
return "重新编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Compile)
|
||||
{
|
||||
return "编制";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit1)
|
||||
{
|
||||
return "现场质量经理审核";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Audit2)
|
||||
{
|
||||
return "现场经理/施工经理审批";
|
||||
}
|
||||
else if (state.ToString() == BLL.Const.CheckFine_Complete)
|
||||
{
|
||||
return "审批完成";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存并下载通知单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDown_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (BLL.CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.CheckFineListMenuId, BLL.Const.BtnSave))
|
||||
{
|
||||
Model.Check_CheckFine checkControl = CheckFineService.CheckFine(this.hdCheckControlCode.Text);
|
||||
|
||||
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initTemplatePath = string.Empty;
|
||||
string uploadfilepath = string.Empty;
|
||||
string newUrl = string.Empty;
|
||||
|
||||
initTemplatePath = Const.CheckFineTemplateUrl;
|
||||
uploadfilepath = rootPath + initTemplatePath;
|
||||
newUrl = uploadfilepath.Replace(".doc", checkControl.DocCode + ".doc");
|
||||
if (File.Exists(newUrl))
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
Document doc = new Aspose.Words.Document(newUrl);
|
||||
Bookmark bookmarkProjectName = doc.Range.Bookmarks["ProjectName"];
|
||||
Bookmark bookmarkProjectCode = doc.Range.Bookmarks["ProjectCode"];
|
||||
var project = ProjectService.GetProjectByProjectId(checkControl.ProjectId);
|
||||
if (bookmarkProjectName != null)
|
||||
{
|
||||
|
||||
if (project != null)
|
||||
{
|
||||
bookmarkProjectName.Text = string.IsNullOrEmpty(project.ShortName) ? project.ProjectName : project.ShortName;
|
||||
|
||||
}
|
||||
}
|
||||
if (bookmarkProjectCode != null)
|
||||
{
|
||||
if (project != null)
|
||||
{
|
||||
bookmarkProjectCode.Text = project.ProjectCode;
|
||||
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkFileNum2 = doc.Range.Bookmarks["FileNum2"];
|
||||
if (bookmarkFileNum2 != null)
|
||||
{
|
||||
bookmarkFileNum2.Text = checkControl.DocCode;
|
||||
}
|
||||
Bookmark bookmarkFileNum = doc.Range.Bookmarks["FileNum"];
|
||||
if (bookmarkFileNum != null)
|
||||
{
|
||||
bookmarkFileNum.Text = checkControl.DocCode;
|
||||
}
|
||||
|
||||
|
||||
Bookmark bookmarkUnit = doc.Range.Bookmarks["Unit"];
|
||||
if (bookmarkUnit != null)
|
||||
{
|
||||
var unit = UnitService.GetUnitByUnitId(checkControl.UnitId);
|
||||
if (unit != null)
|
||||
{
|
||||
bookmarkUnit.Text = unit.UnitName;
|
||||
}
|
||||
}
|
||||
|
||||
Bookmark bookmarkWorkArea = doc.Range.Bookmarks["WorkArea"];
|
||||
if (bookmarkWorkArea != null)
|
||||
{
|
||||
string option = "";
|
||||
var unitWork = UnitWorkService.GetUnitWorkByUnitWorkId(checkControl.UnitWorkId);
|
||||
if (unitWork != null)
|
||||
{
|
||||
bookmarkWorkArea.Text = unitWork.UnitWorkCode + "-" + unitWork.UnitWorkName;
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkCheckDate = doc.Range.Bookmarks["CheckDate"];
|
||||
if (bookmarkCheckDate != null)
|
||||
{
|
||||
if (checkControl.CheckDate.HasValue)
|
||||
{
|
||||
bookmarkCheckDate.Text = checkControl.CheckDate.Value.ToString("yyyy年MM月dd日");
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkFine = doc.Range.Bookmarks["Fine"];
|
||||
if (bookmarkFine != null)
|
||||
{
|
||||
if (checkControl.Fee.HasValue)
|
||||
{
|
||||
bookmarkFine.Text = checkControl.Fee.Value.ToString("##.##");
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkFine2 = doc.Range.Bookmarks["Fine2"];
|
||||
if (bookmarkFine2 != null)
|
||||
{
|
||||
if (checkControl.Fee.HasValue)
|
||||
{
|
||||
bookmarkFine2.Text = checkControl.Fee.Value.ToString("##");
|
||||
}
|
||||
}
|
||||
|
||||
Bookmark bookmarkQuestionDef = doc.Range.Bookmarks["QuestionDef"];
|
||||
if (bookmarkQuestionDef != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkControl.QuestionDef))
|
||||
{
|
||||
bookmarkQuestionDef.Text = checkControl.QuestionDef;
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkFine3 = doc.Range.Bookmarks["Fine3"];
|
||||
if (bookmarkFine3 != null)
|
||||
{
|
||||
if (checkControl.Fee.HasValue)
|
||||
{
|
||||
bookmarkFine3.Text = checkControl.Fee.Value.ToString("##.##");
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkFine4 = doc.Range.Bookmarks["Fine4"];
|
||||
if (bookmarkFine4 != null)
|
||||
{
|
||||
if (checkControl.Fee.HasValue)
|
||||
{
|
||||
bookmarkFine4.Text = checkControl.Fee.Value.ToString("##");
|
||||
}
|
||||
}
|
||||
Bookmark bookmarkCheckMan = doc.Range.Bookmarks["CheckMan"];
|
||||
if (bookmarkCheckMan != null)
|
||||
{
|
||||
var user = UserService.GetUserByUserId(checkControl.CheckMan);
|
||||
if (user != null)
|
||||
{
|
||||
bookmarkCheckMan.Text = user.UserName;
|
||||
}
|
||||
}
|
||||
IList<Model.AttachFile> sourlist = AttachFileService.GetBeforeFileList(checkControl.CheckFineId, BLL.Const.CheckFineListMenuId);
|
||||
|
||||
if (sourlist != null && sourlist.Count > 0)
|
||||
{
|
||||
int indexPic = 1;
|
||||
string AttachUrl = "";
|
||||
foreach (var item in sourlist)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
{
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
string[] pics = AttachUrl.Split(',');
|
||||
foreach (string item in pics)
|
||||
{
|
||||
switch (indexPic)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic1");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic2");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic3");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
string url = rootPath + item.TrimEnd(',');
|
||||
//查找书签
|
||||
DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("Pic4");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(url, out JpgSize, out Wpx, out Hpx);
|
||||
double i = 1;
|
||||
i = JpgSize.Width / 180.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
builder.InsertImage(url, JpgSize.Width / i, JpgSize.Height / i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
indexPic++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
doc.Save(newUrl);
|
||||
|
||||
|
||||
|
||||
|
||||
Document doc1 = new Aspose.Words.Document(newUrl);
|
||||
//验证参数
|
||||
if (doc1 == null) { throw new Exception("Word文件无效"); }
|
||||
string fileName = Path.GetFileName(newUrl);
|
||||
FileInfo info = new FileInfo(newUrl);
|
||||
long fileSize = info.Length;
|
||||
Response.Clear();
|
||||
Response.ContentType = "application/x-zip-compressed";
|
||||
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
|
||||
Response.AddHeader("Content-Length", fileSize.ToString());
|
||||
Response.TransmitFile(newUrl, 0, fileSize);
|
||||
Response.Flush();
|
||||
Response.Close();
|
||||
File.Delete(newUrl);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Check {
|
||||
|
||||
|
||||
public partial class CheckFineListView {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// txtProjectName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtProjectName;
|
||||
|
||||
/// <summary>
|
||||
/// txtDocCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtDocCode;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuestionDef 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtQuestionDef;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCheckMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCheckDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCheckDate;
|
||||
|
||||
/// <summary>
|
||||
/// plApprove2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FormRow plApprove2;
|
||||
|
||||
/// <summary>
|
||||
/// gvApprove 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid gvApprove;
|
||||
|
||||
/// <summary>
|
||||
/// lbtype 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbtype;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// hdCheckControlCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdCheckControlCode;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSaveAndDownLoad 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSaveAndDownLoad;
|
||||
|
||||
/// <summary>
|
||||
/// hdId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdId;
|
||||
|
||||
/// <summary>
|
||||
/// hdAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>质量罚款单</title>
|
||||
<title>质量罚款单</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.labcenter {
|
||||
@@ -35,63 +35,122 @@
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProjectName" runat="server" Readonly="true" Label="项目名称" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtDocCode" runat="server" Required="true" ShowRedStar="true" Label="文件编号" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" ShowRedStar="true" runat="server" Required="true" Label="责任单位" LabelAlign="Right" EmptyText="--请选择--" AutoSelectFirstItem="false" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpUnitWork" ShowRedStar="true" runat="server" Required="true" EmptyText="--请选择--" AutoSelectFirstItem="false" Label="检查区域" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtProjectName" runat="server" Readonly="true" Label="项目名称" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtDocCode" runat="server" Required="true" ShowRedStar="true" Label="文件编号" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" ShowRedStar="true" runat="server" Required="true" Label="被罚单位" LabelAlign="Right" EmptyText="--请选择--" AutoSelectFirstItem="false" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtQuestionDef" ShowRedStar="true" Required="true" runat="server" Label="处罚金额及理由" MaxLength="500">
|
||||
</f:TextArea>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtCheckSite" runat="server" NoDecimal="false" NoNegative="true" DecimalPrecision="2" Required="true" ShowRedStar="true" Increment="100" Label="罚款金额"
|
||||
MaxLength="50">
|
||||
</f:NumberBox>
|
||||
<f:DatePicker ID="txtCheckDate" ShowRedStar="true" runat="server" Label="巡检时间" Required="true" LabelAlign="Right"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtCheckMan" runat="server" Readonly="true" Label="提出人" LabelAlign="Right"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:DatePicker ID="txtCheckDate" ShowRedStar="true" runat="server" Label="罚款时间" Required="true" LabelAlign="Right"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtQuestionDef" ShowRedStar="true" Required="true" runat="server" Label="问题描述" MaxLength="3000">
|
||||
</f:TextArea>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow >
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" ShowHeader="false" ShowBorder="false" Layout="Column" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" Text="问题图片:" CssStyle="padding-left:25px" Width="110px" CssClass="marginr" ShowLabel="false"></f:Label>
|
||||
<f:Button ID="imgBtnFile" Text="问题图片" ToolTip="上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:FormRow Hidden="true">
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" ShowHeader="false" ShowBorder="false" Layout="Column" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" Text="问题图片:" CssStyle="padding-left:25px" Width="110px" CssClass="marginr" ShowLabel="false"></f:Label>
|
||||
<f:Button ID="imgBtnFile" Text="问题图片" ToolTip="上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="imgBtnFile_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel5" Title="质量罚款单审批流程设置" runat="server" ShowHeader="true" EnableCollapse="true"
|
||||
BodyPadding="0px">
|
||||
<f:Form ID="Form5" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:RadioButtonList runat="server" ID="rblIsAgree" Label="是否同意" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="rblIsAgree_SelectedIndexChanged">
|
||||
<f:RadioItem Text="同意" Value="true" />
|
||||
<f:RadioItem Text="不同意" Value="false" />
|
||||
</f:RadioButtonList>
|
||||
<f:Label runat="server" CssStyle="display:none"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpHandleType" runat="server" Label="办理步骤" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpHandleMan" runat="server" Label="办理人员" Required="true" LabelAlign="Right" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ID="plApprove1">
|
||||
<Items>
|
||||
<f:TextArea ID="txtOpinions" runat="server" Label="我的意见" MaxLength="200">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ID="plApprove2">
|
||||
<Items>
|
||||
|
||||
<f:ContentPanel Title="质量罚款单审批列表" ShowBorder="true"
|
||||
BodyPadding="10px" EnableCollapse="true" ShowHeader="true" AutoScroll="true"
|
||||
runat="server">
|
||||
<f:Grid ID="gvApprove" IsFluid="true" CssClass="blockpanel" ShowBorder="true" ShowHeader="false" runat="server" EnableCollapse="false"
|
||||
DataKeyNames="CheckFineApproveId" EnableColumnLines="true" ForceFit="true">
|
||||
<Columns>
|
||||
<f:RowNumberField Width="20px" />
|
||||
<f:TemplateField ColumnID="State" Width="250px" HeaderText="办理类型" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbtype" runat="server" Text='<%# ConvertState(Eval("ApproveType")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField Width="180px" DataField="ApproveMan" HeaderTextAlign="Center" HeaderText="办理人员" TextAlign="Center" />
|
||||
<f:BoundField Width="200px" DataField="ApproveDate" HeaderTextAlign="Center" TextAlign="Center" DataFormatString="{0:yyyy-MM-dd}" HeaderText="办理时间" />
|
||||
<f:BoundField Width="180px" DataField="ApproveIdea" HeaderTextAlign="Center" TextAlign="Center" HeaderText="办理意见" />
|
||||
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
@@ -102,9 +161,11 @@
|
||||
<f:HiddenField ID="hdCheckControlCode" runat="server"></f:HiddenField>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server" ToolTip="保存" Text="保存">
|
||||
<f:Button ID="btnSave" OnClick="btnSave_Click" Icon="SystemSave" runat="server" ToolTip="保存" Text="保存">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSaveAndDownLoad" OnClick="btnDown_Click" EnableAjax="false" DisableControlBeforePostBack="false" Icon="SystemSave" runat="server" ToolTip="下载通知单" Text="下载通知单">
|
||||
<f:Button ID="btnSubmit" OnClick="btnSubmit_Click" Icon="SystemSaveNew" runat="server" ToolTip="提交" Text="提交" ValidateForms="SimpleForm1">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSaveAndDownLoad" OnClick="btnDown_Click" EnableAjax="false" DisableControlBeforePostBack="false" Icon="SystemSave" runat="server" ToolTip="下载通知单" Text="下载通知单" Hidden="true">
|
||||
</f:Button>
|
||||
<%-- <f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" OnClick="btnClose_Click" runat="server" Icon="SystemClose">
|
||||
</f:Button>--%>
|
||||
@@ -121,7 +182,7 @@
|
||||
Width="1100px" Height="520px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{ if(!string.IsNullOrEmpty(item.AttachUrl)&& item.AttachUrl.ToLower().EndsWith(".jpg")|| item.AttachUrl.ToLower().EndsWith(".jpeg")|| item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',')+",";
|
||||
}
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(','));
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], AttachUrl.TrimEnd(','));
|
||||
}
|
||||
}
|
||||
return url;
|
||||
@@ -306,7 +306,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
if (!string.IsNullOrEmpty(item.AttachUrl) && item.AttachUrl.ToLower().EndsWith(".jpg") || item.AttachUrl.ToLower().EndsWith(".jpeg") || item.AttachUrl.ToLower().EndsWith(".png"))
|
||||
AttachUrl += item.AttachUrl.TrimEnd(',') + ",";
|
||||
}
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["CEMS_IMG_URL"], AttachUrl.TrimEnd(','));
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], AttachUrl.TrimEnd(','));
|
||||
}
|
||||
}
|
||||
return url;
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<asp:DropDownList ID="drpHandleMan" runat="server" Height="22" Width="90%">
|
||||
</asp:DropDownList>
|
||||
<asp:HiddenField ID="hdHandleMan" runat="server" Value='<%# Bind("HandleMan") %>' />
|
||||
|
||||
<asp:HiddenField ID="hdSaveHandleMan" runat="server" Value='<%# Bind("SaveHandleMan") %>' />
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
|
||||
@@ -293,8 +293,8 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
detail.State = handleType.SelectedValue;
|
||||
}
|
||||
|
||||
|
||||
System.Web.UI.WebControls.DropDownList drpHandleMan = (System.Web.UI.WebControls.DropDownList)(Grid1.Rows[i].FindControl("drpHandleMan"));
|
||||
detail.SaveHandleMan = drpHandleMan.SelectedValue;
|
||||
}
|
||||
BindData2();
|
||||
}
|
||||
@@ -534,6 +534,7 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
System.Web.UI.WebControls.DropDownList handtype = (System.Web.UI.WebControls.DropDownList)(row.FindControl("drpHandleType"));
|
||||
System.Web.UI.WebControls.DropDownList handman = (System.Web.UI.WebControls.DropDownList)(row.FindControl("drpHandleMan"));
|
||||
System.Web.UI.WebControls.HiddenField lblHandleMan = (System.Web.UI.WebControls.HiddenField)(row.FindControl("hdHandleMan"));
|
||||
System.Web.UI.WebControls.HiddenField lblSaveHandleMan = (System.Web.UI.WebControls.HiddenField)(row.FindControl("hdSaveHandleMan"));
|
||||
System.Web.UI.WebControls.HiddenField lblsite = (System.Web.UI.WebControls.HiddenField)(row.FindControl("hdState"));
|
||||
Model.Check_JointCheckDetail detail = JointCheckDetailService.GetJointCheckDetailByJointCheckDetailId(Grid1.Rows[i].RowID);
|
||||
handtype.Items.AddRange(JointCheckService.GetDHandleTypeByState(detail.State));
|
||||
@@ -577,6 +578,10 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
handman.Enabled = false;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(lblSaveHandleMan.Value))
|
||||
{
|
||||
handman.SelectedValue = lblSaveHandleMan.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -219,6 +219,15 @@ namespace FineUIPro.Web.CQMS.Check {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hdHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// hdSaveHandleMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hdSaveHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtOpinions 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -103,14 +103,21 @@
|
||||
<f:RenderField Width="110px" ColumnID="QuestionDef" DataField="QuestionDef"
|
||||
FieldType="String" HeaderText="问题描述" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField HeaderText="问题图片" ConfirmTarget="Top" Width="80" CommandName="attchUrl" ColumnID="AttchUrl"
|
||||
TextAlign="Center" ToolTip="问题图片" Text="问题图片" />
|
||||
|
||||
<f:TemplateField ColumnID="tfImageUrl1" Width="120px" HeaderText="问题图片" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImageUrl" runat="server" Text='<%# ConvertImageUrlByImage(Eval("JointCheckDetailId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="110px" ColumnID="HandleWay" DataField="HandleWay"
|
||||
FieldType="String" HeaderText="整改方案" TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField HeaderText="整改照片" ConfirmTarget="Top" Width="80" CommandName="ReAttachUrl" ColumnID="ReAttachUrl"
|
||||
TextAlign="Center" ToolTip="整改照片" Text="整改照片" />
|
||||
<f:TemplateField ColumnID="tfImageUrl2" Width="120px" HeaderText="整改照片" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImgUrl" runat="server" Text='<%# ConvertImgUrlByImage(Eval("JointCheckDetailId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="110px" HeaderText="审批状态" HeaderTextAlign="Center" ColumnID="lbState"
|
||||
TextAlign="Center" SortField="DetectionType">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -216,6 +217,44 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取整改前图片(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="registrationId"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImageUrlByImage(object JointCheckDetailId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (JointCheckDetailId != null)
|
||||
{
|
||||
var attUrl = BLL.AttachFileService.getFileUrl(JointCheckDetailId.ToString());
|
||||
if (!string.IsNullOrEmpty(attUrl))
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], attUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取整改后图片(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="registrationId"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImgUrlByImage(object JointCheckDetailId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (JointCheckDetailId != null)
|
||||
{
|
||||
var attUrl = BLL.AttachFileService.getFileUrl(JointCheckDetailId.ToString() + "r");
|
||||
if (!string.IsNullOrEmpty(attUrl))
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage(ConfigurationManager.AppSettings["SGGLUrl"], attUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string itemId = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
@@ -313,15 +352,24 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
if (column.ColumnID != "AttchUrl" && column.ColumnID != "ReAttachUrl")
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
if (column.ColumnID == "tfImageUrl1" || column.ColumnID == "tfImageUrl2")
|
||||
{
|
||||
sb.AppendFormat("<td style='width:240px;'>{0}</td>", column.HeaderText);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
bool b = false;
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
b = false;
|
||||
if (column.ColumnID != "AttchUrl" && column.ColumnID != "ReAttachUrl")
|
||||
{
|
||||
string html = row.Values[column.ColumnIndex].ToString();
|
||||
@@ -333,8 +381,24 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
html = (row.FindControl("lbState") as AspNet.Label).Text;
|
||||
}
|
||||
//sb.AppendFormat("<td>{0}</td>", html);
|
||||
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{0}</td>", html);
|
||||
if (column.ColumnID == "tfImageUrl1")
|
||||
{
|
||||
b = true;
|
||||
html = (row.FindControl("lbImageUrl") as AspNet.Label).Text;
|
||||
}
|
||||
if (column.ColumnID == "tfImageUrl2")
|
||||
{
|
||||
b = true;
|
||||
html = (row.FindControl("lbImgUrl") as AspNet.Label).Text;
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
sb.AppendFormat("<td style='width:240px;'>{0}</td>", html);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Check
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Check {
|
||||
|
||||
|
||||
public partial class JointCheckStatistics
|
||||
{
|
||||
public partial class JointCheckStatistics {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -176,6 +174,24 @@ namespace FineUIPro.Web.CQMS.Check
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// lbImageUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbImageUrl;
|
||||
|
||||
/// <summary>
|
||||
/// lbImgUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbImgUrl;
|
||||
|
||||
/// <summary>
|
||||
/// lbState 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -85,8 +85,11 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
this.drpUnitWorkIds.SelectedValueArray = inspectionPerson.UnitWorkId.Split(',');
|
||||
}
|
||||
this.txtRemark.Text = inspectionPerson.Remark;
|
||||
|
||||
|
||||
var approve = InspectionPersonApproveService.GetApprove2(inspectionPerson.InspectionPersonId);
|
||||
if (approve != null)
|
||||
{
|
||||
this.drpAudit.SelectedValue = approve.ApproveMan;
|
||||
}
|
||||
var currApprove = InspectionPersonApproveService.GetCurrentApprove(inspectionPerson.InspectionPersonId);
|
||||
if (currApprove != null)
|
||||
{ //重新编制 编制人 可以 显示 提交 保存按钮
|
||||
|
||||
@@ -85,8 +85,9 @@
|
||||
<f:Grid ID="gvFile5" Hidden="true" ShowBorder="true" ShowHeader="false" EnableCollapse="true" Title="开工报告"
|
||||
runat="server" BoxFlex="1" DataKeyNames="StartWorkReportId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="StartWorkReportId" AllowSorting="true" SortField="FileCode"
|
||||
SortDirection="ASC" OnSort="gvFile5_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="gvFile5_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="gvFile5_RowDoubleClick" EnableTextSelection="true" OnRowCommand="gvFile5_RowCommand">
|
||||
SortDirection="ASC" OnSort="gvFile5_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="15"
|
||||
OnPageIndexChange="gvFile5_PageIndexChange" EnableRowDoubleClickEvent ="true"
|
||||
OnRowDoubleClick="gvFile5_RowDoubleClick" EnableTextSelection="true" OnRowCommand="gvFile5_RowCommand">
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfPageIndex" Width="50px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
bordercolor="#bcd2e7" bordercolordark="#bcd2e7" bordercolorlight="#bcd2e7">
|
||||
<tr>
|
||||
<td align="center" style="width: 24%;" rowspan="2">
|
||||
<img alt="" src="../../Images/Logo.jpg" />
|
||||
<img alt="" src="../../Images/Logo.jpg" width="300px"/>
|
||||
</td>
|
||||
<td align="center" style="width: 46%; height: 30px; vertical-align: middle; font-size: 12pt;">
|
||||
<asp:Label ID="lblProjectName" runat="server"></asp:Label>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<tr>
|
||||
<td rowspan="2" align="center" style="width: 24%; height: 75px; border: 1px solid #000000;
|
||||
border-right: none">
|
||||
<img alt="" src="../../Images/Logo.jpg" />
|
||||
<img alt="" src="../../Images/Logo.jpg" width="300px"/>
|
||||
</td>
|
||||
<td style="width: 44%; height: 30px; vertical-align: middle; border: 1px solid #000000;
|
||||
border-right: none; text-align: center;">
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
bordercolor="#bcd2e7" bordercolordark="#bcd2e7" bordercolorlight="#bcd2e7">
|
||||
<tr>
|
||||
<td align="center" style="width: 24%;" rowspan="2">
|
||||
<img alt="" src="../../Images/Logo.jpg" />
|
||||
<img alt="" src="../../Images/Logo.jpg" width="300px"/>
|
||||
</td>
|
||||
<td align="center" style="width: 46%; height: 30px; vertical-align: middle; font-size: 12pt;">
|
||||
<asp:Label ID="lblProjectName" runat="server"></asp:Label>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<tr>
|
||||
<td rowspan="2" align="center" style="width: 24%; height: 75px; border: 1px solid #000000;
|
||||
border-right: none">
|
||||
<img alt="" src="../../Images/Logo.jpg" />
|
||||
<img alt="" src="../../Images/Logo.jpg" width="300px" />
|
||||
</td>
|
||||
<td style="width: 44%; height: 30px; vertical-align: middle; border: 1px solid #000000;
|
||||
border-right: none; text-align: center;">
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpCNProfessional" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true" LabelWidth="110px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpState" runat="server" Label="状态" LabelAlign="Right" LabelWidth="110px">
|
||||
<f:ListItem Text="编制" Value="1" />
|
||||
<f:ListItem Text="待审批" Value="2" />
|
||||
<f:ListItem Text="审批完成" Value="3" />
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" Label="验收日期" ID="txtStarTime" LabelAlign="Right"
|
||||
LabelWidth="100px" Width="220px">
|
||||
</f:DatePicker>
|
||||
@@ -81,6 +86,13 @@
|
||||
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField ColumnID="UserName" Width="55px" HeaderText="确认人" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# ConvertUserName(Eval("InspectionId")) %>'></asp:Label>
|
||||
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:WindowField TextAlign="Center" Width="80px" WindowID="WindowAtt"
|
||||
Text="审批列表" ToolTip="审批列表" DataIFrameUrlFields="InspectionId" DataIFrameUrlFormatString="./InspectionManagementApproveList.aspx?InspectionId={0}"/>
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
GetButtonPower();
|
||||
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业
|
||||
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
|
||||
Funs.FineUIPleaseSelect(this.drpState);
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
@@ -46,7 +47,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
BP.Class,
|
||||
P.AcceptanceSite,
|
||||
P.AcceptanceCheckMan,
|
||||
(CASE WHEN IsOnceQualified='True' THEN '是' ELSE '否' END)AS IsOnceQualified,
|
||||
(CASE WHEN IsOnceQualified=1 THEN '是' ELSE '否' END) AS IsOnceQualified,
|
||||
P.InspectionCode,
|
||||
P.InspectionDate"
|
||||
+ @" FROM ProcessControl_InspectionManagementDetail AS D"
|
||||
@@ -73,6 +74,23 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
|
||||
}
|
||||
if (drpState.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
if (drpState.SelectedValue == BLL.Const.InspectionManagement_Compile)
|
||||
{
|
||||
strSql += " AND (select top 1 ApproveType from ProcessControl_InspectionManagementApprove ap where ap.InspectionId=P.InspectionId and ap.ApproveType!='S' order by ap.ApproveDate desc) is null";
|
||||
}
|
||||
else if(drpState.SelectedValue == BLL.Const.InspectionManagement_Audit)
|
||||
{
|
||||
strSql += " AND (select top 1 ApproveType from ProcessControl_InspectionManagementApprove ap where ap.InspectionId=P.InspectionId and ap.ApproveType!='S' and ap.ApproveDate is null order by ap.ApproveDate desc)=@Sta";
|
||||
listStr.Add(new SqlParameter("@Sta", drpState.SelectedValue));
|
||||
}
|
||||
else if (drpState.SelectedValue == BLL.Const.InspectionManagement_Complete)
|
||||
{
|
||||
strSql += " AND (select top 1 ApproveType from ProcessControl_InspectionManagementApprove ap where ap.InspectionId=P.InspectionId and ap.ApproveType!='S' and ap.ApproveDate is not null order by ap.ApproveDate desc)=@Sta";
|
||||
listStr.Add(new SqlParameter("@Sta", drpState.SelectedValue));
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND P.InspectionDate >= @InspectionDate";
|
||||
@@ -244,7 +262,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
if (state != null)
|
||||
{
|
||||
var res = InspectionManagementApproveService.GetState(state.ToString());
|
||||
var res = InspectionManagementApproveService.GetState(state.ToString());
|
||||
if (res != null)
|
||||
{
|
||||
if (res.ApproveType == BLL.Const.InspectionManagement_ReCompile)
|
||||
@@ -268,6 +286,22 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
return "编制";
|
||||
}
|
||||
|
||||
|
||||
public static string ConvertUserName(object InspectionId)
|
||||
{
|
||||
string userName = string.Empty;
|
||||
if (InspectionId != null)
|
||||
{
|
||||
var approve = Funs.DB.ProcessControl_InspectionManagementApprove.FirstOrDefault(x => x.InspectionId == InspectionId.ToString() && x.ApproveType == BLL.Const.InspectionManagement_Audit);
|
||||
if (approve != null)
|
||||
{
|
||||
var user = BLL.UserService.GetUserByUserId(approve.ApproveMan);
|
||||
if (user != null)
|
||||
{
|
||||
userName = user.UserName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
-4
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.ProcessControl {
|
||||
|
||||
|
||||
public partial class InspectionManagement
|
||||
{
|
||||
public partial class InspectionManagement {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -77,6 +75,15 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCNProfessional;
|
||||
|
||||
/// <summary>
|
||||
/// drpState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpState;
|
||||
|
||||
/// <summary>
|
||||
/// txtStarTime 控件。
|
||||
/// </summary>
|
||||
@@ -131,6 +138,15 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label3;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DatePicker ID="txtInspectionDate" runat="server" Label="验收日期" LabelAlign="Right" ></f:DatePicker>
|
||||
<f:DatePicker ID="txtInspectionDate" runat="server" Label="验收日期" LabelAlign="Right" ShowRedStar="true" Required="true"></f:DatePicker>
|
||||
<f:TextArea ID="txtUnqualifiedReason" runat="server" Label="不合格原因" LabelAlign="Right" MaxLength="1000" Hidden="true"></f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
@@ -235,7 +235,6 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
inspectionManagement.CompileMan2 = oldInspectionManagement.CompileMan2;
|
||||
|
||||
}
|
||||
inspectionManagement.IsOnceQualified = oldInspectionManagement.IsOnceQualified;
|
||||
inspectionManagement.InspectionId = this.hdInspectionNoticeId.Text.Trim();
|
||||
|
||||
BLL.InspectionManagementService.UpdateInspectionManagement(inspectionManagement);
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
<f:DropDownList ID="drpUnitWork" runat="server" Label="单位工程名称" LabelAlign="Right" LabelWidth="110px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpCNProfessional" runat="server" Label="专业" LabelAlign="Right" LabelWidth="110px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpState" runat="server" Label="状态" LabelAlign="Right" LabelWidth="110px">
|
||||
<f:ListItem Text="待确认" Value="2" />
|
||||
<f:ListItem Text="已确认" Value="3" />
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" runat="server" OnClick="btnNew_Click" ToolTip="增加" Hidden="true">
|
||||
@@ -77,6 +81,9 @@
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# ConvertState(Eval("Status")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="UserName" DataField="UserName" FieldType="String" HeaderText="确认人" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="100px">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
@@ -97,7 +104,7 @@
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="控制点通知单" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
|
||||
Width="900px" Height="500px">
|
||||
Width="900px" Height="550px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
GetButtonPower();
|
||||
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);//专业
|
||||
UnitWorkService.InitUnitWorkDownList(drpUnitWork, this.CurrUser.LoginProjectId, true);
|
||||
Funs.FineUIPleaseSelect(this.drpState);
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
@@ -46,6 +47,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
BP.Class,
|
||||
P.AcceptanceSite,
|
||||
P.AcceptanceCheckMan,
|
||||
us.UserName,
|
||||
case when P.IsOnceQualified = 1 then '是' else '否' end as IsOnceQualified,
|
||||
P.Status"
|
||||
+ @" FROM ProcessControl_InspectionManagementDetail AS D"
|
||||
@@ -55,6 +57,7 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
+ @" LEFT JOIN WBS_UnitWork AS UnitWork ON UnitWork.UnitWorkId = P.UnitWorkId"
|
||||
+ @" LEFT JOIN WBS_DivisionProject AS DP ON DP.DivisionProjectId = P.Branch"
|
||||
+ @" LEFT JOIN WBS_BreakdownProject AS BP ON BP.BreakdownProjectId = P.ControlPointType"
|
||||
+ @" LEFT JOIN Sys_User AS us ON us.UserId = P.AuditMan"
|
||||
+ @" WHERE P.ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
@@ -72,6 +75,11 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
strSql += " AND P.CNProfessionalId=@CNProfessionalId";
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessional.SelectedValue));
|
||||
}
|
||||
if (drpState.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND P.Status=@Status";
|
||||
listStr.Add(new SqlParameter("@Status", drpState.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
{
|
||||
strSql += " AND P.InspectionDate >= @InspectionDate";
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.ProcessControl {
|
||||
|
||||
|
||||
public partial class InspectionNotice
|
||||
{
|
||||
public partial class InspectionNotice {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -77,6 +75,15 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCNProfessional;
|
||||
|
||||
/// <summary>
|
||||
/// drpState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpState;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -198,6 +198,11 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
Alert.ShowInTop("请先选择专业!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.Grid1.Rows.Count == 0)
|
||||
{
|
||||
Alert.ShowInTop("请先选择共检内容!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.ProcessControl_InspectionManagement inspectionManagement = new Model.ProcessControl_InspectionManagement();
|
||||
inspectionManagement.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
@@ -309,6 +314,11 @@ namespace FineUIPro.Web.CQMS.ProcessControl
|
||||
Alert.ShowInTop("请先选择专业!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.Grid1.Rows.Count == 0)
|
||||
{
|
||||
Alert.ShowInTop("请先选择共检内容!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.ProcessControl_InspectionManagement inspectionManagement = new Model.ProcessControl_InspectionManagement();
|
||||
inspectionManagement.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (drpWorkArea.SelectedValue !=BLL.Const._Null)
|
||||
|
||||
@@ -838,6 +838,7 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
if (CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.UserId, Const.CQMSConstructSolutionMenuId, Const.BtnDelete))
|
||||
{
|
||||
var constructSolution = CQMSConstructSolutionService.GetConstructSolutionByConstructSolutionId(id);
|
||||
HSSEConstructSolutionService.DeleteConstructSolutionByCQMSConstructSolutionId(id);
|
||||
CQMSConstructSolutionApproveService.DeleteConstructSolutionApprovesByConstructSolutionId(id);
|
||||
CQMSConstructSolutionService.DeleteConstructSolution(id);
|
||||
LogService.AddSys_Log(CurrUser, constructSolution.Code, id, Const.CQMSConstructSolutionMenuId, "删除方案审查");
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Solution
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Solution {
|
||||
|
||||
|
||||
public partial class ConstructSolution
|
||||
{
|
||||
public partial class ConstructSolution {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
<f:Label runat="server" Text="<span style='color:red;'>*</span>附件(当前选中版本):" EncodeText="false" ShowRedStar="true" Label="附件:" CssStyle="padding-left:48px" Width="240px" CssClass="marginr" ShowLabel="false" ></f:Label>
|
||||
<f:Button ID="imgBtnFile" Text="附件" ToolTip="上传及查看" Icon="TableCell" OnClick="imgBtnFile_Click" runat="server"></f:Button>
|
||||
|
||||
<f:CheckBox runat="server" ID="cbIsHSSE" Label="安全施工方案" LabelAlign="Right" LabelWidth="120px"></f:CheckBox>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
|
||||
@@ -73,6 +73,10 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
txtUnitWork.Text = UnitWorkService.GetUnitWorkName(constructSolution.UnitWorkIds);
|
||||
|
||||
}
|
||||
if (constructSolution.IsHSSE == true)
|
||||
{
|
||||
this.cbIsHSSE.Checked = true;
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(constructSolution.CNProfessionalCodes))
|
||||
{
|
||||
txtCNProfessional.Text = CQMSConstructSolutionService.GetProfessionalName(constructSolution.CNProfessionalCodes);
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Solution
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Solution {
|
||||
|
||||
|
||||
public partial class ConstructSolutionView
|
||||
{
|
||||
public partial class ConstructSolutionView {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -167,6 +165,15 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// cbIsHSSE 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBox cbIsHSSE;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<f:Label runat="server" Text="<span style='color:red;'>*</span>附件(当前选中版本):" EncodeText="false" ShowRedStar="true" Label="附件:" CssStyle="padding-left:48px" Width="240px" CssClass="marginr" ShowLabel="false"></f:Label>
|
||||
<f:Button ID="imgBtnFile" Text="附件" ToolTip="上传及查看" Icon="TableCell" OnClick="imgBtnFile_Click" runat="server"></f:Button>
|
||||
<f:Button ID="imgBtnFile2" Hidden="true" Text="上版附件" ToolTip="上传及查看" Icon="TableCell" OnClick="imgBtnFile_Click2" CssStyle="margin-left:20px" runat="server"></f:Button>
|
||||
|
||||
<f:CheckBox runat="server" ID="cbIsHSSE" Label="安全施工方案" LabelAlign="Right" LabelWidth="120px"></f:CheckBox>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
|
||||
@@ -174,6 +174,10 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
txtCNProfessional.Values = constructSolution.CNProfessionalCodes.Split(',');
|
||||
}
|
||||
}
|
||||
if (constructSolution.IsHSSE == true)
|
||||
{
|
||||
this.cbIsHSSE.Checked = true;
|
||||
}
|
||||
if (constructSolution.Edition != null)
|
||||
{
|
||||
drpEdition.Items.Clear();
|
||||
@@ -556,6 +560,7 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
constructSolution.SpecialSchemeTypeId = drpSpecialType.SelectedValue;
|
||||
}
|
||||
constructSolution.SolutionName = txtSolutionName.Text.Trim();
|
||||
constructSolution.IsHSSE = this.cbIsHSSE.Checked;
|
||||
int edtion = Convert.ToInt32(this.drpEdition.SelectedValue);
|
||||
constructSolution.Edition = edtion;
|
||||
if (!string.IsNullOrEmpty(txtCompileDate.Text.Trim()))
|
||||
@@ -827,7 +832,7 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
constructSolution.IsHSSE = cbIsHSSE.Checked;
|
||||
constructSolution.CompileMan = CurrUser.UserId;
|
||||
constructSolution.Edition = Convert.ToInt32(this.drpEdition.SelectedValue);
|
||||
if (!string.IsNullOrEmpty(HFConstructSolutionId.Text))
|
||||
|
||||
@@ -7,12 +7,10 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Solution
|
||||
{
|
||||
namespace FineUIPro.Web.CQMS.Solution {
|
||||
|
||||
|
||||
public partial class EditConstructSolution
|
||||
{
|
||||
public partial class EditConstructSolution {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
@@ -185,6 +183,15 @@ namespace FineUIPro.Web.CQMS.Solution
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button imgBtnFile2;
|
||||
|
||||
/// <summary>
|
||||
/// cbIsHSSE 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBox cbIsHSSE;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -110,35 +110,32 @@
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="Code" DataField="Code" Width="80px"
|
||||
SortField="Code" FieldType="String" HeaderText="文件编号" TextAlign="Center"
|
||||
SortField="Code" FieldType="String" HeaderText="文件编号" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField ColumnID="UnitName" DataField="UnitName" Width="160px"
|
||||
SortField="ProposedUnit" FieldType="String" HeaderText="提出单位" TextAlign="Center"
|
||||
<f:RenderField ColumnID="UnitName" DataField="UnitName" Width="150px"
|
||||
SortField="ProposedUnit" FieldType="String" HeaderText="提出单位" TextAlign="Left"
|
||||
HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField ColumnID="MainSendUnitIds" Width="200px" DataField="MainSendUnitIds"
|
||||
SortField="MainSendUnitIds" FieldType="String" HeaderText="主送单位" TextAlign="Center"
|
||||
<f:RenderField ColumnID="MainSendUnitIds" Width="150px" DataField="MainSendUnitIds"
|
||||
SortField="MainSendUnitIds" FieldType="String" HeaderText="主送单位" TextAlign="Left"
|
||||
HeaderTextAlign="Center" >
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField ColumnID="CCUnitIds" Width="160px" DataField="CCUnitIds"
|
||||
SortField="CCUnitIds" FieldType="String" HeaderText="抄送单位" TextAlign="Center"
|
||||
<f:RenderField ColumnID="CCUnitIds" Width="150px" DataField="CCUnitIds"
|
||||
SortField="CCUnitIds" FieldType="String" HeaderText="抄送单位" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="IsReply" Width="50px" DataField="IsReply"
|
||||
SortField="IsReply" FieldType="String" HeaderText="答复" TextAlign="Center"
|
||||
SortField="IsReply" FieldType="String" HeaderText="答复" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="Cause" Width="70px" DataField="Cause"
|
||||
SortField="Cause" FieldType="String" HeaderText="事由" TextAlign="Center"
|
||||
<f:RenderField ColumnID="Cause" Width="80px" DataField="Cause"
|
||||
SortField="Cause" FieldType="String" HeaderText="事由" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="编制日期" TextAlign="Center" HeaderTextAlign="Center">
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="编制日期"
|
||||
TextAlign="Center" HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="70px" ColumnID="userName" DataField="userName" SortField="userName"
|
||||
FieldType="String" HeaderText="发起人" TextAlign="Center" HeaderTextAlign="Center">
|
||||
@@ -155,7 +152,6 @@
|
||||
<asp:Label ID="Label41" runat="server" Text='<%# BLL.WorkContactService.ConvertMan(Eval("WorkContactId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
||||
@@ -136,6 +136,42 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newBreakdown.BreakdownId = this.BreakdownId;
|
||||
}
|
||||
BLL.BreakdownService.AddBreakdown(newBreakdown);
|
||||
//增加项目单位工程记录
|
||||
var projects = BLL.ProjectService.GetProjectWorkList();
|
||||
foreach (var project in projects)
|
||||
{
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == project.ProjectId orderby x.UnitWorkCode select x;
|
||||
foreach (var unitWork in unitWorks)
|
||||
{
|
||||
var divisionProject = BLL.DivisionProjectService.GetDivisionProjectByUnitWorkIdAndOldDivisionId(unitWork.UnitWorkId, divisionId);
|
||||
if (divisionProject != null)
|
||||
{
|
||||
Model.WBS_BreakdownProject bp = new Model.WBS_BreakdownProject();
|
||||
bp.BreakdownProjectId = SQLHelper.GetNewID(typeof(Model.WBS_BreakdownProject));
|
||||
bp.ProjectId = project.ProjectId;
|
||||
bp.BreakdownCode = newBreakdown.BreakdownCode;
|
||||
bp.BreakdownName = newBreakdown.BreakdownName;
|
||||
bp.DivisionProjectId = divisionProject.DivisionProjectId;
|
||||
bp.Basis = newBreakdown.Basis;
|
||||
bp.CheckPoints = newBreakdown.CheckPoints;
|
||||
bp.RecordAndCode = newBreakdown.RecordAndCode;
|
||||
bp.Class = newBreakdown.Class;
|
||||
bp.SortIndex = newBreakdown.SortIndex;
|
||||
bp.Remark = newBreakdown.Remark;
|
||||
bp.ModelURL = newBreakdown.ModelURL;
|
||||
bp.UnitWorkId = unitWork.UnitWorkId;
|
||||
bp.IsAcceptance = newBreakdown.IsAcceptance;
|
||||
bp.IsYellow = newBreakdown.IsYellow;
|
||||
bp.WuHuan = newBreakdown.WuHuan;
|
||||
bp.JianLi = newBreakdown.JianLi;
|
||||
bp.FenBao = newBreakdown.FenBao;
|
||||
bp.YeZhu = newBreakdown.YeZhu;
|
||||
bp.SourceBreakdownId = newBreakdown.BreakdownId;
|
||||
|
||||
BLL.BreakdownProjectService.AddBreakdownProject(bp);
|
||||
}
|
||||
}
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newBreakdown.BreakdownCode, newBreakdown.BreakdownId, BLL.Const.ControlPointMenuId, "添加分项工程信息!");
|
||||
}
|
||||
if (Request.Params["type"] == "modify")
|
||||
|
||||
@@ -102,6 +102,51 @@ namespace FineUIPro.Web.CQMS.WBS
|
||||
newDivision.SuperDivisionId = selectedCode;
|
||||
}
|
||||
BLL.DivisionService.AddDivision(newDivision);
|
||||
//增加项目单位工程记录
|
||||
var projects = BLL.ProjectService.GetProjectWorkList();
|
||||
foreach (var project in projects)
|
||||
{
|
||||
var unitWorks = from x in Funs.DB.WBS_UnitWork where x.ProjectId == project.ProjectId orderby x.UnitWorkCode select x;
|
||||
foreach (var unitWork in unitWorks)
|
||||
{
|
||||
Model.WBS_DivisionProject newDivisionProject = new Model.WBS_DivisionProject();
|
||||
newDivisionProject.DivisionCode = this.txtDivisionCode.Text.Trim();
|
||||
newDivisionProject.DivisionName = this.txtDivisionName.Text.Trim();
|
||||
newDivisionProject.UnitWorkId = unitWork.UnitWorkId;
|
||||
if (!string.IsNullOrEmpty(this.txtSortIndex.Text.Trim()))
|
||||
{
|
||||
try
|
||||
{
|
||||
newDivisionProject.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
ShowNotify("排序只能为整数!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSortIndex.Text.Trim()))
|
||||
{
|
||||
newDivisionProject.SortIndex = Convert.ToInt32(this.txtSortIndex.Text.Trim());
|
||||
}
|
||||
newDivisionProject.DivisionProjectId = SQLHelper.GetNewID(typeof(Model.WBS_DivisionProject));
|
||||
if (cNProfessional != null) //专业节点增加分部
|
||||
{
|
||||
newDivisionProject.CNProfessionalId = selectedCode;
|
||||
}
|
||||
if (divisionProject != null) //分部节点增加子分部
|
||||
{
|
||||
var dp = BLL.DivisionProjectService.GetDivisionProjectByUnitWorkIdAndOldDivisionId(unitWork.UnitWorkId, selectedCode);
|
||||
if (dp != null)
|
||||
{
|
||||
newDivisionProject.SuperDivisionId = dp.DivisionProjectId;
|
||||
}
|
||||
}
|
||||
newDivisionProject.ProjectId = project.ProjectId;
|
||||
newDivisionProject.OldDivisionId = newDivision.DivisionId;
|
||||
BLL.DivisionProjectService.AddDivisionProject(newDivisionProject);
|
||||
}
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newDivision.DivisionCode, newKeyID, BLL.Const.ProjectControlPointMenuId, "添加分部或子分部工程信息!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(newKeyID) + ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Zlglgd.aspx.cs" Inherits="FineUIPro.Web.CQMS.ZLCH.Zlglgd" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="质量管理规定/程序文件" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="FileId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
ClicksToEdit="2" DataIDField="FileId" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtFileName" runat="server" LabelAlign="Right" EmptyText="按名称查询" Width="280px" NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:Button ID="btnSearch" Icon="SystemSearch" runat="server" Size="Medium" CssClass="marginr" OnClick="btnSearch_Click" />
|
||||
<f:ToolbarFill ID="ToolbarFill2" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="增加" Text="增加" Icon="Add" OnClick="btnAdd_Click" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="修改" Text="修改" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" ToolTip="删除" Text="删除" Icon="Delete" ConfirmText="确定要删除数据吗?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField Width="50px" TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="350px" ColumnID="FileName" DataField="FileName" FieldType="String" HeaderText="名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="UploadManName" DataField="UploadManName" FieldType="String" HeaderText="编制人" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="UploadDate" DataField="UploadDate" FieldType="Date" Renderer="Date" HeaderText="上传日期" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="450px" ColumnID="Remark" DataField="Remark"
|
||||
FieldType="String" HeaderText="备注" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:TemplateField HeaderText="附件查看" Width="250px" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtnUrl1" runat="server" CommandArgument='<%# Bind("AttachUrl") %>'
|
||||
ToolTip="Attach Download" EnableAjax="false" Height="20px"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
<f:Window ID="Window1" Title="页面编辑" Hidden="true" EnableIFrame="true" EnableMaximize="false"
|
||||
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="900px"
|
||||
Height="420px" OnClose="Window1_Close">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,150 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.ZLCH
|
||||
{
|
||||
public partial class Zlglgd : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
BindGrid();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT t.FileId,
|
||||
t.FileName,
|
||||
t.UploadMan,
|
||||
t.UploadDate,
|
||||
t.Remark,
|
||||
t.AttachUrl,
|
||||
U.UserName AS UploadManName
|
||||
FROM dbo.Common_FileManager AS t
|
||||
LEFT JOIN dbo.Sys_User AS U ON U.UserId = t.UploadMan
|
||||
WHERE ToMenu='32' ";
|
||||
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(txtFileName.Text))
|
||||
{
|
||||
strSql += " AND t.FileName like @FileName";
|
||||
listStr.Add(new SqlParameter("@FileName", "%" + this.txtFileName.Text.Trim() + "%"));
|
||||
}
|
||||
strSql += " ORDER BY t.UploadDate DESC";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
for (int i = 0; i < Grid1.Rows.Count; i++)
|
||||
{
|
||||
System.Web.UI.WebControls.LinkButton lbtnUrl = ((System.Web.UI.WebControls.LinkButton)(this.Grid1.Rows[i].FindControl("lbtnUrl1")));
|
||||
string url = lbtnUrl.CommandArgument.ToString();
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
url = url.Replace('\\', '/');
|
||||
lbtnUrl.Text = BLL.UploadAttachmentService.ShowAttachment2("../../", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ZlglgdEdit.aspx", "增加 - ")));
|
||||
}
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
string rowId = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ZlglgdEdit.aspx?fileId={0}", rowId, "编辑 - ")));
|
||||
}
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var p = BLL.FileManagerService.GetFileById(rowID);
|
||||
if (p != null)
|
||||
{
|
||||
BLL.FileManagerService.DeleteFileById(rowID);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, p.FileName, p.FileId, BLL.Const.ZlglgdMenuId, BLL.Const.BtnDelete);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
|
||||
ShowNotify("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void Grid1_RowDoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
string rowId = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ZlglgdEdit.aspx?fileId={0}", rowId, "编辑 - ")));
|
||||
}
|
||||
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ZlglgdMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user