diff --git a/ReleasePacker2017.bat b/ReleasePacker2017.bat index ed1d0934..ebd60524 100644 --- a/ReleasePacker2017.bat +++ b/ReleasePacker2017.bat @@ -17,8 +17,6 @@ set PUBLISHER_SRC_ROOT=%PROJECT_SRC%\SGGL\FineUIPro.Web REM 源代码版本日志文件夹 set VerLog_SRC_ROOT=%PROJECT_SRC%\database\版本日志 -REM 源代码附件文件夹 -set FileUpload=%PROJECT_SRC%\SGGL\FineUIPro.Web\FileUpload REM 包文件夹名 SET ReleasePack=PackFile @@ -52,15 +50,8 @@ rd %RELEASE_VerLog_ROOT% /S /Q ) mkdir %RELEASE_VerLog_ROOT% - -IF exist %FileUpload%\nul.ext ( -rd %FileUpload% /S /Q -) -mkdir %FileUpload% - IF errorlevel 1 goto delReleasePackError - @echo 设置.net控制台环境 @echo. @call "%VS150%" diff --git a/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs b/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs index 8098537f..d529f336 100644 --- a/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs +++ b/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs @@ -89,11 +89,8 @@ namespace BLL CheckWay = "FACE_FANGSHI", }; - if (SynchroSetService.PushAttendanceS(newR) != "True") - { - db.RealName_PersonInOutNow.InsertOnSubmit(newR); - db.SubmitChanges(); - } + db.RealName_PersonInOutNow.InsertOnSubmit(newR); + db.SubmitChanges(); } } } diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx index c3e160ed..f255e79f 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx @@ -16,19 +16,22 @@ - + - - + - - - + + + <%----%> @@ -184,7 +187,7 @@ - + diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs index 79baa63b..ce3001b3 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.cs @@ -65,7 +65,11 @@ namespace FineUIPro.Web.HSSE.SitePerson persons.Clear(); } errorInfos = string.Empty; - this.ProjectId = Request.Params["ProjectId"]; + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["ProjectId"])) + { + this.ProjectId = Request.Params["ProjectId"]; + } } } #endregion @@ -1134,6 +1138,13 @@ namespace FineUIPro.Web.HSSE.SitePerson getPerson.IsUsed = persons[i].IsUsedName == "鏄" ? true : false; getPerson.IsCardUsed = persons[i].IsCardUsedName == "鏄" ? true : false; getPerson.IsCardNoOK = IDCardValid.CheckIDCard(persons[i].IdentityCard); + if (getPerson.OutTime.HasValue) + { + getPerson.IsUsed = true; + getPerson.ExchangeTime = null; + getPerson.ExchangeTime2 = null; + getPerson.RealNameUpdateTime = null; + } Funs.DB.SubmitChanges(); } } @@ -1314,5 +1325,134 @@ namespace FineUIPro.Web.HSSE.SitePerson { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PersonBaseData.aspx", "鏌ョ湅 - "))); } + + /// + /// 绂诲矖瀵煎叆 + /// + /// + /// + protected void btnOut_Click1(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("璇锋偍閫夋嫨Excel鏂囦欢锛", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + ShowNotify("鍙彲浠ラ夋嫨Excel鏂囦欢锛", MessageBoxIcon.Warning); + return; + } + + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + + string fileName = rootPath + initPath + this.hdFileName.Text; + + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQLout(ds.Tables[0]); + } + catch (Exception ex) + { + throw ex; + } + } + + #region 灏咲ataset鐨勬暟鎹鍏ユ暟鎹簱 + /// + /// 灏咲ataset鐨勬暟鎹鍏ユ暟鎹簱 + /// + /// 鏁版嵁闆 + /// 鏁版嵁闆嗗垪鏁 + /// + private bool AddDatasetToSQLout(DataTable pds) + { + int ic, ir; + persons.Clear(); + ic = pds.Columns.Count; + ir = pds.Rows.Count; + string info = string.Empty; + if (pds != null && ir > 0) + { + for (int i = 0; i < ir; i++) + { + string col4 = pds.Rows[i][4].ToString().Trim(); + string col30 = pds.Rows[i][30].ToString().Trim(); + string col31 = pds.Rows[i][31].ToString().Trim(); + DateTime? outTime = Funs.GetNewDateTime(col30); + if (!string.IsNullOrEmpty(col4) && outTime.HasValue) + { + var getPerson = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == col4 && x.ProjectId == this.ProjectId); + if (getPerson != null) + { + getPerson.OutTime = outTime; + getPerson.OutResult = col31; + getPerson.IsUsed = true; + getPerson.ExchangeTime = null; + getPerson.ExchangeTime2 = null; + getPerson.RealNameUpdateTime = null; + Funs.DB.SubmitChanges(); + info += "绗" + (i + 1).ToString() + "琛岋紝" + getPerson.PersonName + "绂诲矖鎴愬姛銆"; + } + else + { + info += "绗" + (i + 1).ToString() + "琛岋紝浜哄憳涓嶅湪褰撳墠椤圭洰銆"; + } + } + else + { + info += "绗" + (i + 1).ToString() + "琛岋紝韬唤璇佸彿鐮併佺鍦烘椂闂翠负绌恒"; + } + } + if (!string.IsNullOrEmpty(info)) + { + ShowNotify(info, MessageBoxIcon.Information); + } + } + else + { + ShowNotify("瀵煎叆鏁版嵁涓虹┖锛", MessageBoxIcon.Warning); + } + return true; + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.designer.cs index bfe41e86..81f906e8 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonIn.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.SitePerson { - - - public partial class PersonIn { - +namespace FineUIPro.Web.HSSE.SitePerson +{ + + + public partial class PersonIn + { + /// /// form1 鎺т欢銆 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 鎺т欢銆 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 鎺т欢銆 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// Toolbar2 鎺т欢銆 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// btnSee 鎺т欢銆 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Button btnSee; - + /// /// btnAudit 鎺т欢銆 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Button btnAudit; - + /// /// btnImport 鎺т欢銆 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Button btnImport; - + /// /// btnSave 鎺т欢銆 /// @@ -83,7 +85,16 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Button btnSave; - + + /// + /// btnOut 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.Button btnOut; + /// /// btnDownLoad 鎺т欢銆 /// @@ -92,7 +103,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Button btnDownLoad; - + /// /// fuAttachUrl 鎺т欢銆 /// @@ -101,7 +112,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.FileUpload fuAttachUrl; - + /// /// Grid1 鎺т欢銆 /// @@ -110,7 +121,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Grid Grid1; - + /// /// Label2 鎺т欢銆 /// @@ -119,7 +130,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::System.Web.UI.WebControls.Label Label2; - + /// /// hdFileName 鎺т欢銆 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.HiddenField hdFileName; - + /// /// hdCheckResult 鎺т欢銆 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.HiddenField hdCheckResult; - + /// /// lblBottom 鎺т欢銆 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Label lblBottom; - + /// /// Window1 鎺т欢銆 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 鎺т欢銆 ///