Commit 37decfa6 authored by charleslee's avatar charleslee

feat:user authorization import

parent 07eb921f
......@@ -13,6 +13,7 @@ using System.Net.Http;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Http.Cors;
......@@ -502,8 +503,8 @@ namespace WebAPI.Controllers
//dic_result[item["fee_id"].ToString()] = "1";
CommonResponseMsg result_update = dal_proc_info.update_by_dict("insert", "p_proc_fee_list", dic);
dic_result[item["fee_id"].ToString()] = result_update.Msg;
LogHelper.WriteInfoLog(string.Format(@"{0};{1};{2}", result_update.Code, result_update.Msg, item["fee_id"]), this.GetType().Name+":"+ MethodBase.GetCurrentMethod().Name);
Thread.Sleep(500);
}
response.Code = "1";
response.Msg = dic_result;
......@@ -661,8 +662,14 @@ namespace WebAPI.Controllers
{
CommonResponseMsg result_agency_list = dal_case_info.GetpAgencyList("*", dt_case_info.Rows[0]["case_id"].ToString());
DataTable dt_agency_list = (DataTable)result_agency_list.Msg;
dic_proc_info["back_inventor_date"] = DateTime.Parse(dr_proc["返发明人日"].ToString()).ToString("yyyy-MM-dd");
if (dr_proc["返发明人日"] != null && !string.IsNullOrEmpty(dr_proc["返发明人日"].ToString()))
{
dic_proc_info["back_inventor_date"] = DateTime.Parse(dr_proc["返发明人日"].ToString()).ToString("yyyy-MM-dd");
}
if (dr_proc["返稿日"] != null && !string.IsNullOrEmpty(dr_proc["返稿日"].ToString()))
{
dic_proc_info["back_date"] = DateTime.Parse(dr_proc["返稿日"].ToString()).ToString("yyyy-MM-dd");
}
dr_proc["id"] = dic_proc_info["proc_id"];
dr_proc["import_data"] = JsonConvert.SerializeObject(dic_proc_info);
}
......@@ -702,6 +709,8 @@ namespace WebAPI.Controllers
var dic = item.ToObject<Dictionary<string, object>>();
CommonResponseMsg result_sql = dal_proc_info.update_by_dict("update", "p_proc_info", dic, "proc_id");
dic_result[item["proc_id"].ToString()] = result_sql.Msg;
LogHelper.WriteInfoLog($"{this.GetType().Name}_{MethodBase.GetCurrentMethod().Name}:{item["proc_id"]}_{result_sql.Code}_{result_sql.Msg}");
Thread.Sleep(1000);
}
response.Code = "1";
response.Msg = dic_result;
......
This diff is collapsed.
using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Table("ehr_employee")]
public class EhrEmployee
{
[Key]
public Int32 EID { get; set; }
public string badge { get; set; }
public string name { get; set; }
public string main_email { get; set; }
[Key]
public string wade_user_id { get; set; }
public string dept_id { get; set; }
}
}
\ No newline at end of file
using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Table("s_dept_info")]
public class SDeptInfo
{
public string dept_id { get; set; }
public string parent_id { get; set; }
public string dept_level { get; set; }
public string dept_name { get; set; }
public string dept_full_name { get; set; }
public bool is_charge { get; set; }
public bool is_enabled { get; set; }
public bool is_branch { get; set; }
public string dept_code { get; set; }
}
}
\ No newline at end of file
using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Table("s_dept_user")]
public class SDeptUser
{
public string dept_id { get; set; }
public string user_id { get; set; }
public string role_id { get; set; }
public Boolean is_default { get; set; }
public int user_type { get; set; }
public string authority { get; set; }
public string country { get; set; }
[Key]
public int identity_id { get; set; }
}
}
\ No newline at end of file
using Dapper.Contrib.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
[Table("s_user_info")]
public class SUserInfo
{
public string user_id { get; set; }
public int user_type { get; set; }
public string user_name { get; set; }
public string user_pass { get; set; }
public string first_name { get; set; }
public string last_name { get; set; }
public string cn_name { get; set; }
public string en_name { get; set; }
public string dept_id { get; set; }
public string agent_id { get; set; }
public Boolean is_enabled { get; set; }
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
<configuration>
<connectionStrings>
<!--報價規則-->
<add name="DefaultConnection" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy_test;Persist Security Info=True;User ID=ipeasyTest;Password=ipeasy.123" providerName="System.Data.SqlClient" />
<add name="DefaultConnection" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy_test;Persist Security Info=True;User ID=ipeasy;Password=ipeasy.123" providerName="System.Data.SqlClient" />
<!--核稿歷史-->
<add name="eflow_cur" connectionString="Data Source=47.91.213.74,6002;Initial Catalog=IPEasy_test;Persist Security Info=True;User ID=ipeasyTest;Password=ipeasy.123" providerName="System.Data.SqlClient" />
</connectionStrings>
......@@ -16,9 +16,17 @@
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<!--
如需 web.config 變更的說明,請參閱 http://go.microsoft.com/fwlink/?LinkId=235367
您可以在 <httpRuntime> 標記上設定下列屬性。
<system.Web>
<httpRuntime targetFramework="4.8" />
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.6" />
<httpRuntime targetFramework="4.6" maxRequestLength="102400" executionTimeout="6000"/>
<compilation debug="true" targetFramework="4.8" />
<httpRuntime targetFramework="4.6" maxRequestLength="102400" executionTimeout="6000" />
</system.web>
<system.webServer>
<handlers>
......@@ -37,7 +45,6 @@
<clientCache cacheControlCustom="public" />
</staticContent>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
......@@ -85,4 +92,4 @@
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
</configuration>
</configuration>
\ No newline at end of file
......@@ -14,7 +14,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebAPI</RootNamespace>
<AssemblyName>WebAPI</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
......@@ -25,6 +25,7 @@
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -51,6 +52,12 @@
<Reference Include="ClosedXML, Version=0.95.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\ClosedXML.0.95.3\lib\net46\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Dapper.2.0.123\lib\net461\Dapper.dll</HintPath>
</Reference>
<Reference Include="Dapper.Contrib, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Dapper.Contrib.2.0.78\lib\net461\Dapper.Contrib.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=2.7.2.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>packages\DocumentFormat.OpenXml.2.7.2\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
......@@ -99,6 +106,7 @@
<Reference Include="System.ComponentModel" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
......@@ -118,15 +126,14 @@
<Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Routing" />
......@@ -177,6 +184,7 @@
<Private>True</Private>
<HintPath>.\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>packages\MySql.Data.8.0.22\lib\net452\Ubiety.Dns.Core.dll</HintPath>
</Reference>
......@@ -209,17 +217,22 @@
<Compile Include="Controllers\InventorController.cs" />
<Compile Include="Controllers\SubProcInfoController.cs" />
<Compile Include="Controllers\ProcInfoController.cs" />
<Compile Include="Controllers\UserInfoController.cs" />
<Compile Include="Dal\Dal.cs" />
<Compile Include="Dal\DalBaseInfo.cs" />
<Compile Include="Dal\DalFee.cs" />
<Compile Include="Dal\DalCaseInfo.cs" />
<Compile Include="Dal\DalProcInfo.cs" />
<Compile Include="Models\EhrEmployee.cs" />
<Compile Include="Models\Esn_todos_SettleModel.cs" />
<Compile Include="Models\AnnualInfo.cs" />
<Compile Include="Models\Esn_Todos_FlowModel.cs" />
<Compile Include="Models\Esn_TodosModel.cs" />
<Compile Include="Models\ParamModel.cs" />
<Compile Include="Models\CommonResponseMsg.cs" />
<Compile Include="Models\SDeptInfo.cs" />
<Compile Include="Models\SDeptUser.cs" />
<Compile Include="Models\SUserInfo.cs" />
<Compile Include="Tool\Common.cs" />
<Compile Include="Tool\CorsHandle.cs" />
<Compile Include="Tool\ExcelHelper.cs" />
......
......@@ -4,6 +4,8 @@
<package id="bootstrap" version="3.4.1" targetFramework="net46" />
<package id="BouncyCastle" version="1.8.3.1" targetFramework="net46" />
<package id="ClosedXML" version="0.95.3" targetFramework="net46" />
<package id="Dapper" version="2.0.123" targetFramework="net48" />
<package id="Dapper.Contrib" version="2.0.78" targetFramework="net48" />
<package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net46" />
<package id="EastAsiaNumericFormatter" version="1.0.0" targetFramework="net46" />
<package id="ExcelDataReader" version="3.6.0" targetFramework="net46" />
......@@ -37,13 +39,13 @@
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net46" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net46" />
<package id="Modernizr" version="2.8.3" targetFramework="net46" />
<package id="MySql.Data" version="8.0.22" targetFramework="net46" />
<package id="MySql.Data" version="8.0.22" targetFramework="net46" requireReinstallation="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net46" />
<package id="System.Buffers" version="4.5.1" targetFramework="net46" />
<package id="System.Buffers" version="4.5.1" targetFramework="net46" requireReinstallation="true" />
<package id="System.IO.FileSystem.Primitives" version="4.0.1" targetFramework="net46" />
<package id="System.IO.Packaging" version="4.0.0" targetFramework="net46" />
<package id="System.Memory" version="4.5.3" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" />
<package id="System.Memory" version="4.5.3" targetFramework="net46" requireReinstallation="true" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net46" requireReinstallation="true" />
<package id="WebGrease" version="1.6.0" targetFramework="net46" />
</packages>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment