Commit 3ce48f60 authored by solho's avatar solho

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

parents c257a152 c1a47508
using ExcelDataReader; using Dapper;
using ExcelDataReader;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
...@@ -26,6 +27,8 @@ namespace WebAPI.Controllers ...@@ -26,6 +27,8 @@ namespace WebAPI.Controllers
{ {
public class ProcInfoController : ApiController public class ProcInfoController : ApiController
{ {
String connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
public ProcInfoController() public ProcInfoController()
{ {
} }
...@@ -1193,6 +1196,100 @@ namespace WebAPI.Controllers ...@@ -1193,6 +1196,100 @@ namespace WebAPI.Controllers
return dt; return dt;
} }
#region 查詢流程節點處理人
[Route("ProcInfo/Flow/Doer")]
[CorsHandle]
[HttpPost]
public HttpResponseMessage get_procinfo_flow_doer()
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
try
{
var case_volume = HttpContext.Current.Request.Form["case_volume"];
var customer_name = HttpContext.Current.Request.Form["customer_name"];
var ctrl_proc_id = HttpContext.Current.Request.Form["ctrl_proc_id"];
var proc_status_id = HttpContext.Current.Request.Form["proc_status_id"];
var finish_date_s = HttpContext.Current.Request.Form["finish_date_s"];
var finish_date_e = HttpContext.Current.Request.Form["finish_date_e"];
var node_id = HttpContext.Current.Request.Form["node_id"];
using (SqlConnection conn = new SqlConnection(connectionString))
{
string str_sql = @"select pci.case_volume,cc.customer_name,icp.ctrl_proc_zh_cn,ics.case_status_zh_cn,ips.proc_status_zh_cn,ppi.finish_date,sfn.node_name_zh_cn,sui.cn_name,sfh.audit_time,sat.audit_type_zh_cn,sfh.remark
from p_case_info pci
inner join p_proc_info ppi on pci.case_id = ppi.case_id
inner join i_ctrl_proc icp on ppi.ctrl_proc_id = icp.ctrl_proc_id
inner join c_customer cc on pci.customer_id = cc.customer_id
left join i_proc_status ips on ppi.proc_status_id = ips.proc_status_id
inner join e_filing_info efi on pci.case_id = efi.case_id and ppi.proc_id = efi.proc_id
inner join s_flow_history sfh on efi.filing_id = sfh.obj_id
inner join s_flow_node sfn on sfh.node_id = sfn.node_id
inner join s_user_info sui on sfh.audit_user_id = sui.user_id
left join s_audit_type sat on sfh.audit_type_id = sat.audit_id
left join i_case_status ics on ppi.review_stage = ics.case_status_id";
List<string> arr_where = new List<string>();
if (case_volume!=null && !string.IsNullOrEmpty(case_volume))
{
arr_where.Add("pci.case_volume like @case_volume");
case_volume = "%" + case_volume + "%";
}
if (customer_name != null && !string.IsNullOrEmpty(customer_name))
{
arr_where.Add("cc.customer_name like @customer_name");
customer_name = "%" + customer_name + "%";
}
if (ctrl_proc_id != null && !string.IsNullOrEmpty(ctrl_proc_id))
{
arr_where.Add("ppi.ctrl_proc_id = @ctrl_proc_id");
}
if (proc_status_id != null && !string.IsNullOrEmpty(proc_status_id))
{
arr_where.Add("ppi.proc_status_id = @proc_status_id");
}
if (finish_date_s != null && !string.IsNullOrEmpty(finish_date_s))
{
arr_where.Add("ppi.finish_date >= @finish_date_s");
finish_date_s = finish_date_s + " 00:00:00";
}
if (finish_date_e != null && !string.IsNullOrEmpty(finish_date_e))
{
arr_where.Add("ppi.finish_date <= @finish_date_e");
finish_date_e = finish_date_e + " 23:59:59";
}
if (node_id != null && !string.IsNullOrEmpty(node_id))
{
arr_where.Add("sfn.node_id = @node_id");
}
if(arr_where.Count>0)
{
str_sql += " where ";
str_sql += string.Join(" and ", arr_where);
}
List<dynamic> list_flow_doer = conn.Query<dynamic>(str_sql,
new { case_volume = case_volume,
customer_name = customer_name,
ctrl_proc_id = ctrl_proc_id,
proc_status_id = proc_status_id,
finish_date_s = finish_date_s,
finish_date_e = finish_date_e,
node_id = node_id
}).ToList();
response.Code = "1";
response.Msg = list_flow_doer;
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
/// <summary> /// <summary>
/// 取得期限變更歷史資料 /// 取得期限變更歷史資料
/// </summary> /// </summary>
......
using Dapper;
using ExcelDataReader;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Net;
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;
using WebAPI.Dal;
using WebAPI.Models;
using WebAPI.Tool;
using static WebAPI.Models.CommonModel;
namespace WebAPI.Controllers
{
public class RequestController : ApiController
{
String connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
public RequestController()
{
}
#region 獲取請款單費用
[Route("Request/{request_id}/FeeList")]
[CorsHandle]
[HttpGet]
public HttpResponseMessage GetProcInfo(string request_id)
{
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
CommonResponseMsg response = new CommonResponseMsg();
try
{
if (string.IsNullOrWhiteSpace(request_id))
{
response.Code = "0";
response.Msg = "no request_id";
}
else
{
using (SqlConnection conn = new SqlConnection(connectionString))
{
string sql = @"SELECT ppfl.fee_id, ppfl.proc_id, ppfl.currency_id, ppfl.fee_type_id, ppfl.amount, ppfl.request_id, ppfl.request_no, ppfl.pay_type, ppfl.pay_status, ppfl.coefficient, ppfl.rate, ppfl.tax_id, ppfl.tax_type, ppfl.price, ppfl.is_divided, ppfl.mid_currency_id, ppfl.mid_amount, ppfl.mid_is_divided, ppfl.ori_is_divided, ppfl.mid_rate, ppfl.ori_rate
FROM p_proc_fee_list ppfl
INNER JOIN f_request_list frl ON ppfl.fee_id = frl.fee_id
WHERE frl.request_id = @request_id";
var fee_list = conn.Query<PProcFeeList>(sql, new { request_id = request_id }).ToList();
response.Code = "1";
response.Msg = fee_list;
}
}
}
catch (Exception e)
{
response.Code = "0";
response.Msg = e.Message;
}
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
return result;
}
#endregion
}
}
\ 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("p_proc_fee_list")]
public class PProcFeeList
{
[Key]
public string fee_id { get; set; }
public string proc_id { get; set; }
public string currency_id { get; set; }
public string fee_type_id { get; set; }
public decimal amount { get; set; }
public string request_id { get; set; }
public string request_no { get; set; }
public int pay_type { get; set; }
public string pay_status { get; set; }
public decimal coefficient { get; set; }
public decimal rate { get; set; }
public string tax_id { get; set; }
public string tax_type { get; set; }
public decimal price { get; set; }
public byte is_divided { get; set; }
public string mid_currency_id { get; set; }
public decimal mid_amount { get; set; }
public byte mid_is_divided { get; set; }
public byte ori_is_divided { get; set; }
public decimal mid_rate { get; set; }
public decimal ori_rate { get; set; }
}
}
\ No newline at end of file
...@@ -219,6 +219,7 @@ ...@@ -219,6 +219,7 @@
<Compile Include="Controllers\RoleInfoController.cs" /> <Compile Include="Controllers\RoleInfoController.cs" />
<Compile Include="Controllers\FileController.cs" /> <Compile Include="Controllers\FileController.cs" />
<Compile Include="Controllers\InventorController.cs" /> <Compile Include="Controllers\InventorController.cs" />
<Compile Include="Controllers\RequestController.cs" />
<Compile Include="Controllers\SubProcInfoController.cs" /> <Compile Include="Controllers\SubProcInfoController.cs" />
<Compile Include="Controllers\ProcInfoController.cs" /> <Compile Include="Controllers\ProcInfoController.cs" />
<Compile Include="Controllers\UserInfoController.cs" /> <Compile Include="Controllers\UserInfoController.cs" />
...@@ -231,6 +232,7 @@ ...@@ -231,6 +232,7 @@
<Compile Include="Models\DataObjects\PCaseInfo.cs" /> <Compile Include="Models\DataObjects\PCaseInfo.cs" />
<Compile Include="Models\DataObjects\SDeptInfo.cs" /> <Compile Include="Models\DataObjects\SDeptInfo.cs" />
<Compile Include="Models\DataObjects\SDeptUser.cs" /> <Compile Include="Models\DataObjects\SDeptUser.cs" />
<Compile Include="Models\DataObjects\PProcFeeList.cs" />
<Compile Include="Models\DataObjects\SUserInfo.cs" /> <Compile Include="Models\DataObjects\SUserInfo.cs" />
<Compile Include="Models\EhrEmployee.cs" /> <Compile Include="Models\EhrEmployee.cs" />
<Compile Include="Models\SP_rpt_PerformanceMonth_FlowModel.cs" /> <Compile Include="Models\SP_rpt_PerformanceMonth_FlowModel.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