1服务功能 2用户商品备注并支持下拉框显示
This commit is contained in:
1 parent
bd3040efa3
commit
b4ec400796
33 files changed
+2597
-551
No files matched your search
@@ -1562,6 +1562,193 @@ namespace KJD_Web.BLL.BXX
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string GetProductNotes(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
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 user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
var add_user_name = RegexUtils.GetStringQuery(ref inputData, "add_user_name")?.Replace("'", "\\'");
|
||||
var is_get_detail = RegexUtils.GetStringQuery(ref inputData, "is_get_detail") == "true";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT p.* FROM `bxx`.`product_notes` p where 1=1 ";
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(add_user_name))
|
||||
{
|
||||
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.add_user_name in (" + add_user_name + ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
where += " and p.add_user_name='admin'";
|
||||
}
|
||||
sql += where;
|
||||
sql += " ORDER BY id DESC";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
JArray notesArr = new JArray();
|
||||
string notes_data = "";
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
notes_data += row["notes"].ToString() + ",";
|
||||
|
||||
if (is_get_detail)
|
||||
{
|
||||
JObject notesObj = new JObject();
|
||||
notesObj["id"] = row["id"].ParseToLong();
|
||||
notesObj["notes"] = row["notes"].ParseToString();
|
||||
notesObj["add_user_name"] = row["add_user_name"].ParseToString();
|
||||
notesArr.Add(notesObj);
|
||||
}
|
||||
}
|
||||
var data = notes_data.Trim(',');
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":\"" + data + "\",\"notes\":" + JsonUtils.SerializeObject(notesArr) + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string AddProductNotes(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
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 user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
var add_user_name = RegexUtils.GetStringQuery(ref inputData, "add_user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(add_user_name))
|
||||
{
|
||||
add_user_name = "admin";
|
||||
}
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(notes))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"未指定要新增的组\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "INSERT IGNORE INTO `bxx`.`product_notes` (notes,add_user_name) VALUES ('" + notes + "','" + add_user_name + "')";
|
||||
|
||||
var add_rows = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\", \"add_rows\":" + add_rows + "}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string DelProductNotes(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
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 user_name = RegexUtils.GetStringQuery(ref inputData, "user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
return "{\"code\":50001,\"msg\":\"没有用户名\"}";
|
||||
}
|
||||
|
||||
var add_user_name = RegexUtils.GetStringQuery(ref inputData, "add_user_name")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(add_user_name))
|
||||
{
|
||||
add_user_name = "admin";
|
||||
}
|
||||
var id = RegexUtils.GetStringQuery(ref inputData, "notes_id")?.Replace("'", "\\'");
|
||||
var notes = RegexUtils.GetStringQuery(ref inputData, "notes")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(id) && string.IsNullOrEmpty(notes))
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"未指定要删除的组\"}";
|
||||
}
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "DELETE FROM `bxx`.`product_notes` p where 1=1";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
id = "" + string.Join(",", id.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "";
|
||||
where += " and p.id in (" + id + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(notes))
|
||||
{
|
||||
notes = "'" + string.Join("','", notes.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.notes in (" + notes + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(add_user_name))
|
||||
{
|
||||
add_user_name = "'" + string.Join("','", add_user_name.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.add_user_name in (" + add_user_name + ")";
|
||||
}
|
||||
sql += where;
|
||||
|
||||
var del_rows = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
return "{\"code\":200,\"msg\":\"success\", \"del_rows\":" + del_rows + "}";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":\"\"}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string GetProductCates(string inputData)
|
||||
{
|
||||
return "{\"code\":19999,\"msg\":\"接口废弃\"}";
|
||||
@@ -1706,6 +1893,7 @@ namespace KJD_Web.BLL.BXX
|
||||
var in_spu_ids = RegexUtils.GetStringQuery(ref inputData, "in_spu_ids")?.Replace("'", "\\'");
|
||||
var in_skc_ids = RegexUtils.GetStringQuery(ref inputData, "in_skc_ids")?.Replace("'", "\\'");
|
||||
var in_groups = RegexUtils.GetStringQuery(ref inputData, "in_groups")?.Replace("'", "\\'");
|
||||
var in_notes = RegexUtils.GetStringQuery(ref inputData, "in_notes")?.Replace("'", "\\'");
|
||||
var product_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "product_name"))?.Replace("'", "\\'");
|
||||
var in_cates = RegexUtils.GetStringQuery(ref inputData, "in_cates")?.Replace("'", "\\'");
|
||||
var wx_cat_1 = RegexUtils.GetStringQuery(ref inputData, "wx_cat_1")?.Replace("'", "\\'");
|
||||
@@ -1775,6 +1963,11 @@ namespace KJD_Web.BLL.BXX
|
||||
in_groups = "'" + string.Join("','", in_groups.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.group in (" + in_groups + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(in_notes))
|
||||
{
|
||||
in_notes = "'" + string.Join("','", in_notes.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
where += " and p.notes in (" + in_notes + ")";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(in_cates))
|
||||
{
|
||||
in_cates = "'" + string.Join("','", in_cates.Split(new string[] { ",", ",", " " }, StringSplitOptions.RemoveEmptyEntries)) + "'";
|
||||
|
||||
@@ -18,10 +18,9 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var time = RegexUtils.GetStringQuery(ref inputData, "time").ParseToInt();
|
||||
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
|
||||
if (time1 != EncrypUtil.Encryption(time))
|
||||
return "{\"code\":50000,\"msg\":\"校验失败\"}";
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
var erp_shop_id_in = RegexUtils.GetStringQuery(ref inputData, "erp_shop_id_in")?.Replace("'", "\\'");
|
||||
var erp_order_id_in = RegexUtils.GetStringQuery(ref inputData, "erp_order_id_in")?.Replace("'", "\\'");
|
||||
@@ -54,9 +53,9 @@ namespace KJD_Web.BLL.WXXD
|
||||
if (!string.IsNullOrWhiteSpace(purchase_status))
|
||||
where += " and o.purchase_status = " + purchase_status;
|
||||
if (start_time > 0)
|
||||
where += " and o.create_time >= " + start_time;
|
||||
where += " and o.update_time >= " + start_time;
|
||||
if (end_time > 0)
|
||||
where += " and o.create_time <= " + end_time;
|
||||
where += " and o.update_time <= " + end_time;
|
||||
sql += where;
|
||||
|
||||
var count = 0;
|
||||
@@ -70,9 +69,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT o.* FROM" +
|
||||
" erp.oms_wei_order o " +
|
||||
" WHERE 1=1";
|
||||
sql = "SELECT o.* FROM erp.oms_wei_order o WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
@@ -167,7 +164,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(orderList, jsonSetting);
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + "}";
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -226,9 +224,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT o.* FROM" +
|
||||
" erp.oms_wei_order_item o " +
|
||||
" WHERE 1=1";
|
||||
sql = "SELECT o.* FROM erp.oms_wei_order_item o WHERE 1=1";
|
||||
|
||||
//where子句
|
||||
sql += where;
|
||||
@@ -695,7 +691,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
// 客戶端查兩次
|
||||
//if (is_admin == "true")
|
||||
//{
|
||||
// sql = "SELECT e.*,o.create_time as order_create_time FROM `erp`.`oms_wei_external_procurement_log` e LEFT JOIN `erp`.`oms_wei_order` ON e.order_no = o.order_id WHERE 1=1";
|
||||
// sql = "SELECT e.*,o.create_time as order_create_time FROM erp.oms_wei_external_procurement_log e LEFT JOIN erp.oms_wei_order ON e.order_no = o.order_id WHERE 1=1";
|
||||
// sql += where;
|
||||
// sql += " order by id desc limit " + Math.Max(0, page - 1) * page_size + "," + page_size + ";";
|
||||
//}
|
||||
@@ -928,7 +924,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = " update `erp`.`oms_wei_order` set ";
|
||||
sql = " update erp.oms_wei_order set ";
|
||||
if (soft_remark != null)
|
||||
sql += " soft_remark='" + soft_remark + "',";
|
||||
sql = sql.TrimEnd(',');
|
||||
@@ -968,6 +964,9 @@ namespace KJD_Web.BLL.WXXD
|
||||
string order_status_prompt = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_status_prompt"))?.Replace("'", "\\'");
|
||||
string after_sales_status = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "after_sales_status"))?.Replace("'", "\\'");
|
||||
string order_detail = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_detail"))?.Replace("'", "\\'");
|
||||
string wx_order_send_type = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_send_type"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(wx_order_send_type))
|
||||
wx_order_send_type = "1";
|
||||
if (string.IsNullOrEmpty(wx_order_id) || string.IsNullOrEmpty(pdd_order_sn))
|
||||
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
|
||||
|
||||
@@ -997,9 +996,9 @@ namespace KJD_Web.BLL.WXXD
|
||||
if (id == 0)
|
||||
{
|
||||
sql = "INSERT INTO wxxd.order_pdd_buyer_order (wx_order_id,wx_sku_id,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,order_sn,order_amount,order_time," +
|
||||
"outExpressCompanyCode,tracking_number,order_status_prompt,after_sales_status,order_detail)";
|
||||
"outExpressCompanyCode,tracking_number,order_status_prompt,after_sales_status,order_detail,wx_order_send_type)";
|
||||
sql += "VALUES(@wx_order_id,@wx_sku_id,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@pdd_order_sn,@order_amount,@order_time," +
|
||||
"@outExpressCompanyCode,@tracking_number,@order_status_prompt,@after_sales_status,@order_detail);";
|
||||
"@outExpressCompanyCode,@tracking_number,@order_status_prompt,@after_sales_status,@order_detail@wx_order_send_type);";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1030,6 +1029,8 @@ namespace KJD_Web.BLL.WXXD
|
||||
sql += " after_sales_status=@after_sales_status,";
|
||||
if (!string.IsNullOrEmpty(order_detail))
|
||||
sql += " order_detail=@order_detail,";
|
||||
if (!string.IsNullOrEmpty(wx_order_send_type))
|
||||
sql += " wx_order_send_type=@wx_order_send_type,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where order_sn=@pdd_order_sn";
|
||||
}
|
||||
@@ -1044,12 +1045,13 @@ namespace KJD_Web.BLL.WXXD
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerId", Value = buyerId, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerName", Value = buyerName, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "pdd_order_sn", Value = pdd_order_sn, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_amount", Value = order_amount, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "order_amount", Value = order_amount.ParseToNullableInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int64, ParameterName = "order_time", Value = order_time.ParseToLong(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "outExpressCompanyCode", Value = outExpressCompanyCode, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "tracking_number", Value = tracking_number, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_status_prompt", Value = order_status_prompt, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "after_sales_status", Value = after_sales_status.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "wx_order_send_type", Value = wx_order_send_type.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_detail", Value = order_detail, });
|
||||
//sql = " update `wxxd`.`order_pdd_buyer_order` set ";
|
||||
//if (!string.IsNullOrEmpty(soft_remark))
|
||||
@@ -1069,7 +1071,6 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string WXGetBuyerOrderList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -1133,7 +1134,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
try
|
||||
{
|
||||
List<order_pdd_buyer_order> refundItemList = new List<order_pdd_buyer_order>();
|
||||
List<order_pdd_buyer_order> buyerOrderList = new List<order_pdd_buyer_order>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
order_pdd_buyer_order order = new order_pdd_buyer_order
|
||||
@@ -1155,11 +1156,228 @@ namespace KJD_Web.BLL.WXXD
|
||||
TransitCreateTime = row["TransitCreateTime"].ParseToString().ParseToDateTime(),
|
||||
wx_order_id = row["wx_order_id"].ParseToString(),
|
||||
wx_sku_id = row["wx_sku_id"].ParseToString(),
|
||||
wx_order_send_type = row["wx_order_send_type"].ParseToNullableInt(),
|
||||
};
|
||||
refundItemList.Add(order);
|
||||
buyerOrderList.Add(order);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(refundItemList, jsonSetting);
|
||||
var data = JsonUtils.SerializeObjectToString(buyerOrderList, 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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string WXAddMdyBuyerAfterSale(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
string wx_order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
|
||||
string wx_sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
|
||||
string TransitCreateTime = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "TransitCreateTime"))?.Replace("'", "\\'");
|
||||
string pre_allocated_order_no = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "pre_allocated_order_no"))?.Replace("'", "\\'");
|
||||
string buyerId = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buyerId"))?.Replace("'", "\\'");
|
||||
string buyerName = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "buyerName"))?.Replace("'", "\\'");
|
||||
string orderSn = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "orderSn"))?.Replace("'", "\\'");
|
||||
string afterSalesId = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "afterSalesId"))?.Replace("'", "\\'");
|
||||
string orderAmount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "orderAmount"))?.Replace("'", "\\'");
|
||||
string orderDate = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "orderDate"))?.Replace("'", "\\'");
|
||||
string order_detail = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "order_detail"))?.Replace("'", "\\'");
|
||||
string refundAmount = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "refundAmount"))?.Replace("'", "\\'");
|
||||
string statusText = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "statusText"))?.Replace("'", "\\'");
|
||||
string afterSaleAddress = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "afterSaleAddress"))?.Replace("'", "\\'");
|
||||
string is_mdy = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "is_mdy"))?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(wx_order_id) || string.IsNullOrEmpty(orderSn) || string.IsNullOrEmpty(afterSalesId))
|
||||
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "select id from wxxd.order_pdd_buyer_after_sale where afterSalesId='" + afterSalesId + "'";
|
||||
var id = mySql.ExecuteFirstInt(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
|
||||
if (id == 0 && is_mdy != "true")
|
||||
{
|
||||
sql = "INSERT INTO wxxd.order_pdd_buyer_after_sale (wx_order_id,wx_sku_id,TransitCreateTime,pre_allocated_order_no,buyerId,buyerName,orderSn,afterSalesId,orderAmount,orderDate," +
|
||||
"refundAmount,statusText,afterSaleAddress,order_detail)";
|
||||
sql += "VALUES(@wx_order_id,@wx_sku_id,@TransitCreateTime,@pre_allocated_order_no,@buyerId,@buyerName,@orderSn,@afterSalesId,@orderAmount,@orderDate," +
|
||||
"@refundAmount,@statusText,@afterSaleAddress,@order_detail);";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "UPDATE wxxd.order_pdd_buyer_after_sale SET ";
|
||||
if (!string.IsNullOrEmpty(wx_order_id))
|
||||
sql += " wx_order_id=@wx_order_id,";
|
||||
if (!string.IsNullOrEmpty(wx_sku_id))
|
||||
sql += " wx_sku_id=@wx_sku_id,";
|
||||
if (!string.IsNullOrEmpty(TransitCreateTime))
|
||||
sql += " TransitCreateTime=@TransitCreateTime,";
|
||||
if (!string.IsNullOrEmpty(pre_allocated_order_no))
|
||||
sql += " pre_allocated_order_no=@pre_allocated_order_no,";
|
||||
if (!string.IsNullOrEmpty(buyerId))
|
||||
sql += " buyerId=@buyerId,";
|
||||
if (!string.IsNullOrEmpty(buyerName))
|
||||
sql += " buyerName=@buyerName,";
|
||||
if (!string.IsNullOrEmpty(orderSn))
|
||||
sql += " orderSn=@orderSn,";
|
||||
if (!string.IsNullOrEmpty(orderAmount))
|
||||
sql += " orderAmount=@orderAmount,";
|
||||
if (!string.IsNullOrEmpty(refundAmount))
|
||||
sql += " refundAmount=@refundAmount,";
|
||||
if (!string.IsNullOrEmpty(statusText))
|
||||
sql += " statusText=@statusText,";
|
||||
if (!string.IsNullOrEmpty(orderDate))
|
||||
sql += " orderDate=@orderDate,";
|
||||
if (!string.IsNullOrEmpty(afterSaleAddress))
|
||||
sql += " afterSaleAddress=@afterSaleAddress,";
|
||||
|
||||
if (!string.IsNullOrEmpty(order_detail))
|
||||
sql += " order_detail=@order_detail,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where afterSalesId=@afterSalesId";
|
||||
}
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_order_id", Value = wx_order_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "wx_sku_id", Value = wx_sku_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.DateTime, ParameterName = "TransitCreateTime", Value = TransitCreateTime.ParseToDateTime(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "pre_allocated_order_no", Value = pre_allocated_order_no.ParseToInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerId", Value = buyerId, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "buyerName", Value = buyerName, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "statusText", Value = statusText, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "orderSn", Value = orderSn, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "afterSalesId", Value = afterSalesId, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "refundAmount", Value = refundAmount.ParseToNullableInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "orderAmount", Value = orderAmount.ParseToNullableInt(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int64, ParameterName = "orderDate", Value = orderDate.ParseToLong(), });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "afterSaleAddress", Value = afterSaleAddress, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_detail", Value = order_detail, });
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
|
||||
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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetBuyerAfterSaleList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
var wx_order_id_in = RegexUtils.GetStringQuery(ref inputData, "wx_order_id_in")?.Replace("'", "\\'");
|
||||
var buyer_order_sn_in = RegexUtils.GetStringQuery(ref inputData, "buyer_order_sn_in")?.Replace("'", "\\'");
|
||||
if (wx_order_id_in.IsNullOrEmpty() && string.IsNullOrEmpty(buyer_order_sn_in))
|
||||
{
|
||||
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(500);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(id) FROM wxxd.order_pdd_buyer_after_sale o WHERE 1=1 ";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(wx_order_id_in))
|
||||
where += " and o.wx_order_id in ('" + wx_order_id_in.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrWhiteSpace(buyer_order_sn_in))
|
||||
where += " and o.order_sn in ('" + buyer_order_sn_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" +
|
||||
" wxxd.order_pdd_buyer_after_sale 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<order_pdd_buyer_after_sale> buyerAfterSaleLst = new List<order_pdd_buyer_after_sale>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
order_pdd_buyer_after_sale afterSale = new order_pdd_buyer_after_sale
|
||||
{
|
||||
id = row["id"].ParseToLong(),
|
||||
add_time = row["add_time"].ParseToString().ParseToDateTime(),
|
||||
afterSalesId = row["afterSalesId"].ParseToString(),
|
||||
buyerId = row["buyerId"].ParseToString(),
|
||||
buyerName = row["buyerName"].ParseToString(),
|
||||
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
|
||||
orderAmount = row["orderAmount"].ParseToNullableInt(),
|
||||
order_detail = row["order_detail"].ParseToString(),
|
||||
orderSn = row["orderSn"].ParseToString(),
|
||||
orderDate = row["orderDate"].ParseToNullableInt(),
|
||||
refundAmount = row["refundAmount"].ParseToNullableInt(),
|
||||
statusText = row["statusText"].ParseToString(),
|
||||
afterSaleAddress = row["afterSaleAddress"].ParseToString(),
|
||||
pre_allocated_order_no = row["pre_allocated_order_no"].ParseToNullableInt(),
|
||||
TransitCreateTime = row["TransitCreateTime"].ParseToString().ParseToDateTime(),
|
||||
wx_order_id = row["wx_order_id"].ParseToString(),
|
||||
wx_sku_id = row["wx_sku_id"].ParseToString(),
|
||||
};
|
||||
buyerAfterSaleLst.Add(afterSale);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(buyerAfterSaleLst, jsonSetting);
|
||||
var seconds = (DateTime.Now - timeCalc).TotalSeconds.ToString("0.000");
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + data + ",\"count\":" + count + ",\"seconds\":" + seconds + "}";
|
||||
}
|
||||
@@ -1292,7 +1510,11 @@ namespace KJD_Web.BLL.WXXD
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 订单异常重拍
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public string WXUpdateAbnormalTransitOrder(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
@@ -1326,7 +1548,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
|
||||
string sql;
|
||||
|
||||
sql = "INSERT INTO wxxd.order_abnormal_order_record (out_order_no,order_no,order_sku_id,buyer_account,out_amount,purchaser_note,refund_status,order_code) ";
|
||||
sql = "INSERT INTO wxxd.order_abnormal_transit_order_rebuy_record (out_order_no,order_no,order_sku_id,buyer_account,out_amount,purchaser_note,refund_status,order_code) ";
|
||||
sql += " VALUES('" + old_out_order_no + "','" + old_order_no + "','" + old_order_sku_id + "','" + old_buyer_account + "'," + old_out_amount + ",'" +
|
||||
old_purchaser_note + "','" + old_refund_status + "','" + order_code + "')";
|
||||
var rows = mySql.ExecuteAffectedRows(sql);
|
||||
@@ -1340,7 +1562,7 @@ namespace KJD_Web.BLL.WXXD
|
||||
{
|
||||
mySql.RollBack();
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"创建异常单记录失败\",\"affected_rows\":" + rows + "}";
|
||||
return "{\"code\":500,\"msg\":\"创建异常单重拍记录失败\",\"affected_rows\":" + rows + "}";
|
||||
}
|
||||
|
||||
sql = "UPDATE erp.oms_wei_external_procurement_log SET ";
|
||||
@@ -1372,5 +1594,242 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string WXAddOrderItemExtInfo(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
|
||||
string sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
|
||||
string shop_app_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_app_id"))?.Replace("'", "\\'");
|
||||
string shop_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_name"))?.Replace("'", "\\'");
|
||||
string abnormal_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "abnormal_text"))?.Replace("'", "\\'");
|
||||
string flag = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "flag"))?.Replace("'", "\\'");
|
||||
string label = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "label"))?.Replace("'", "\\'");
|
||||
string remark = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "remark"))?.Replace("'", "\\'");
|
||||
string after_sale_user_delivery_address = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "after_sale_user_delivery_address"))?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(order_id) || string.IsNullOrEmpty(sku_id))
|
||||
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "";
|
||||
var count = -1;
|
||||
|
||||
sql = "select id from wxxd.order_item_ext where order_id='" + order_id + "' and sku_id='" + sku_id + "'";
|
||||
var id = mySql.ExecuteFirstInt(sql);
|
||||
if (!string.IsNullOrEmpty(mySql.Message))
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
if (id > 0)
|
||||
{
|
||||
mySql.Close();
|
||||
return "{\"code\":500,\"msg\":\"订单已存在\"}";
|
||||
}
|
||||
|
||||
sql = "INSERT INTO wxxd.order_item_ext (order_id,sku_id,shop_app_id,shop_name,abnormal_text,flag,label,remark,after_sale_user_delivery_address)";
|
||||
sql += "VALUES(@order_id,@sku_id,@shop_app_id,@shop_name,@abnormal_text,@flag,@label,@remark,@after_sale_user_delivery_address);";
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_id", Value = order_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "sku_id", Value = sku_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_app_id", Value = shop_app_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_name", Value = shop_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "abnormal_text", Value = abnormal_text, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "flag", Value = flag, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "label", Value = label, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "remark", Value = remark, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "after_sale_user_delivery_address", Value = after_sale_user_delivery_address, });
|
||||
|
||||
count = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
|
||||
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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXMdyOrderItemExtInfo(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
string order_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_order_id"))?.Replace("'", "\\'");
|
||||
string sku_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "wx_sku_id"))?.Replace("'", "\\'");
|
||||
string shop_app_id = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_app_id"))?.Replace("'", "\\'");
|
||||
string shop_name = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "shop_name"))?.Replace("'", "\\'");
|
||||
string abnormal_text = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "abnormal_text"))?.Replace("'", "\\'");
|
||||
string flag = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "flag"))?.Replace("'", "\\'");
|
||||
string label = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "label"))?.Replace("'", "\\'");
|
||||
string remark = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "remark"))?.Replace("'", "\\'");
|
||||
string after_sale_user_delivery_address = HtmlUtils.UrlDecodeUtf8(RegexUtils.GetStringQuery(ref inputData, "after_sale_user_delivery_address"))?.Replace("'", "\\'");
|
||||
|
||||
if (string.IsNullOrEmpty(order_id))
|
||||
return "{\"code\":500,\"msg\":\"订单ID不能为空\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "UPDATE wxxd.order_item_ext SET ";
|
||||
if (!string.IsNullOrEmpty(shop_app_id))
|
||||
sql += " shop_app_id=@shop_app_id,";
|
||||
if (!string.IsNullOrEmpty(shop_name))
|
||||
sql += " shop_name=@shop_name,";
|
||||
if (abnormal_text != null)
|
||||
sql += " abnormal_text=@abnormal_text,";
|
||||
if (!string.IsNullOrEmpty(flag))
|
||||
sql += " flag=@flag,";
|
||||
if (label != null)
|
||||
sql += " label=@label,";
|
||||
if (remark != null)
|
||||
sql += " remark=@remark,";
|
||||
if (!string.IsNullOrEmpty(after_sale_user_delivery_address))
|
||||
sql += " after_sale_user_delivery_address=@after_sale_user_delivery_address,";
|
||||
sql = sql.TrimEnd(',');
|
||||
sql += " where 1=1";
|
||||
if (!string.IsNullOrEmpty(order_id))
|
||||
sql += " and order_id=@order_id,";
|
||||
if (!string.IsNullOrEmpty(sku_id))
|
||||
sql += " and sku_id=@sku_id,";
|
||||
|
||||
List<MySqlParameter> paramLst = new List<MySqlParameter>();
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "order_id", Value = order_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "sku_id", Value = sku_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_app_id", Value = shop_app_id, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "shop_name", Value = shop_name, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "abnormal_text", Value = abnormal_text, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.Int32, ParameterName = "flag", Value = flag, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "label", Value = label, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "remark", Value = remark, });
|
||||
paramLst.Add(new MySqlParameter() { DbType = DbType.String, ParameterName = "after_sale_user_delivery_address", Value = after_sale_user_delivery_address, });
|
||||
|
||||
var count = mySql.ExecuteAffectedRows(sql, paramLst.ToArray());
|
||||
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\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetOrderItemExtInfoList(string inputData, bool isDetail = false)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
var timeCalc = DateTime.Now;
|
||||
|
||||
var wx_order_id_in = RegexUtils.GetStringQuery(ref inputData, "wx_order_id_in")?.Replace("'", "\\'");
|
||||
var wx_sku_id = RegexUtils.GetStringQuery(ref inputData, "wx_sku_id_in")?.Replace("'", "\\'");
|
||||
if (wx_order_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(500);
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT COUNT(id) FROM wxxd.order_item_ext o WHERE 1=1 ";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrWhiteSpace(wx_order_id_in))
|
||||
where += " and o.order_id in ('" + wx_order_id_in.Replace(",", "','") + "')";
|
||||
if (!string.IsNullOrWhiteSpace(wx_sku_id))
|
||||
where += " and o.sku_id in ('" + wx_sku_id.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" +
|
||||
" wxxd.order_item_ext 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<order_item_ext> buyerOrderList = new List<order_item_ext>();
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
order_item_ext order = new order_item_ext
|
||||
{
|
||||
id = row["id"].ParseToLong(),
|
||||
add_time = row["add_time"].ParseToString().ParseToDateTime(),
|
||||
abnormal_text = row["abnormal_text"].ParseToString(),
|
||||
after_sale_user_delivery_address = row["after_sale_user_delivery_address"].ParseToString(),
|
||||
flag = row["flag"].ParseToNullableInt(),
|
||||
mdy_time = row["mdy_time"].ParseToString().ParseToDateTime(),
|
||||
label = row["label"].ParseToString(),
|
||||
order_id = row["order_id"].ParseToString(),
|
||||
remark = row["remark"].ParseToString(),
|
||||
shop_app_id = row["shop_app_id"].ParseToString(),
|
||||
shop_name = row["shop_name"].ParseToString(),
|
||||
sku_id = row["sku_id"].ParseToString(),
|
||||
};
|
||||
buyerOrderList.Add(order);
|
||||
}
|
||||
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||
var data = JsonUtils.SerializeObjectToString(buyerOrderList, 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\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,6 +290,42 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_product_notes()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().GetProductNotes(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void add_product_notes()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().AddProductNotes(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void del_product_notes()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new BXXProductManage().DelProductNotes(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_pdd_product_cates()
|
||||
{
|
||||
|
||||
@@ -138,6 +138,8 @@
|
||||
<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" />
|
||||
<Compile Include="Model\WxModel\order_item_ext.cs" />
|
||||
<Compile Include="Model\WxModel\order_pdd_buyer_after_sale.cs" />
|
||||
<Compile Include="Model\WxModel\order_pdd_buyer_order.cs" />
|
||||
<Compile Include="Model\WxModel\user_payment_record_info.cs" />
|
||||
<Compile Include="Model\WxModel\user_points_record_info.cs" />
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class order_item_ext
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public string order_id { get; set; }
|
||||
public string sku_id { get; set; }
|
||||
public string shop_app_id { get; set; }
|
||||
public string shop_name { get; set; }
|
||||
/// <summary>
|
||||
/// 订单异常文本
|
||||
/// </summary>
|
||||
public string abnormal_text { get; set; }
|
||||
public int? flag { get; set; }
|
||||
public string label { get; set; }
|
||||
public string remark { get; set; }
|
||||
public string after_sale_user_delivery_address { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class order_pdd_buyer_after_sale
|
||||
{
|
||||
public long? id { get; set; }
|
||||
public string wx_order_id { get; set; }
|
||||
public string wx_sku_id { get; set; }
|
||||
public DateTime TransitCreateTime { get; set; }
|
||||
//public DateTime TransitPickupTime { get; set; }
|
||||
public int? pre_allocated_order_no { get; set; }
|
||||
public string buyerId { get; set; }
|
||||
public string buyerName { get; set; }
|
||||
public string afterSalesId { get; set; }
|
||||
public string orderSn { get; set; }
|
||||
public int? orderAmount { get; set; }
|
||||
public long? refundAmount { get; set; }
|
||||
public long? orderDate { get; set; }
|
||||
public string statusText { get; set; }
|
||||
public string afterSaleAddress { get; set; }
|
||||
public string order_detail { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ namespace KJD_Web.Model.WxModel
|
||||
/// </summary>
|
||||
public string order_status_prompt { get; set; }
|
||||
public int? after_sales_status { get; set; }
|
||||
public int? wx_order_send_type { get; set; }
|
||||
public string order_detail { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
|
||||
@@ -222,6 +222,30 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_mdy_buyer_after_sale()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXAddMdyBuyerAfterSale(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_get_buyer_after_sale_list()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetBuyerAfterSaleList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
|
||||
[WebMethod]
|
||||
@@ -248,5 +272,42 @@ namespace KJD_Web
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_order_item_ext_info()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXAddOrderItemExtInfo(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_mdy_order_item_ext_info()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXMdyOrderItemExtInfo(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_get_order_item_ext_info()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXOrderManage().WXGetOrderItemExtInfoList(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user