hb
This commit is contained in:
commit
59ea093779
5 files changed
+138
-3
No files matched your search
@@ -2660,6 +2660,109 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string WXGetErpEWaybillPathList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var erp_order_id_in = RegexUtils.GetStringQuery(ref inputData, "erp_order_id_in")?.Replace("'", "\\'");
|
||||
var ewaybill_order_id_in = RegexUtils.GetStringQuery(ref inputData, "ewaybill_order_id_in")?.Replace("'", "\\'");
|
||||
var waybill_id_in = RegexUtils.GetStringQuery(ref inputData, "waybill_id_in")?.Replace("'", "\\'");
|
||||
if (erp_order_id_in.IsNullOrEmpty() && ewaybill_order_id_in.IsNullOrEmpty() && waybill_id_in.IsNullOrEmpty())
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"未指定要查询的物流轨迹\"}";
|
||||
}
|
||||
var sort_type = RegexUtils.GetStringQuery(ref inputData, "sort_type")?.Replace("'", "\\'");
|
||||
var is_not_count = RegexUtils.GetStringQuery(ref inputData, "is_not_count") != "false";
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(1000);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(id) FROM erp.oms_wei_ewaybill_path o WHERE 1=1 ";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(erp_order_id_in))
|
||||
where += " and o.order_id in ('" + erp_order_id_in.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrWhiteSpace(ewaybill_order_id_in))
|
||||
where += " and o.ewaybill_order_id in ('" + ewaybill_order_id_in.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrWhiteSpace(waybill_id_in))
|
||||
where += " and o.waybill_id in ('" + waybill_id_in.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
|
||||
var count = 0;
|
||||
if (!is_not_count)
|
||||
count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0 && !is_not_count)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT o.* FROM erp.oms_wei_ewaybill_path o WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
|
||||
if (sort_type == "asc")
|
||||
sql += " ORDER BY o.id ASC";
|
||||
else
|
||||
sql += " ORDER BY o.id DESC";
|
||||
sql += " LIMIT " + Math.Max(page - 1, 0) * page_size + "," + page_size;
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
|
||||
mySql.Close();
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<oms_wei_ewaybill_path> orderItemList = new List<oms_wei_ewaybill_path>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
oms_wei_ewaybill_path order = new oms_wei_ewaybill_path
|
||||
{
|
||||
id = row["id"].ParseToLong(),
|
||||
order_id = row["order_id"].ParseToNullableLong(),
|
||||
create_time = row["create_time"].ParseToString().ParseToDateTime(),
|
||||
ewaybill_order_id = row["ewaybill_order_id"].ParseToString(),
|
||||
node_desc = row["node_desc"].ParseToString(),
|
||||
shop_id = row["shop_id"].ParseToNullableLong(),
|
||||
status = row["status"].ParseToInt(),
|
||||
update_time = row["update_time"].ParseToLong(),
|
||||
waybill_id = row["waybill_id"].ParseToString(),
|
||||
};
|
||||
orderItemList.Add(order);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(orderItemList, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + ex.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"data\":[],\"count\":" + 0 + "}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
private JsonSerializerSettings JsonSerializer = new JsonSerializerSettings
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
|
||||
@@ -6,10 +6,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Contexts;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Services;
|
||||
using System.Web.Http;
|
||||
using System.Web.Services;
|
||||
|
||||
namespace KJD_Web.Controllers.WX
|
||||
{
|
||||
@@ -305,5 +306,15 @@ namespace KJD_Web.Controllers.WX
|
||||
|
||||
return JsonString(result);
|
||||
}
|
||||
|
||||
public IHttpActionResult wx_get_erp_ewaybill_path_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetErpEWaybillPathList(jsontext);
|
||||
|
||||
return JsonString(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,6 +219,7 @@
|
||||
<Compile Include="DependencyInjection\IScopedDependency.cs" />
|
||||
<Compile Include="DependencyInjection\ISingletonDependency.cs" />
|
||||
<Compile Include="DependencyInjection\ITransientDependency.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_ewaybill_path.cs" />
|
||||
<Compile Include="Entitys\OEMEntity.cs" />
|
||||
<Compile Include="Entitys\UserPaymentRecordEntity.cs" />
|
||||
<Compile Include="Requests\RequestBase.cs" />
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class oms_wei_ewaybill_path
|
||||
{
|
||||
public long id { get; set; }
|
||||
public long? shop_id { get; set; }
|
||||
public long? order_id { get; set; }
|
||||
public string ewaybill_order_id { get; set; }
|
||||
public string waybill_id { get; set; }
|
||||
public long update_time { get; set; }
|
||||
public int status { get; set; }
|
||||
public string node_desc { get; set; }
|
||||
public DateTime create_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
-->
|
||||
<configuration>
|
||||
<connectionStrings>
|
||||
<!--<add name="ConnKJD" connectionString="Max Pool Size=512;Database='kjd';Data Source='nj-cynosdbmysql-grp-hl51pkfr.sql.tencentcdb.com';Port=27660;User Id='kjd';Password='Temukjd0625';Charset=utf8mb4;" />-->
|
||||
<add name="ConnKJD" connectionString="Server=192.168.0.200;Port=3306;Database=mysql;Uid=root;Pwd=123456;"/>
|
||||
<add name="ConnKJD" connectionString="Max Pool Size=512;Database='kjd';Data Source='nj-cynosdbmysql-grp-hl51pkfr.sql.tencentcdb.com';Port=27660;User Id='kjd';Password='Temukjd0625';Charset=utf8mb4;" />
|
||||
<!--<add name="ConnKJD" connectionString="Server=192.168.0.200;Port=3306;Database=mysql;Uid=root;Pwd=123456;"/>-->
|
||||
<add name="ConnKJDBAK" connectionString="Max Pool Size=512;Database='kjd';Data Source='nj-cynosdbmysql-grp-9s7x16mt.sql.tencentcdb.com';Port=24049;User Id='kjdbak';Password='Temukjd0126';Charset=utf8mb4;" />
|
||||
<add name="UpdateVersion" connectionString="99999" />
|
||||
<add name="UpdateFileDir" connectionString="C:\inetpub\wwwroot\kjd_update" />
|
||||
|
||||
Reference in new issue
Block a user