Commit fcada1d3 authored by charleslee's avatar charleslee

Merge branch 'master' of http://gitlab.epurplevineip.com/sol/code

parents 41defe66 a3c8d153
...@@ -168,9 +168,7 @@ namespace WebAPI.Controllers ...@@ -168,9 +168,7 @@ namespace WebAPI.Controllers
CommandText = @"MERGE INTO essen_customer WITH(HOLDLOCK) as target USING( CommandText = @"MERGE INTO essen_customer WITH(HOLDLOCK) as target USING(
select @request_customer_id as request_customer_id, @customer_id as customer_id ) as source (request_id,customer_id) select @request_customer_id as request_customer_id, @customer_id as customer_id ) as source (request_id,customer_id)
on(target.customer_id = source.customer_id ) on(target.customer_id = source.customer_id )
WHEN MATCHED THEN UPDATE SET request_customer_id = @request_customer_id WHEN MATCHED THEN UPDATE SET request_customer_id = @request_customer_id ;"
WHEN NOT MATCHED THEN INSERT(request_customer_id,customer_id)
VALUES(@request_customer_id,@customer_id );"
}; };
......
...@@ -11,6 +11,7 @@ using System.Net; ...@@ -11,6 +11,7 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Web.Http; using System.Web.Http;
using WebAPI.Models; using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel; using static WebAPI.Models.CommonModel;
using static WebAPI.Tool.Common; using static WebAPI.Tool.Common;
...@@ -28,7 +29,7 @@ namespace WebAPI.Controllers ...@@ -28,7 +29,7 @@ namespace WebAPI.Controllers
HttpResponseMessage result; HttpResponseMessage result;
CommonResponseMsg response; CommonResponseMsg response;
MessageList_ETF Outmsg; MessageList_ETF Outmsg;
String connString; static String connString;
public Esn_Todos_FlowController() public Esn_Todos_FlowController()
{ {
...@@ -62,17 +63,8 @@ namespace WebAPI.Controllers ...@@ -62,17 +63,8 @@ namespace WebAPI.Controllers
Esn_Todos_FlowModel hisT = new Esn_Todos_FlowModel(); Esn_Todos_FlowModel hisT = new Esn_Todos_FlowModel();
SqlCommand cmd = new SqlCommand("", Conn) SqlCommand cmd = new SqlCommand("", Conn)
{ {
CommandText = @" select a.ConfirmTime,Case When isnull(e.Names,'')='' then '其他' else e.Names End as ConfirmUserClass CommandText = @"select ConfirmTime,ConfirmUserClass,ConfirmMethod,Create_time,Create_User_Name,""From"", ""To"",
,Case When isnull(f.Names,'')='' then '其他' else f.Names end as ConfirmMethod Description from dbo.efn_Get_Flow_editing_log(@Flow_id)"
,a.Create_time,d.cn_name as Create_User_Name,b.Step_Text as ""From"",c.Step_Text as ""To"",a.Description
from esn_Todos_flow_his a
left join esn_todos_Flow_StepType b on a.FromType_id = b.id
left join esn_todos_Flow_StepType c on a.ToType_id = c.id
left join evw_Employee d on a.Create_User_id = d.user_id
left join esn_category e on e.ParentId='Flow_Role' and a.ConfirmUserClass = e.QryKey1
left join esn_category f on f.ParentId='Flow_Method' and a.ConfirmMethod = f.QryKey1
where a.Flow_id = @Flow_id
"
}; };
cmd.Parameters.AddWithValue("@Flow_id", obj_input["Flowid"].ToString()); cmd.Parameters.AddWithValue("@Flow_id", obj_input["Flowid"].ToString());
DataSet ds = SqlToDs(cmd); DataSet ds = SqlToDs(cmd);
...@@ -142,10 +134,13 @@ namespace WebAPI.Controllers ...@@ -142,10 +134,13 @@ namespace WebAPI.Controllers
{ {
CommandText = @"select b.cn_name, a.* from esn_todos_SettleLog a CommandText = @"select b.cn_name, a.* from esn_todos_SettleLog a
left join s_user_info b on a.Create_user_id=b.user_id left join s_user_info b on a.Create_user_id=b.user_id
where a.Create_user_id=@Create_user_id " where a.Create_user_id=@Create_user_id @wherecase"
}; };
String wherecase = obj_input["gUserID_wade"] == null || string.IsNullOrEmpty(obj_input["gUserID_wade"].ToString()) ? " or 1=1" : "";
cmd.Parameters.AddWithValue("@Create_user_id", obj_input["gUserID_wade"].ToString()); cmd.Parameters.AddWithValue("@Create_user_id", obj_input["gUserID_wade"].ToString());
DataSet ds = SqlToDs(cmd); cmd.CommandText = cmd.CommandText.Replace("@wherecase", wherecase);
DataSet ds = SqlToDs(cmd);
foreach (DataRow dr in ds.Tables[0].Rows) foreach (DataRow dr in ds.Tables[0].Rows)
{ {
hisT = new ExportEHR_hisModel() hisT = new ExportEHR_hisModel()
...@@ -443,11 +438,11 @@ namespace WebAPI.Controllers ...@@ -443,11 +438,11 @@ namespace WebAPI.Controllers
CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault(); CStepTypeNext = AllStepType.Where(p => p.id == StepType_id_Previous).FirstOrDefault();
#region 重置結算日期,是否已解算 #region 重置結算日期,是否已解算
if (JtSn["validclass"].ToString() == "PG" || JtSn["validclass"].ToString() == "Leader") if (JtSn["validclass"].ToString() == "PG" || JtSn["validclass"].ToString() == "Leader") //強制撤回
{ {
TOopExecSP += String.Format(@"update esn_todos_points set date_points_settlement=null where sn=" + dsr["sn"] + ";"); TOopExecSP += String.Format(@"update esn_todos_points set date_points_settlement=null where sn=" + dsr["sn"] + ";");
TOopExecSP += String.Format(@"update esn_todos_Flow set Is_Settlement=0 where esn_todos_sn=" + dsr["sn"] + ";"); TOopExecSP += String.Format(@"update esn_todos_Flow set Is_Settlement=0 where esn_todos_sn=" + dsr["sn"] + ";");
if (JtSn["validclass"].ToString() == "PG") //if (JtSn["validclass"].ToString() == "PG")
{TOopExecSP += String.Format(@"exec [dbo].esp_esn_Todos_V3_AssignStatus 'AS05Back' ," + dsr["sn"] + @",'',@Reject_Description_{0},'',@Wade_User_ID ;", i); //強制拉回需重置運營辦狀態 {TOopExecSP += String.Format(@"exec [dbo].esp_esn_Todos_V3_AssignStatus 'AS05Back' ," + dsr["sn"] + @",'',@Reject_Description_{0},'',@Wade_User_ID ;", i); //強制拉回需重置運營辦狀態
} }
} }
...@@ -534,7 +529,7 @@ namespace WebAPI.Controllers ...@@ -534,7 +529,7 @@ namespace WebAPI.Controllers
[CorsHandle] [CorsHandle]
[HttpPost] [HttpPost]
[HttpGet] [HttpGet]
public HttpResponseMessage Save_PointSettlement_Log(ParamModel param) public HttpResponseMessage Save_PointSettlement_Log(ParamModel param)
{ {
if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString()))) if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString())))
{ {
...@@ -542,22 +537,9 @@ namespace WebAPI.Controllers ...@@ -542,22 +537,9 @@ namespace WebAPI.Controllers
try try
{ {
JObject obj_input = JObject.Parse(input.ToString()); JObject obj_input = JObject.Parse(input.ToString());
JArray obj_input_data = JArray.Parse(obj_input["SaveData"].ToString()); DataTable dt = Save_PointSettlement_Log_Base(obj_input);
using (SqlConnection Conn = new SqlConnection(connString))
{
SqlCommand cmd = new SqlCommand("", Conn)
{
CommandText = @"Insert into esn_todos_SettleLog([SaveData],[Country],[update_time],[update_user_id],Create_time,Create_user_id)
values(@SaveData,@Country,getdate(),@gUserID_wade,getdate(),@gUserID_wade)"
};
cmd.Parameters.AddWithValue("@SaveData", obj_input["SaveData"].ToString());
cmd.Parameters.AddWithValue("@gUserID_wade", obj_input["gUserID_wade"].ToString());
cmd.Parameters.AddWithValue("@Country", obj_input["Country"].ToString());
DataTable dt = SqlToDt(cmd);
response.Code = "1"; response.Code = "1";
response.Msg = "匯出完畢"; response.Msg = "匯出完畢";
}
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -574,7 +556,22 @@ namespace WebAPI.Controllers ...@@ -574,7 +556,22 @@ namespace WebAPI.Controllers
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json"); result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result; return result;
} }
public static DataTable Save_PointSettlement_Log_Base(JObject obj_input)
{
DataTable dt = null;
JArray obj_input_data = JArray.Parse(obj_input["SaveData"].ToString());
SqlServerHelper sql_server_helper = new SqlServerHelper();
SqlCommand cmd = new SqlCommand("")
{
CommandText = @"Insert into esn_todos_SettleLog([SaveData],[Country],[update_time],[update_user_id],Create_time,Create_user_id)
values(@SaveData,(select Emp_DSContury from evw_Employee a where a.user_id =@gUserID_wade),getdate(),@gUserID_wade,getdate(),@gUserID_wade)"
};
cmd.Parameters.AddWithValue("@SaveData", obj_input["SaveData"].ToString());
cmd.Parameters.AddWithValue("@gUserID_wade", obj_input["gUserID_wade"].ToString());
dt = sql_server_helper.GetTable(cmd);
return dt;
}
} }
......
...@@ -25,4 +25,84 @@ namespace WebAPI.Models ...@@ -25,4 +25,84 @@ namespace WebAPI.Models
public String Create_User_Name { get; set; } public String Create_User_Name { get; set; }
} }
/// <summary>
/// 檢核扣點
/// </summary>
public class validpointModel
{
public String attr_userID { get; set; }
public String attr_UserName { get; set; }
public long aaa { get; set; }
public long ID { get; set; }
public int vInt { get; set; }
}
/// <summary>
/// 審核點數SP
/// </summary>
public class SP_rpt_PerformanceMonth_FlowModel
{
public String attr_userID { get; set; }
public String 承辦人 { get; set; }
public String 管理中心 { get; set; }
public int attr_DStargetid { get; set; }
public String 所別 { get; set; }
public String 一級部門 { get; set; }
public String attr_DeptGroupTargetID { get; set; }
public String 二級部門 { get; set; }
public String attr_todos2 { get; set; }
public String attr_RejectCount { get; set; }
public String attr_nn_toConfirmAll { get; set; }
public String 處理事項數 { get; set; }
public String attr_todos3 { get; set; }
public String attr_MapClasslist { get; set; }
public String 可結算事項數 { get; set; }
public int attr_points0 { get; set; }
public int 原始提成 { get; set; }
public int 檢核扣點 { get; set; }
public int attr_actingpoints { get; set; }
public int attr_nonactingpoints { get; set; }
public int attr_加成點數 { get; set; }
public int attr_pointssum { get; set; }
public int 加成後總提成 { get; set; }
public String attr_1_type { get; set; }
public String attr_AllConfirm { get; set; }
public String 審核完畢 { get; set; }
public String attr_2_type { get; set; }
public String attr_IsSettlement { get; set; }
public String 結算完畢 { get; set; }
public String 結算月份 { get; set; }
public String 薪資類型 { get; set; }
public String attr_deptmanager { get; set; }
public String attr_programmer { get; set; }
public String attr_engineer { get; set; }
public String 工號 { get; set; }
public String 姓名 { get; set; }
public String 月份 { get; set; }
public String Emp_DSContury { get; set; }
public int 前三个月平均绩效 { get; set; }
}
/// <summary>
/// 輸出 Ehr
/// </summary>
public class ExportEhrModel
{
public String 所別 { get; set; }
public String 管理中心 { get; set; }
public String 一級部門 { get; set; }
public String 二級部門 { get; set; }
public String 國別 { get; set; }
public String Badge { get; set; }
public String 姓名 { get; set; }
public String Term { get; set; }
public int Per_Agent_Amount { get; set; }
public int Non_Agent_Amount { get; set; }
public int PAverage { get; set; }
public int Points { get; set; }
}
} }
\ No newline at end of file
using System;
using System.Collections.Generic;
namespace WebAPI.Models
{
/// <summary>
/// 處理事項子項相關
/// </summary>
}
\ No newline at end of file
...@@ -4,11 +4,16 @@ ...@@ -4,11 +4,16 @@
https://go.microsoft.com/fwlink/?LinkId=301879 https://go.microsoft.com/fwlink/?LinkId=301879
--> -->
<configuration> <configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings> <connectionStrings>
<!--報價規則--> <!--報價規則-->
<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="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" /> <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" />
<add name="essenConnection" connectionString="server=192.168.1.174;port=3306;user id=sol; password=FK35cnvbeH3BNAxV; database=essen_test " />
</connectionStrings> </connectionStrings>
<appSettings> <appSettings>
<add key="webpages:Version" value="3.0.0.0" /> <add key="webpages:Version" value="3.0.0.0" />
...@@ -93,4 +98,14 @@ ...@@ -93,4 +98,14 @@
<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+" /> <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> </compilers>
</system.codedom> </system.codedom>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration> </configuration>
\ No newline at end of file
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
<Reference Include="EastAsiaNumericFormatter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e1e67937c016e5b2, processorArchitecture=MSIL"> <Reference Include="EastAsiaNumericFormatter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e1e67937c016e5b2, processorArchitecture=MSIL">
<HintPath>packages\EastAsiaNumericFormatter.1.0.0\lib\net40\EastAsiaNumericFormatter.dll</HintPath> <HintPath>packages\EastAsiaNumericFormatter.1.0.0\lib\net40\EastAsiaNumericFormatter.dll</HintPath>
</Reference> </Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL"> <Reference Include="ExcelDataReader, Version=3.6.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>.\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath> <HintPath>.\packages\ExcelDataReader.3.6.0\lib\net45\ExcelDataReader.dll</HintPath>
</Reference> </Reference>
...@@ -122,6 +128,7 @@ ...@@ -122,6 +128,7 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Security" />
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
<Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <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> <HintPath>packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath>
...@@ -225,6 +232,7 @@ ...@@ -225,6 +232,7 @@
<Compile Include="Dal\DalProcInfo.cs" /> <Compile Include="Dal\DalProcInfo.cs" />
<Compile Include="Models\DataObjects\PCaseInfo.cs" /> <Compile Include="Models\DataObjects\PCaseInfo.cs" />
<Compile Include="Models\EhrEmployee.cs" /> <Compile Include="Models\EhrEmployee.cs" />
<Compile Include="Models\SP_rpt_PerformanceMonth_FlowModel.cs" />
<Compile Include="Models\Esn_todos_SettleModel.cs" /> <Compile Include="Models\Esn_todos_SettleModel.cs" />
<Compile Include="Models\AnnualInfo.cs" /> <Compile Include="Models\AnnualInfo.cs" />
<Compile Include="Models\Esn_Todos_FlowModel.cs" /> <Compile Include="Models\Esn_Todos_FlowModel.cs" />
...@@ -320,6 +328,7 @@ ...@@ -320,6 +328,7 @@
<Content Include="log4net.config"> <Content Include="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="libman.json" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<None Include="Scripts\jquery-3.4.1.intellisense.js" /> <None Include="Scripts\jquery-3.4.1.intellisense.js" />
<Content Include="Scripts\jquery-3.4.1.js" /> <Content Include="Scripts\jquery-3.4.1.js" />
...@@ -378,6 +387,9 @@ ...@@ -378,6 +387,9 @@
<Content Include="Scripts\jquery-3.4.1.slim.min.map" /> <Content Include="Scripts\jquery-3.4.1.slim.min.map" />
<Content Include="Scripts\jquery-3.4.1.min.map" /> <Content Include="Scripts\jquery-3.4.1.min.map" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<package id="Dapper.Contrib" version="2.0.78" targetFramework="net48" /> <package id="Dapper.Contrib" version="2.0.78" targetFramework="net48" />
<package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net46" /> <package id="DocumentFormat.OpenXml" version="2.7.2" targetFramework="net46" />
<package id="EastAsiaNumericFormatter" version="1.0.0" targetFramework="net46" /> <package id="EastAsiaNumericFormatter" version="1.0.0" targetFramework="net46" />
<package id="EntityFramework" version="6.2.0" targetFramework="net48" />
<package id="EntityFramework.zh-Hant" version="6.2.0" targetFramework="net48" />
<package id="ExcelDataReader" version="3.6.0" targetFramework="net46" /> <package id="ExcelDataReader" version="3.6.0" targetFramework="net46" />
<package id="ExcelDataReader.DataSet" version="3.6.0" targetFramework="net46" /> <package id="ExcelDataReader.DataSet" version="3.6.0" targetFramework="net46" />
<package id="ExcelNumberFormat" version="1.0.10" targetFramework="net46" /> <package id="ExcelNumberFormat" version="1.0.10" targetFramework="net46" />
......
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