订单服务端相关功能
This commit is contained in:
1 parent
b064af6379
commit
257262517b
6 files changed
+285
-2
No files matched your search
@@ -137,6 +137,7 @@ namespace KJD_Web.BLL.WXXD
|
|||||||
postal_code = row["postal_code"].ParseToString(),
|
postal_code = row["postal_code"].ParseToString(),
|
||||||
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
|
predict_commission_fee = row["predict_commission_fee"].ParseToNullableInt(),
|
||||||
product_price = row["product_price"].ParseToNullableInt(),
|
product_price = row["product_price"].ParseToNullableInt(),
|
||||||
|
profit = row["profit"].ParseToNullableInt(),
|
||||||
province_name = row["province_name"].ParseToString(),
|
province_name = row["province_name"].ParseToString(),
|
||||||
purchase_price = row["purchase_price"].ParseToNullableInt(),
|
purchase_price = row["purchase_price"].ParseToNullableInt(),
|
||||||
purchase_status = row["purchase_status"].ParseToNullableInt(),
|
purchase_status = row["purchase_status"].ParseToNullableInt(),
|
||||||
@@ -275,7 +276,7 @@ namespace KJD_Web.BLL.WXXD
|
|||||||
refund_status = row["refund_status"].ParseToNullableInt(),
|
refund_status = row["refund_status"].ParseToNullableInt(),
|
||||||
return_address = row["return_address"].ParseToString(),
|
return_address = row["return_address"].ParseToString(),
|
||||||
sale_price = row["sale_price"].ParseToNullableInt(),
|
sale_price = row["sale_price"].ParseToNullableInt(),
|
||||||
sku_attrs = row["sale_price"].ParseToString(),
|
sku_attrs = row["sku_attrs"].ParseToString(),
|
||||||
sku_cnt = row["sku_cnt"].ParseToNullableInt(),
|
sku_cnt = row["sku_cnt"].ParseToNullableInt(),
|
||||||
sku_code = row["sku_code"].ParseToString(),
|
sku_code = row["sku_code"].ParseToString(),
|
||||||
sku_deliver_info = row["sku_deliver_info"].ParseToString(),
|
sku_deliver_info = row["sku_deliver_info"].ParseToString(),
|
||||||
@@ -303,5 +304,126 @@ namespace KJD_Web.BLL.WXXD
|
|||||||
}
|
}
|
||||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string WXGetErpRefundList(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("'", "\\'");
|
||||||
|
if (erp_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 erp.oms_wei_refund o WHERE 1=1 ";
|
||||||
|
|
||||||
|
string where = "";
|
||||||
|
if (!string.IsNullOrWhiteSpace(erp_order_id_in))
|
||||||
|
where += " and o.order_id in ('" + erp_order_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_refund 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_refund> refundItemList = new List<oms_wei_refund>();
|
||||||
|
foreach (DataRow row in dt.Rows)
|
||||||
|
{
|
||||||
|
oms_wei_refund order = new oms_wei_refund
|
||||||
|
{
|
||||||
|
id = row["id"].ParseToLong(),
|
||||||
|
merchant_id = row["merchant_id"].ParseToLong(),
|
||||||
|
order_id = row["order_id"].ParseToString(),
|
||||||
|
shop_id = row["shop_id"].ParseToLong(),
|
||||||
|
erp_goods_id = row["erp_goods_id"].ParseToNullableLong(),
|
||||||
|
erp_goods_sku_id = row["erp_goods_sku_id"].ParseToNullableLong(),
|
||||||
|
product_id = row["product_id"].ParseToString(),
|
||||||
|
sku_id = row["sku_id"].ParseToString(),
|
||||||
|
after_sale_order_id = row["after_sale_order_id"].ParseToString(),
|
||||||
|
complaint_id = row["complaint_id"].ParseToString(),
|
||||||
|
count = row["count"].ParseToNullableInt(),
|
||||||
|
create_time = row["create_time"].ParseToNullableInt(),
|
||||||
|
details = row["details"].ParseToString(),
|
||||||
|
fast_refund = row["fast_refund"].ParseToString(),
|
||||||
|
merchant_upload_info = row["merchant_upload_info"].ParseToString(),
|
||||||
|
openid = row["openid"].ParseToString(),
|
||||||
|
pull_status = row["pull_status"].ParseToNullableInt(),
|
||||||
|
pull_time = row["pull_time"].ParseToString().ParseToDateTime(),
|
||||||
|
reason = row["reason"].ParseToString(),
|
||||||
|
reason_text = row["reason_text"].ParseToString(),
|
||||||
|
refund_amount = row["refund_amount"].ParseToNullableInt(),
|
||||||
|
refund_reason = row["refund_reason"].ParseToNullableInt(),
|
||||||
|
refund_resp = row["refund_resp"].ParseToString(),
|
||||||
|
return_delivery_id = row["return_delivery_id"].ParseToString(),
|
||||||
|
return_delivery_name = row["return_delivery_name"].ParseToString(),
|
||||||
|
return_waybill_id = row["return_waybill_id"].ParseToString(),
|
||||||
|
status = row["status"].ParseToString(),
|
||||||
|
type = row["type"].ParseToString(),
|
||||||
|
unionid = row["unionid"].ParseToString(),
|
||||||
|
update_time = row["update_time"].ParseToNullableInt(),
|
||||||
|
warehouse_status = row["warehouse_status"].ParseToNullableInt(),
|
||||||
|
};
|
||||||
|
refundItemList.Add(order);
|
||||||
|
}
|
||||||
|
JsonSerializerSettings jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||||
|
var data = JsonUtils.SerializeObjectToString(refundItemList, 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\":\"输入为空\"}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,6 +132,7 @@
|
|||||||
<Compile Include="Model\WXAddressInfo.cs" />
|
<Compile Include="Model\WXAddressInfo.cs" />
|
||||||
<Compile Include="Model\WxModel\oms_wei_order.cs" />
|
<Compile Include="Model\WxModel\oms_wei_order.cs" />
|
||||||
<Compile Include="Model\WxModel\oms_wei_order_item.cs" />
|
<Compile Include="Model\WxModel\oms_wei_order_item.cs" />
|
||||||
|
<Compile Include="Model\WxModel\oms_wei_refund.cs" />
|
||||||
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
|
<Compile Include="Model\WxModel\WXBuyUrlNotesInfo.cs" />
|
||||||
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
|
<Compile Include="Model\WxModel\WXClientProductInfoLite.cs" />
|
||||||
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
|
<Compile Include="Model\WxModel\WXGetEditProductInfoLite.cs" />
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<IISExpressWindowsAuthentication />
|
<IISExpressWindowsAuthentication />
|
||||||
<IISExpressUseClassicPipelineMode />
|
<IISExpressUseClassicPipelineMode />
|
||||||
<UseGlobalApplicationHostFile />
|
<UseGlobalApplicationHostFile />
|
||||||
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
|
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
|
||||||
<ProjectView>ShowAllFiles</ProjectView>
|
<ProjectView>ShowAllFiles</ProjectView>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ProjectExtensions>
|
<ProjectExtensions>
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ namespace KJD_Web.Model.WxModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int? discounted_price { get; set; }
|
public int? discounted_price { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 利润(实付金额-采购价-平台服务费-达人佣金,达人佣金、采购价为空值则为0)
|
||||||
|
/// </summary>
|
||||||
|
public int? profit { get; set; }
|
||||||
|
/// <summary>
|
||||||
/// 采购状态,默认值为:0未采购,推送仓库时修改为1采购
|
/// 采购状态,默认值为:0未采购,推送仓库时修改为1采购
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? purchase_status { get; set; }
|
public int? purchase_status { get; set; }
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace KJD_Web.Model.WxModel
|
||||||
|
{
|
||||||
|
public class oms_wei_refund
|
||||||
|
{
|
||||||
|
public long id { get; set; }
|
||||||
|
public long? shop_id { get; set; }
|
||||||
|
public string after_sale_order_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后单当前状态,参考:
|
||||||
|
/// USER_CANCELD 用户取消申请
|
||||||
|
/// MERCHANT_PROCESSING 商家受理中
|
||||||
|
/// MERCHANT_REJECT_REFUND 商家拒绝退款
|
||||||
|
/// MERCHANT_REJECT_RETURN 商家拒绝退货退款
|
||||||
|
/// USER_WAIT_RETURN 待买家退货
|
||||||
|
/// RETURN_CLOSED 退货退款关闭
|
||||||
|
/// MERCHANT_WAIT_RECEIPT 待商家收货
|
||||||
|
/// MERCHANT_OVERDUE_REFUND 商家逾期未退款
|
||||||
|
/// MERCHANT_REFUND_SUCCESS 退款完成
|
||||||
|
/// MERCHANT_RETURN_SUCCESS 退货退款完成
|
||||||
|
/// PLATFORM_REFUNDING 平台退款中
|
||||||
|
/// PLATFORM_REFUND_FAIL 平台退款失败
|
||||||
|
/// USER_WAIT_CONFIRM 待用户确认
|
||||||
|
/// MERCHANT_REFUND_RETRY_FAIL 商家打款失败,客服关闭售后
|
||||||
|
/// MERCHANT_FAIL 售后关闭
|
||||||
|
/// USER_WAIT_CONFIRM_UPDATE 待用户处理商家协商
|
||||||
|
/// USER_WAIT_HANDLE_MERCHANT_AFTER_SALE 待用户处理商家代发起的售后申请
|
||||||
|
/// </summary>
|
||||||
|
public string status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 买家身份标识
|
||||||
|
/// </summary>
|
||||||
|
public string openid { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 买家在开放平台的唯一标识符,若当前视频号小店已绑定到微信开放平台账号下会返回
|
||||||
|
/// </summary>
|
||||||
|
public string unionid { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 商品spuid
|
||||||
|
/// </summary>
|
||||||
|
public string product_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 商品skuid
|
||||||
|
/// </summary>
|
||||||
|
public string sku_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后数量
|
||||||
|
/// </summary>
|
||||||
|
public int? count { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否极速退款RefundInfo
|
||||||
|
/// </summary>
|
||||||
|
public string fast_refund { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 标明售后单退款直接原因, 枚举值参考 RefundReason
|
||||||
|
/// </summary>
|
||||||
|
public int? refund_reason { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 退款金额(分)
|
||||||
|
/// </summary>
|
||||||
|
public int? refund_amount { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 退款快递单号
|
||||||
|
/// </summary>
|
||||||
|
public string return_waybill_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物流公司id
|
||||||
|
/// </summary>
|
||||||
|
public string return_delivery_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 物流公司名称
|
||||||
|
/// </summary>
|
||||||
|
public string return_delivery_name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后相关商品信息JSON
|
||||||
|
/// </summary>
|
||||||
|
public string merchant_upload_info { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后单创建时间戳
|
||||||
|
/// </summary>
|
||||||
|
public int? create_time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后单更新时间戳
|
||||||
|
/// </summary>
|
||||||
|
public int? update_time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 退款原因
|
||||||
|
/// </summary>
|
||||||
|
public string reason { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 退款原因解释
|
||||||
|
/// </summary>
|
||||||
|
public string reason_text { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 售后类型。REFUND:退款;RETURN:退货退款。
|
||||||
|
/// </summary>
|
||||||
|
public string type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 订单号,该字段可用于获取订单
|
||||||
|
/// </summary>
|
||||||
|
public string order_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// detail json
|
||||||
|
/// </summary>
|
||||||
|
public string details { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 纠纷id,该字段可用于获取纠纷信息
|
||||||
|
/// </summary>
|
||||||
|
public string complaint_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 微信支付退款的响应
|
||||||
|
/// </summary>
|
||||||
|
public string refund_resp { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 推送状态(0未推送;1推送成功;2推送失败)
|
||||||
|
/// </summary>
|
||||||
|
public int? pull_status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 订单审核时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime pull_time { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 商品id(o_goods外键)
|
||||||
|
/// </summary>
|
||||||
|
public long? erp_goods_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 商品skuid(o_goods_sku外键)
|
||||||
|
/// </summary>
|
||||||
|
public long? erp_goods_sku_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 商户id
|
||||||
|
/// </summary>
|
||||||
|
public long merchant_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库受理状态
|
||||||
|
/// </summary>
|
||||||
|
public int? warehouse_status { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,5 +74,18 @@ namespace KJD_Web
|
|||||||
Context.Response.Write(result);
|
Context.Response.Write(result);
|
||||||
Context.Response.End();
|
Context.Response.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public void get_refund_list()
|
||||||
|
{
|
||||||
|
|
||||||
|
string jsontext = GetRequestJsonString();
|
||||||
|
|
||||||
|
var result = jsontext;
|
||||||
|
result = new WXOrderManage().WXGetErpRefundList(jsontext);
|
||||||
|
|
||||||
|
Context.Response.Write(result);
|
||||||
|
Context.Response.End();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user