优化售后单命名规则 产品入库时删除原商品详情内容节约空间
This commit is contained in:
1 parent
257262517b
commit
381332b7c8
19 files changed
+636
-49
No files matched your search
@@ -958,6 +958,25 @@ namespace KJD_Web.BLL.BXX
|
||||
mySql.Close();
|
||||
}
|
||||
}
|
||||
if (prod.product_json.Contains("\"source_json\"") && !prod.product_json.Contains("\"source_json\":null"))
|
||||
{
|
||||
mySql = new MysqlUtils(conn);
|
||||
try
|
||||
{
|
||||
JObject jObj = JsonUtils.JObjectParse(prod.product_json);
|
||||
jObj["source_json"] = null;
|
||||
var newProdJson = JsonUtils.SerializeObject(jObj);
|
||||
sql = "update bxx.product set product_json=@product_json where spu_id='" + prod.spu_id + "'";
|
||||
paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "product_json", Value = newProdJson, });
|
||||
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
prod.product_json = newProdJson;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
mySql.Close();
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(get_select_count))
|
||||
{
|
||||
|
||||
@@ -140,5 +140,78 @@ namespace KJD_Web.BLL
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
|
||||
|
||||
public string GetWxFindOrderUpdate(string inputData)
|
||||
{
|
||||
//string time1 = Encryption(time);
|
||||
//return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount
|
||||
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = 0;
|
||||
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
|
||||
var path = RegexUtils.GetStringQuery(ref inputData, "path");
|
||||
|
||||
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
|
||||
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
|
||||
var UpdateFileNewUrl = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateWxFindOrderUrl"].ConnectionString;
|
||||
var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString;
|
||||
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
|
||||
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["WxFindOrderLowVersion"].ConnectionString;
|
||||
|
||||
if (version > LowVersion.ParseToInt())
|
||||
{
|
||||
//if (path != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var fileDir = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateWxFindOrderFileDir"].ConnectionString;
|
||||
//if (path == "29wx")
|
||||
{
|
||||
var file = Directory.GetFiles(fileDir);
|
||||
var versionTmp = 0;
|
||||
foreach (var f in file)
|
||||
{
|
||||
var v = Path.GetFileName(f).Replace("WxFindOrderUpdate", "").Replace(".zip", "").ParseToInt();
|
||||
if (v > versionTmp && v <= serverVersion.ParseToInt())
|
||||
{
|
||||
versionTmp = v;
|
||||
}
|
||||
}
|
||||
if (versionTmp > 0)
|
||||
{
|
||||
serverVersion = versionTmp.ToString();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
|
||||
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFileNewUrl + "WxFindOrderUpdate" + serverVersion + ".zip\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//return "{\"code\":500,\"msg\":\"升级文件查询失败\"}";
|
||||
}
|
||||
}
|
||||
|
||||
if (serverVersion.ParseToInt() > 1159)
|
||||
serverVersion = 1159.ToString();
|
||||
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
|
||||
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateFileNewUrl + "WxFindOrderUpdate" + serverVersion + ".zip\"}";
|
||||
}
|
||||
else if (version > 0)
|
||||
{
|
||||
return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":502,\"msg\":\"get update version failed\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"未知错误\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using KJD_Web.Model.WxModel;
|
||||
using KJD_Web.Utils;
|
||||
using MySql.Data.MySqlClient;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
@@ -425,5 +426,360 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 微信添加修改采购映射商品(含sku映射和)
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXAddMdyBuyProdMap(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
// 软件用户名
|
||||
string spu_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_code"))?.Replace("'", "\\'");
|
||||
string sku_code = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_code"))?.Replace("'", "\\'");
|
||||
string user_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "main_user_name"))?.Replace("'", "\\'");
|
||||
string map_url = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "map_url"))?.Replace("'", "\\'");
|
||||
string map_goods_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "map_goods_name"))?.Replace("'", "\\'");
|
||||
string map_spec_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "map_spec_name"))?.Replace("'", "\\'");
|
||||
string map_goods_id = RegexUtils.GetStringQuery(ref inputData, "map_goods_id")?.Replace("'", "\\'");
|
||||
string map_sku_id = RegexUtils.GetStringQuery(ref inputData, "map_sku_id")?.Replace("'", "\\'");
|
||||
string map_send_address = RegexUtils.GetStringQuery(ref inputData, "map_send_address")?.Replace("'", "\\'");
|
||||
string transit_warehouse_id = RegexUtils.GetStringQuery(ref inputData, "transit_warehouse_id")?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(spu_code) || string.IsNullOrEmpty(sku_code))
|
||||
return "{\"code\":500,\"msg\":\"缺少系统商品或SKU编号\"}";
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
return "{\"code\":500,\"msg\":\"缺少用户名\"}";
|
||||
if (string.IsNullOrEmpty(map_url) && (string.IsNullOrEmpty(map_goods_id) || string.IsNullOrEmpty(map_sku_id)))
|
||||
return "{\"code\":500,\"msg\":\"缺少采购商品信息\"}";
|
||||
if (string.IsNullOrEmpty(transit_warehouse_id))
|
||||
return "{\"code\":500,\"msg\":\"缺少中转仓信息\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT 1 FROM `bxx`.`product_buy_map` where user_name='" + user_name + "' AND spu_code='" + spu_code + "' AND sku_code='" + sku_code + "'";
|
||||
string where = "";
|
||||
sql += where;
|
||||
var exist = mySql.ExecuteFirstInt(sql);
|
||||
if (!mySql.Message.IsNullOrEmpty())
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":501,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
|
||||
if (exist == 0)
|
||||
{
|
||||
sql = " INSERT INTO `bxx`.`product_buy_map` (user_name,spu_code,sku_code,map_url,map_goods_name,map_spec_name,map_goods_id,map_sku_id,map_send_address,transit_warehouse_id)" +
|
||||
" VALUES (@user_name,@spu_code,@sku_code,@map_url,@map_goods_name,@map_spec_name,@map_goods_id,@map_sku_id,@map_send_address,@transit_warehouse_id);";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "UPDATE `bxx`.`product_buy_map` SET ";
|
||||
if (map_url != null)
|
||||
sql += " map_url=@map_url,";
|
||||
if (map_goods_name != null)
|
||||
sql += " map_goods_name=@map_goods_name,";
|
||||
if (map_spec_name != null)
|
||||
sql += " map_spec_name=@map_spec_name,";
|
||||
if (map_goods_id != null)
|
||||
sql += " map_goods_id=@map_goods_id,";
|
||||
if (map_sku_id != null)
|
||||
sql += " map_sku_id=@map_sku_id,";
|
||||
if (map_send_address != null)
|
||||
sql += " map_send_address=@map_send_address,";
|
||||
if (transit_warehouse_id != null)
|
||||
sql += " transit_warehouse_id=@transit_warehouse_id,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " WHERE user_name=@user_name and spu_code=@spu_code and sku_code=@sku_code;";
|
||||
}
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "user_name", Value = user_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "spu_code", Value = spu_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "sku_code", Value = sku_code, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_url", Value = map_url, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_goods_name", Value = map_goods_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_spec_name", Value = map_spec_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_goods_id", Value = map_goods_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_sku_id", Value = map_sku_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "map_send_address", Value = map_send_address, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "transit_warehouse_id", Value = transit_warehouse_id, });
|
||||
mySql.ExecuteNonQuery(sql, paramLst.ToArray());
|
||||
mySql.Close();
|
||||
if (string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"\"}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信获取采购映射商品
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXGetBuyPordMap(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
string spu_codes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "spu_codes"))?.Replace("'", "\\'");
|
||||
string sku_codes = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "sku_codes"))?.Replace("'", "\\'");
|
||||
string user_name = RegexUtils.GetStringQuery(ref inputData, "main_user_name")?.Replace("'", "\\'");
|
||||
string not_count = RegexUtils.GetStringQuery(ref inputData, "not_count")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(spu_codes))
|
||||
return "{\"code\":500,\"msg\":\"商品编码不能为空\"}";
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
return "{\"code\":500,\"msg\":\"用户名不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "SELECT COUNT(*) FROM `bxx`.`product_buy_map` WHERE 1=1";
|
||||
string where = "";
|
||||
if (spu_codes != null)
|
||||
where += " and spu_code IN ('" + spu_codes.Replace(",", "','") + "')";
|
||||
if (sku_codes != null)
|
||||
where += " and sku_code IN ('" + sku_codes.Replace(",", "','") + "')";
|
||||
if (user_name != null)
|
||||
where += " and user_name='" + user_name + "'";
|
||||
sql += where;
|
||||
sql += ";";
|
||||
|
||||
if (not_count == "false")
|
||||
count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT * FROM `bxx`.`product_buy_map` WHERE 1=1";
|
||||
sql += where;
|
||||
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<WXBuyMapInfo> WXBuyMapInfoLst = new List<WXBuyMapInfo>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
WXBuyMapInfoLst.Add(new WXBuyMapInfo()
|
||||
{
|
||||
id = row["id"].ParseToInt(),
|
||||
user_name = row["user_name"].ParseToString(),
|
||||
spu_code = row["spu_code"].ParseToString(),
|
||||
sku_code = row["sku_code"].ParseToString(),
|
||||
map_url = row["map_url"].ParseToString(),
|
||||
map_goods_name = row["map_goods_name"].ParseToString(),
|
||||
map_spec_name = row["map_spec_name"].ParseToString(),
|
||||
map_goods_id = row["map_goods_id"].ParseToString(),
|
||||
map_sku_id = row["map_sku_id"].ParseToString(),
|
||||
map_send_address = row["map_send_address"].ParseToString(),
|
||||
transit_warehouse_id = row["transit_warehouse_id"].ParseToString(),
|
||||
add_time = Convert.ToDateTime(row["add_time"]),
|
||||
mdy_time = Convert.ToDateTime(row["mdy_time"]),
|
||||
});
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(WXBuyMapInfoLst, 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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取中转仓订单信息
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXGetTransitOrder(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
string order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_no"))?.Replace("'", "\\'");
|
||||
string order_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_sku_id"))?.Replace("'", "\\'");
|
||||
string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
|
||||
string not_count = RegexUtils.GetStringQuery(ref inputData, "not_count")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(order_no) && string.IsNullOrEmpty(out_order_no) && string.IsNullOrEmpty(order_sku_id))
|
||||
return "{\"code\":500,\"msg\":\"商品查询信息不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "SELECT COUNT(*) FROM `erp`.`oms_wei_external_procurement_log` WHERE 1=1";
|
||||
string where = "";
|
||||
if (order_no != null)
|
||||
where += " and order_no IN ('" + order_no.Replace(",", "','") + "')";
|
||||
if (order_sku_id != null)
|
||||
where += " and order_sku_id IN ('" + order_sku_id.Replace(",", "','") + "')";
|
||||
if (out_order_no != null)
|
||||
where += " and out_order_no IN ('" + out_order_no.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
sql += ";";
|
||||
|
||||
if (not_count == "false")
|
||||
count = mySql.ExecuteRowCount(sql);
|
||||
|
||||
DataTable dt;
|
||||
if (count == 0)
|
||||
{
|
||||
dt = new DataTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT * FROM `erp`.`oms_wei_external_procurement_log` WHERE 1=1";
|
||||
sql += where;
|
||||
sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
|
||||
dt = mySql.ExecuteDataTable(sql);
|
||||
}
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<oms_wei_external_procurement_log> oms_wei_external_procurement_log_list = new List<oms_wei_external_procurement_log>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
oms_wei_external_procurement_log_list.Add(new oms_wei_external_procurement_log()
|
||||
{
|
||||
id = row["id"].ParseToInt(),
|
||||
buyer_account = row["buyer_account"].ParseToString(),
|
||||
order_no = row["order_no"].ParseToString(),
|
||||
order_sku_id = row["order_sku_id"].ParseToString(),
|
||||
out_amount = row["out_amount"].ParseToNullableInt(),
|
||||
out_order_no = row["out_order_no"].ParseToString(),
|
||||
purchaser_note = row["purchaser_note"].ParseToString(),
|
||||
created_time = row["created_time"].ParseToString().ParseToDateTime(),
|
||||
express_1_company = row["express_1_company"].ParseToString(),
|
||||
express_1_waybill = row["express_1_waybill"].ParseToString(),
|
||||
express_2_company = row["express_2_company"].ParseToString(),
|
||||
express_2_waybill = row["express_2_waybill"].ParseToString(),
|
||||
order_code = row["order_code"].ParseToString(),
|
||||
order_platform_code = row["order_platform_code"].ParseToString(),
|
||||
pickup_time = row["pickup_time"].ParseToString().ParseToDateTime(),
|
||||
platform = row["platform"].ParseToString(),
|
||||
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
|
||||
raw_message = row["raw_message"].ParseToString(),
|
||||
refund_status = row["refund_status"].ParseToString(),
|
||||
transfer_warehouse_status = row["transfer_warehouse_status"].ParseToNullableInt(),
|
||||
updated_time = row["updated_time"].ParseToString().ParseToDateTime(),
|
||||
});
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(oms_wei_external_procurement_log_list, 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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改中转仓订单信息,临时补救
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXUpdateErpOrderExpress(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
string out_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "out_order_no"))?.Replace("'", "\\'");
|
||||
string express_1_company = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "express_1_company"))?.Replace("'", "\\'");
|
||||
string express_1_waybill = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "express_1_waybil"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(out_order_no))
|
||||
return "{\"code\":500,\"msg\":\"订单外部ID信息不能为空\"}";
|
||||
if (string.IsNullOrEmpty(express_1_company))
|
||||
return "{\"code\":500,\"msg\":\"物流公司不能为空\"}";
|
||||
if (string.IsNullOrEmpty(express_1_waybill))
|
||||
return "{\"code\":500,\"msg\":\"物流单号不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = " update `erp`.`oms_wei_external_procurement_log` ";
|
||||
sql += " set express_1_company='" + express_1_company + "',";
|
||||
sql += " express_1_waybill='" + express_1_waybill + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where out_order_no = '" + out_order_no + "';";
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\",\"affected_rows\":" + count + "}";
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\",\"affected_rows\":" + count + "}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,6 +130,7 @@
|
||||
<Compile Include="Model\PddModel\PDDProductPropertyInfo.cs" />
|
||||
<Compile Include="Model\ShopModel\JSTListProductSkuInfo.cs" />
|
||||
<Compile Include="Model\WXAddressInfo.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_external_procurement_log.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_order.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_order_item.cs" />
|
||||
<Compile Include="Model\WxModel\oms_wei_refund.cs" />
|
||||
|
||||
@@ -14,4 +14,27 @@ namespace KJD_Web.Model.WxModel
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
|
||||
public class WXBuyMapInfo
|
||||
{
|
||||
public long id { get; set; }
|
||||
public string user_name { get; set; }
|
||||
public string spu_code { get; set; }
|
||||
public string sku_code { get; set; }
|
||||
public string map_url { get; set; }
|
||||
public string map_goods_name { get; set; }
|
||||
/// <summary>
|
||||
/// sku规格名称
|
||||
/// </summary>
|
||||
public string map_spec_name { get; set; }
|
||||
public string map_goods_id { get; set; }
|
||||
public string map_sku_id { get; set; }
|
||||
/// <summary>
|
||||
/// 发货地(省,市)
|
||||
/// </summary>
|
||||
public string map_send_address { get; set; }
|
||||
public string transit_warehouse_id { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class oms_wei_external_procurement_log
|
||||
{
|
||||
public long id { get; set; }
|
||||
public string out_order_no { get; set; }
|
||||
public string order_no { get; set; }
|
||||
public string order_sku_id { get; set; }
|
||||
public string buyer_account { get; set; }
|
||||
public int? out_amount { get; set; }
|
||||
public string purchaser_note { get; set; }
|
||||
public string express_1_company { get; set; }
|
||||
public string express_1_waybill { get; set; }
|
||||
public string express_2_company { get; set; }
|
||||
public string express_2_waybill { get; set; }
|
||||
public string refund_status { get; set; }
|
||||
public DateTime pickup_time { get; set; }
|
||||
/// <summary>
|
||||
/// 中转仓状态:0 未使用,1 已创建,2 创建失败
|
||||
/// </summary>
|
||||
public int? transfer_warehouse_status { get; set; }
|
||||
public string raw_message { get; set; }
|
||||
public DateTime created_time { get; set; }
|
||||
public DateTime updated_time { get; set; }
|
||||
public string platform { get; set; }
|
||||
public string order_platform_code { get; set; }
|
||||
public string order_code { get; set; }
|
||||
/// <summary>
|
||||
/// 1正常取号 2提前取号
|
||||
/// </summary>
|
||||
public int? pre_allocated_order_no { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -78,5 +78,17 @@ namespace KJD_Web
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_wx_finder_order_update()
|
||||
{
|
||||
var jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new UpdateManage().GetWxFindOrderUpdate(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,5 +87,59 @@ namespace KJD_Web
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_mdy_buy_prod_map()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXAddMdyBuyProdMap(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
[WebMethod]
|
||||
public void wx_get_buy_prod_map()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetBuyPordMap(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取中转仓订单信息
|
||||
/// </summary>
|
||||
[WebMethod]
|
||||
public void wx_get_transit_order()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetTransitOrder(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取中转仓订单信息
|
||||
/// </summary>
|
||||
[WebMethod]
|
||||
public void wx_update_erp_order_express()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXUpdateErpOrderExpress(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,11 @@
|
||||
<add name="GetWXRecommendHotProdMinViewUv" connectionString="200"/>
|
||||
<add name="GetWXRecommendHotProdInterval" connectionString="3"/>
|
||||
<add name="IsKeepBase64UploadImgFile" connectionString="0"/>
|
||||
|
||||
<add name="UpdateWxFindOrderFileDir" connectionString="C:\inetpub\wwwroot\find_order_update"/>
|
||||
<add name="UpdateWxFindOrderUrl" connectionString="http://weidian.e57.cn/find_order_update/"/>
|
||||
<add name="WxFindOrderLimitVersion" connectionString="99"/>
|
||||
<add name="WxFindOrderLowVersion" connectionString="99"/>
|
||||
</connectionStrings>
|
||||
<!--
|
||||
有关 web.config 更改的说明,请参见 http://go.microsoft.com/fwlink/?LinkId=235367。
|
||||
|
||||
Reference in new issue
Block a user