Commit acc94b35 authored by solho's avatar solho

feat:merge

parent 327adaae
......@@ -4,6 +4,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Configuration;
using System.Linq;
using System.Data;
using System.Data.SqlClient;
using System.Net;
......@@ -12,6 +13,8 @@ using System.Web;
using System.Web.Http;
using WebAPI.Models;
using static WebAPI.Tool.Common;
using System.Collections.Generic;
namespace WebAPI.Controllers
{
public class WadeMailController : ApiController
......@@ -81,6 +84,75 @@ namespace WebAPI.Controllers
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
/// <summary>
/// 取得 Mail_js內返稿文件命名規範 資訊
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
[Route("ProcInfo/Get_evwProcInfo")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage Get_evwProcInfo(ParamModel param)
{
if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString())))
{
string input = param.Input.ToString();
try
{
JObject obj_input = JObject.Parse(input.ToString());
using (SqlConnection Conn = new SqlConnection(connString))
{
string sql_fields = obj_input["sql_fields"] == null ? "*" : obj_input["sql_fields"].ToString();
FormattableString sql= $@" select TOP 10 {sql_fields} from evw_p_proc_info eppi
left join evw_p_case_info epci on epci.case_id=eppi.case_id
/**where**/ ";
var dysql = Conn.QueryBuilder();
dysql.AppendLine($" select TOP 10 {sql_fields} from evw_p_proc_info eppi");
dysql.AppendLine($"left join evw_p_case_info epci on epci.case_id=eppi.case_id");
if (obj_input["proc_id"] != null)
{
dysql.Where($"eppi.proc_id in ({obj_input["proc_id"].ToString()})");
}
if (obj_input["case_id"] != null)
{
dysql.Where($"epci.case_id in ('{obj_input["case_id"].ToString()}')");
}
if (obj_input["Case_country_id"] != null)
{
dysql.Where($"epci.country_id = '{obj_input["Case_country_id"].ToString()}'");
}
if (obj_input["case_type_Code"] != null)
{
dysql.Where($"epci.case_type_Code = '{obj_input["case_type_Code"].ToString()}'");
}
if (obj_input["customer_name"] != null)
{
dysql.Where($"epci.customer_name like '{obj_input["customer_name"].ToString()}%'");
}
dysql += $" ORDER BY epci.case_id";
var results = dysql.Query();
response.Msg = JsonConvert.SerializeObject(results);
response.Code = "1";
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = "Exception:" + e.StackTrace;
}
}
else
{
response.Code = "0";
response.Msg = "no input or format error";
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
}
}
......@@ -210,6 +210,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\AnnualInfoController.cs" />
<Compile Include="Controllers\Esn_Todos_FlowController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Controllers\WadeMailController.cs" />
<Compile Include="Controllers\EssenToCrmController.cs" />
<Compile Include="Controllers\Esn_Subitem\Esn_todos_SettleController.cs" />
......
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