Commit 81a6fed6 authored by solho's avatar solho

feat:客戶文號刪除"/"之後內容

parent 90523390
...@@ -14,6 +14,7 @@ using System.Web.Http; ...@@ -14,6 +14,7 @@ using System.Web.Http;
using WebAPI.Models; using WebAPI.Models;
using static WebAPI.Tool.Common; using static WebAPI.Tool.Common;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace WebAPI.Controllers namespace WebAPI.Controllers
{ {
...@@ -49,7 +50,7 @@ namespace WebAPI.Controllers ...@@ -49,7 +50,7 @@ namespace WebAPI.Controllers
using (SqlConnection Conn = new SqlConnection(connString)) using (SqlConnection Conn = new SqlConnection(connString))
{ {
var dysql = Conn.QueryBuilder($@" var dysql = Conn.QueryBuilder($@"
select epci.customer_name,eppi.ctrl_proc_zh_tw,eppi.ctrl_proc_zh_cn,ebfr.* , REPLACE(REPLACE(ebfr.example,'[cusno]',epci.case_volume_customer),'[case]',epci.case_volume) as example_decode from evw_p_proc_info eppi select epci.customer_name,eppi.ctrl_proc_zh_tw,eppi.ctrl_proc_zh_cn,ebfr.* ,epci.case_volume_customer ,epci.case_volume from evw_p_proc_info eppi
left join evw_p_case_info epci on epci.case_id=eppi.case_id left join evw_p_case_info epci on epci.case_id=eppi.case_id
inner join essen_back_file_rule ebfr on eppi.ctrl_proc_id=ebfr.ctrl_proc_id and eppi.country_id=ebfr.country_id and epci.customer_id=ebfr.customer_id inner join essen_back_file_rule ebfr on eppi.ctrl_proc_id=ebfr.ctrl_proc_id and eppi.country_id=ebfr.country_id and epci.customer_id=ebfr.customer_id
/**where**/ "); /**where**/ ");
...@@ -76,6 +77,11 @@ namespace WebAPI.Controllers ...@@ -76,6 +77,11 @@ namespace WebAPI.Controllers
} }
var results = dysql.Query(); var results = dysql.Query();
foreach (var res in results)
{
String reps = res.example;
res.example_decode = reps.Replace("[cusno]", Regex.Match(res.case_volume_customer, @"[a-zA-Z]+\d+" ).Value).Replace("[case]", res.case_volume);
}
response.Msg = JsonConvert.SerializeObject(results); response.Msg = JsonConvert.SerializeObject(results);
response.Code = "1"; response.Code = "1";
} }
......
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