Commit 369a3e8e authored by solho's avatar solho

recommit

parent 833fa398
...@@ -22,6 +22,8 @@ namespace WebAPI.Controllers ...@@ -22,6 +22,8 @@ namespace WebAPI.Controllers
[RoutePrefix("Esn_Subitem")] [RoutePrefix("Esn_Subitem")]
public class Esn_todosController : ApiController public class Esn_todosController : ApiController
{ {
HttpResponseMessage result;
CommonResponseMsg response;
public Esn_todosController() public Esn_todosController()
{ {
...@@ -32,12 +34,21 @@ namespace WebAPI.Controllers ...@@ -32,12 +34,21 @@ namespace WebAPI.Controllers
/// <param name="Get_cur_his_id"></param> /// <param name="Get_cur_his_id"></param>
/// <returns></returns> /// <returns></returns>
/// ///
[Route("Test")] [Route("show_sub_todos_data")]
[HttpPost] [HttpPost]
public MessageList show_sub_todos_data(int? SN) public HttpResponseMessage show_sub_todos_data(ParamModel param)
{
if (param != null && param.Input != null && !string.IsNullOrWhiteSpace((param.Input.ToString())))
{
string input = param.Input.ToString();
String connString = ConfigurationManager.ConnectionStrings["eflow_cur"].ConnectionString;
JObject obj_input = JObject.Parse(input.ToString());
try
{
using (SqlConnection Conn = new SqlConnection(connString))
{ {
String sqlstr = ""; String sqlstr = "";
// SN = request_int("SN") int SN = 853141;
sqlstr = @"select distinct td.SN, case_id, finishedDate as finish_date, attorneyDueDate as int_due_date, sqlstr = @"select distinct td.SN, case_id, finishedDate as finish_date, attorneyDueDate as int_due_date,
LegalDueDate as legal_due_date, todosStatus_name as todos_status_name, taskDescription as taskName, assignedTo_userID, LegalDueDate as legal_due_date, todosStatus_name as todos_status_name, taskDescription as taskName, assignedTo_userID,
...@@ -47,10 +58,7 @@ namespace WebAPI.Controllers ...@@ -47,10 +58,7 @@ namespace WebAPI.Controllers
,case when (ISNULL(points,0)<>0 AND ISNULL(PointsType,'') <>'MP') AND ISNULL(exchangeRate,0)=0 THEn 1 ELSE ISNULL(exchangeRate,0) END as exchangeRate ,case when (ISNULL(points,0)<>0 AND ISNULL(PointsType,'') <>'MP') AND ISNULL(exchangeRate,0)=0 THEn 1 ELSE ISNULL(exchangeRate,0) END as exchangeRate
from esn_Todos td where td.SN in (" + SN + ")"; from esn_Todos td where td.SN in (" + SN + ")";
sqlstr = "select distinct td.*, tds.date_points_settlement, tds.date_points_settlement_pic_confirm from (" + sqlstr + ") td left join esn_todos_points tds on tds.sn=td.sn "; sqlstr = "select distinct td.*, tds.date_points_settlement, tds.date_points_settlement_pic_confirm from (" + sqlstr + ") td left join esn_todos_points tds on tds.sn=td.sn ";
//'gDebugha_wade(sqlstr)
//'---+ 承辦人員 //'---+ 承辦人員
sqlstr = "select t11.*, isnull(ui1.cn_name, '&nbsp;') as cn_name from (" + sqlstr + ") t11 left join s_user_info ui1 on ui1.user_id=t11.assignedTo_userID"; sqlstr = "select t11.*, isnull(ui1.cn_name, '&nbsp;') as cn_name from (" + sqlstr + ") t11 left join s_user_info ui1 on ui1.user_id=t11.assignedTo_userID";
...@@ -69,7 +77,8 @@ namespace WebAPI.Controllers ...@@ -69,7 +77,8 @@ namespace WebAPI.Controllers
left join c_customer c1 on c1.customer_id=ci1.customer_id"; left join c_customer c1 on c1.customer_id=ci1.customer_id";
//'結算 FLOW' //'結算 FLOW'
sqlstr += @"left join esn_todos_Flow etf on etf.esn_todos_sn = t1.sn sqlstr += @"
left join esn_todos_Flow etf on etf.esn_todos_sn = t1.sn
left join esn_todos_Flow_his etfh on etf.id=etfh.Flow_id left join esn_todos_Flow_his etfh on etf.id=etfh.Flow_id
left join esn_todos_Flow_StepType etfs on etf.StepType_id=etfs.id "; left join esn_todos_Flow_StepType etfs on etf.StepType_id=etfs.id ";
...@@ -99,8 +108,25 @@ namespace WebAPI.Controllers ...@@ -99,8 +108,25 @@ namespace WebAPI.Controllers
// sqlstr = sqlstr & " from (" & sqlstr0 & ") tt " // sqlstr = sqlstr & " from (" & sqlstr0 & ") tt "
//'gDebugha_wade(sqlstr) //'gDebugha_wade(sqlstr)
response.Code = "1";
//response.Msg = Hislist;
result.Content = new StringContent(JsonConvert.SerializeObject(response), System.Text.Encoding.UTF8, "application/json");
}
}
catch (Exception e)
{
return null; 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;
} }
} }
......
...@@ -65,4 +65,15 @@ namespace WebAPI.Models ...@@ -65,4 +65,15 @@ namespace WebAPI.Models
} }
public class ExportEHR_hisModel
{
public int id { get; set; }
public String SaveData { get; set; }
public DateTime? update_time { get; set; }
public String update_user_id { get; set; }
public DateTime? Create_time { get; set; }
public String Create_user_id { get; set; }
public String cn_name { get; set; }
}
} }
\ 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