提交代码
This commit is contained in:
		
							parent
							
								
									16638e5e5e
								
							
						
					
					
						commit
						96b329b814
					
				|  | @ -73,7 +73,7 @@ namespace BLL | ||||||
|                                    join y in db.Project_ProjectUser on x.UserId equals y.UserId |                                    join y in db.Project_ProjectUser on x.UserId equals y.UserId | ||||||
|                                    where y.ProjectId == projectId && (x.UnitId == unitId || unitId == null) |                                    where y.ProjectId == projectId && (x.UnitId == unitId || unitId == null) | ||||||
|                                       && (roleIds == null || roleList.Contains(y.RoleId)) && (strParam == null || x.UserName.Contains(strParam)) |                                       && (roleIds == null || roleList.Contains(y.RoleId)) && (strParam == null || x.UserName.Contains(strParam)) | ||||||
|                                       && y.IsPost ==true |                                       && y.IsPost == true | ||||||
|                                    select new Model.UserItem |                                    select new Model.UserItem | ||||||
|                                    { |                                    { | ||||||
|                                        UserId = x.UserId, |                                        UserId = x.UserId, | ||||||
|  | @ -285,7 +285,7 @@ namespace BLL | ||||||
|                 { |                 { | ||||||
|                     var getDataLists = (from x in db.Sys_User |                     var getDataLists = (from x in db.Sys_User | ||||||
|                                         join y in db.Project_ProjectUser on x.UserId equals y.UserId |                                         join y in db.Project_ProjectUser on x.UserId equals y.UserId | ||||||
|                                         where y.ProjectId == projectId  |                                         where y.ProjectId == projectId | ||||||
|                                         select new Model.UserItem |                                         select new Model.UserItem | ||||||
|                                         { |                                         { | ||||||
|                                             UserId = x.UserId, |                                             UserId = x.UserId, | ||||||
|  | @ -330,5 +330,79 @@ namespace BLL | ||||||
|                 return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.UserName).ToList(); |                 return getDataList.OrderBy(x => x.UnitName).ThenBy(x => x.UserName).ToList(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         //HSSE副经理 | ||||||
|  |         public static string HSSEEngineerf = "e2166a63-23ae-41de-9fbd-63ead785c033"; | ||||||
|  |         //分包商HSE经理 | ||||||
|  |         public static string FbsGcs = "b01b5d82-c0d9-44fc-b3b9-fca91da34d28"; | ||||||
|  |         //分包商HSE工程师 | ||||||
|  |         public static string FbsHseGcs = "9d12f8fa-56a3-4db4-849e-e85e1c21a769"; | ||||||
|  |         /// <summary> | ||||||
|  |         /// 根据受检单位项目id获取参加检查人员(项目HSE经理、HSE工程师、 HSSE副经理、受检单位的分包商HSE经理、分包商HSE工程师) | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="projectId"></param> | ||||||
|  |         /// <param name="unitid"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         public static List<Model.UserItem> getCheckUserByProjectIdAndUnitid(string projectId, string unitid) | ||||||
|  |         { | ||||||
|  |             using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) | ||||||
|  |             { | ||||||
|  |                 //当前项目的项目HSE经理、HSE工程师、 HSSE副经理 | ||||||
|  |                 var getlist1 =(from x in db.Sys_User | ||||||
|  |                               join y in db.Project_ProjectUser on x.UserId equals y.UserId | ||||||
|  |                               where y.ProjectId==projectId &&  | ||||||
|  |                               (y.RoleId.Contains(Const.HSSEManager) || y.RoleId.Contains(Const.HSSEEngineer) | ||||||
|  |                               || y.RoleId.Contains(HSSEEngineerf) | ||||||
|  |                               ) | ||||||
|  |                               select new Model.UserItem | ||||||
|  |                               { | ||||||
|  |                                   UserId = x.UserId, | ||||||
|  |                                   Account = x.Account, | ||||||
|  |                                   UserCode = x.UserCode, | ||||||
|  |                                   Password = x.Password, | ||||||
|  |                                   UserName = x.UserName, | ||||||
|  |                                   RoleId = y.RoleId, | ||||||
|  |                                   RoleName = RoleService.getRoleNamesRoleIds(y.RoleId), | ||||||
|  |                                   UnitId = y.UnitId, | ||||||
|  |                                   UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, | ||||||
|  |                                   LoginProjectId = y.ProjectId, | ||||||
|  |                                   LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName, | ||||||
|  |                                   IdentityCard = x.IdentityCard, | ||||||
|  |                                   Email = x.Email, | ||||||
|  |                                   Telephone = x.Telephone, | ||||||
|  |                                   IsOffice = x.IsOffice, | ||||||
|  |                                   SignatureUrl = x.SignatureUrl.Replace('\\', '/'), | ||||||
|  |                               }).ToList(); | ||||||
|  |                 //受检单位的分包商HSE经理、分包商HSE工程师 | ||||||
|  |                 var getlist2 =(from x in db.Sys_User | ||||||
|  |                               join y in db.Project_ProjectUser on x.UserId equals y.UserId | ||||||
|  |                               where y.ProjectId == projectId && y.UnitId == unitid && | ||||||
|  |                               (y.RoleId.Contains(FbsGcs) || y.RoleId.Contains(FbsHseGcs) | ||||||
|  |                               ) | ||||||
|  |                               select new Model.UserItem | ||||||
|  |                               { | ||||||
|  |                                   UserId = x.UserId, | ||||||
|  |                                   Account = x.Account, | ||||||
|  |                                   UserCode = x.UserCode, | ||||||
|  |                                   Password = x.Password, | ||||||
|  |                                   UserName = x.UserName, | ||||||
|  |                                   RoleId = y.RoleId, | ||||||
|  |                                   RoleName = RoleService.getRoleNamesRoleIds(y.RoleId), | ||||||
|  |                                   UnitId = y.UnitId, | ||||||
|  |                                   UnitName = db.Base_Unit.First(z => z.UnitId == y.UnitId).UnitName, | ||||||
|  |                                   LoginProjectId = y.ProjectId, | ||||||
|  |                                   LoginProjectName = db.Base_Project.First(z => z.ProjectId == y.ProjectId).ProjectName, | ||||||
|  |                                   IdentityCard = x.IdentityCard, | ||||||
|  |                                   Email = x.Email, | ||||||
|  |                                   Telephone = x.Telephone, | ||||||
|  |                                   IsOffice = x.IsOffice, | ||||||
|  |                                   SignatureUrl = x.SignatureUrl.Replace('\\', '/'), | ||||||
|  |                               }).ToList(); | ||||||
|  |                 var getlist = getlist1.Union(getlist2).ToList<Model.UserItem>(); | ||||||
|  |                 return getlist; | ||||||
|  | 
 | ||||||
|  |             } | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -56,7 +56,8 @@ namespace BLL | ||||||
| 
 | 
 | ||||||
|                                       ResponsibleMan = x.ResponsibleMan, |                                       ResponsibleMan = x.ResponsibleMan, | ||||||
|                                       ReceiveMan = x.ReceiveMan, |                                       ReceiveMan = x.ReceiveMan, | ||||||
|                                       ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan) |                                       ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan), | ||||||
|  |                                       AttachUrl2= APIUpLoadFileService.getFileUrl(x.CheckSpecialId+"zgh", null), | ||||||
| 
 | 
 | ||||||
|                                   }; |                                   }; | ||||||
|                     return getInfo.FirstOrDefault(); |                     return getInfo.FirstOrDefault(); | ||||||
|  | @ -98,8 +99,8 @@ namespace BLL | ||||||
| 
 | 
 | ||||||
|                                       ResponsibleMan = x.ResponsibleMan, |                                       ResponsibleMan = x.ResponsibleMan, | ||||||
|                                       ReceiveMan = x.ReceiveMan, |                                       ReceiveMan = x.ReceiveMan, | ||||||
|                                       ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan) |                                       ReceiveManName = UserService.getUserNamesUserIds(x.ReceiveMan), | ||||||
| 
 |                                       AttachUrl2 = APIUpLoadFileService.getFileUrl(x.CheckSpecialId + "zgh", null), | ||||||
|                                   }; |                                   }; | ||||||
|                     return getInfo.FirstOrDefault(); |                     return getInfo.FirstOrDefault(); | ||||||
|                 } |                 } | ||||||
|  | @ -232,7 +233,7 @@ namespace BLL | ||||||
|                     //// 删除专项检查明细项 |                     //// 删除专项检查明细项 | ||||||
|                     Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(newCheckSpecial.CheckSpecialId); |                     Check_CheckSpecialDetailService.DeleteCheckSpecialDetails(newCheckSpecial.CheckSpecialId); | ||||||
|                 }                |                 }                | ||||||
|                 ////保存附件 |                 ////保存附件(提交前附件) | ||||||
|                 if (!string.IsNullOrEmpty(newItem.AttachUrl1)) |                 if (!string.IsNullOrEmpty(newItem.AttachUrl1)) | ||||||
|                 { |                 { | ||||||
|                     UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl1, 10, null), newItem.AttachUrl1, Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId); |                     UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl1, 10, null), newItem.AttachUrl1, Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId); | ||||||
|  | @ -242,6 +243,16 @@ namespace BLL | ||||||
|                     CommonService.DeleteAttachFileById(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId); |                     CommonService.DeleteAttachFileById(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  |                 ////保存附件(整改后附件) | ||||||
|  |                 if (!string.IsNullOrEmpty(newItem.AttachUrl2)) | ||||||
|  |                 { | ||||||
|  |                     UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl2, 10, null), newItem.AttachUrl2, Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId+"zgh"); | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     CommonService.DeleteAttachFileById(Const.ProjectCheckSpecialMenuId, newCheckSpecial.CheckSpecialId + "zgh"); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|                 ///// 新增检查项 |                 ///// 新增检查项 | ||||||
|                 if (newItem.CheckSpecialDetailItems != null && newItem.CheckSpecialDetailItems.Count() > 0) |                 if (newItem.CheckSpecialDetailItems != null && newItem.CheckSpecialDetailItems.Count() > 0) | ||||||
|                 {                       |                 {                       | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ | ||||||
|                                 <f:RadioItem Text="待提交" Value="0" /> |                                 <f:RadioItem Text="待提交" Value="0" /> | ||||||
|                                 <f:RadioItem Text="待整改" Value="1" /> |                                 <f:RadioItem Text="待整改" Value="1" /> | ||||||
|                                 <f:RadioItem Text="待确认" Value="2" /> |                                 <f:RadioItem Text="待确认" Value="2" /> | ||||||
|                                   <f:RadioItem Text="已确认" Value="3" /> |                                   <f:RadioItem Text="已关闭" Value="3" /> | ||||||
|                             </f:RadioButtonList> |                             </f:RadioButtonList> | ||||||
|                             <f:ToolbarSeparator runat="server"></f:ToolbarSeparator> |                             <f:ToolbarSeparator runat="server"></f:ToolbarSeparator> | ||||||
|                              <f:RadioButtonList runat="server" ID="rbType" Width="180px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged"> |                              <f:RadioButtonList runat="server" ID="rbType" Width="180px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged"> | ||||||
|  |  | ||||||
|  | @ -60,7 +60,7 @@ namespace FineUIPro.Web.HSSE.Check | ||||||
|         { |         { | ||||||
|             string strSql = @"SELECT CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode," |             string strSql = @"SELECT CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode," | ||||||
|                           + @" CheckItemSet.CheckItemName,CheckSpecial.CheckTime,(CASE WHEN CheckSpecial.CheckType ='1' THEN '联合检查' ELSE '专项检查' END) AS CheckTypeName" |                           + @" CheckItemSet.CheckItemName,CheckSpecial.CheckTime,(CASE WHEN CheckSpecial.CheckType ='1' THEN '联合检查' ELSE '专项检查' END) AS CheckTypeName" | ||||||
|                           + @" ,(CASE WHEN CheckSpecial.States='2' THEN '待确认' WHEN CheckSpecial.States='3' THEN '已确认' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName" |                           + @" ,(CASE WHEN CheckSpecial.States='2' THEN '待确认' WHEN CheckSpecial.States='3' THEN '已关闭' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName" | ||||||
|                           + @" FROM Check_CheckSpecial AS CheckSpecial " |                           + @" FROM Check_CheckSpecial AS CheckSpecial " | ||||||
|                           + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON CheckSpecial.CheckSpecialId=CodeRecords.DataId " |                           + @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON CheckSpecial.CheckSpecialId=CodeRecords.DataId " | ||||||
|                           + @" LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId = CheckSpecial.CheckItemSetId where 1=1"; |                           + @" LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId = CheckSpecial.CheckItemSetId where 1=1"; | ||||||
|  |  | ||||||
|  | @ -100,9 +100,14 @@ | ||||||
|             <f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server"> |             <f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server"> | ||||||
|                 <Items> |                 <Items> | ||||||
|                     <f:Label runat="server" ID="lbTemp"></f:Label> |                     <f:Label runat="server" ID="lbTemp"></f:Label> | ||||||
|                      <f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click" |                      <f:Button ID="btnAttachUrl" Text="整改前照片" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click" | ||||||
|                         ValidateForms="SimpleForm1"> |                         ValidateForms="SimpleForm1"> | ||||||
|                     </f:Button> |                     </f:Button> | ||||||
|  | 
 | ||||||
|  |                      <f:Button ID="btnAttachUrl2" Text="整改后照片" ToolTip="附件上传及查看" Icon="TableCell" runat="server" OnClick="btnAttachUrl_Click2" | ||||||
|  |                         ValidateForms="SimpleForm1"> | ||||||
|  |                     </f:Button> | ||||||
|  | 
 | ||||||
|                     <f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill> |                     <f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill> | ||||||
|                     <f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose"> |                     <f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose"> | ||||||
|                     </f:Button> |                     </f:Button> | ||||||
|  |  | ||||||
|  | @ -90,6 +90,19 @@ namespace FineUIPro.Web.HSSE.Check | ||||||
|                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&type=-1", this.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId))); |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&type=-1", this.CheckSpecialId, BLL.Const.ProjectCheckSpecialMenuId))); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         /// <summary> | ||||||
|  |         /// 上传附件 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="sender"></param> | ||||||
|  |         /// <param name="e"></param> | ||||||
|  |         protected void btnAttachUrl_Click2(object sender, EventArgs e) | ||||||
|  |         { | ||||||
|  |             if (!string.IsNullOrEmpty(this.CheckSpecialId)) | ||||||
|  |             { | ||||||
|  |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CheckSpecial&menuId={1}&type=-1", this.CheckSpecialId+"zgh", BLL.Const.ProjectCheckSpecialMenuId))); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|         #endregion |         #endregion | ||||||
| 
 | 
 | ||||||
|         /// <summary> |         /// <summary> | ||||||
|  |  | ||||||
|  | @ -158,6 +158,15 @@ namespace FineUIPro.Web.HSSE.Check | ||||||
|         /// </remarks> |         /// </remarks> | ||||||
|         protected global::FineUIPro.Button btnAttachUrl; |         protected global::FineUIPro.Button btnAttachUrl; | ||||||
| 
 | 
 | ||||||
|  |         /// <summary> | ||||||
|  |         /// btnAttachUrl2 控件。 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <remarks> | ||||||
|  |         /// 自动生成的字段。 | ||||||
|  |         /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 | ||||||
|  |         /// </remarks> | ||||||
|  |         protected global::FineUIPro.Button btnAttachUrl2; | ||||||
|  | 
 | ||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// ToolbarFill1 控件。 |         /// ToolbarFill1 控件。 | ||||||
|         /// </summary> |         /// </summary> | ||||||
|  |  | ||||||
|  | @ -246,5 +246,14 @@ namespace Model | ||||||
|         public string ReceiveMan { get; set; } |         public string ReceiveMan { get; set; } | ||||||
| 
 | 
 | ||||||
|         public string ReceiveManName { get; set; } |         public string ReceiveManName { get; set; } | ||||||
|  | 
 | ||||||
|  |         /// <summary> | ||||||
|  |         /// 整改后附件 | ||||||
|  |         /// </summary> | ||||||
|  |         public string AttachUrl2 | ||||||
|  |         { | ||||||
|  |             get; | ||||||
|  |             set; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -455,5 +455,27 @@ namespace WebAPI.Controllers | ||||||
|             return responeData; |             return responeData; | ||||||
|         } |         } | ||||||
|         #endregion |         #endregion | ||||||
|  | 
 | ||||||
|  |         #region 根据受检单位项目id获取参加检查人员 | ||||||
|  |         /// <summary> | ||||||
|  |         /// 根据受检单位项目id获取参加检查人员(项目HSE经理、HSE工程师、 HSSE副经理、受检单位的分包商HSE经理、分包商HSE工程师) | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="projectId"></param> | ||||||
|  |         /// <param name="unitid"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         public Model.ResponeData getCheckUserByProjectIdAndUnitid(string projectId,string unitid) { | ||||||
|  |             var responeData = new Model.ResponeData(); | ||||||
|  |             try | ||||||
|  |             { | ||||||
|  |                 responeData.data = APIUserService.getCheckUserByProjectIdAndUnitid(projectId, unitid); | ||||||
|  |             } | ||||||
|  |             catch (Exception ex) | ||||||
|  |             { | ||||||
|  |                 responeData.code = 0; | ||||||
|  |                 responeData.message = ex.Message; | ||||||
|  |             } | ||||||
|  |             return responeData; | ||||||
|  |         } | ||||||
|  |         #endregion | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue