Commit 315f7968 by 泽锋 李

fix

parent 5ef638b6
......@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
namespace AutoTurnOver.DB
{
......@@ -82,7 +83,7 @@ namespace AutoTurnOver.DB
var parameters = $"";
if (requstData != null)
{
parameters = $"?RecordStatus={requstData.RecordStatus}&startPoint={requstData.startPoint}&platform={requstData.platform}&Line_Code={requstData.Line_Code}&country_code={requstData.country_code}&character_skus={requstData.character_skus}";
parameters = $"?RecordStatus={requstData.RecordStatus}&startPoint={requstData.startPoint}&platform={requstData.platform}&Line_Code={requstData.Line_Code}&country_code={requstData.country_code}&endCountries={requstData.endCountries}&character_skus={requstData.character_skus}&has_min_freight_unit_price={requstData.has_min_freight_unit_price}";
}
string resultStr = HttpHelper.Request(url+ parameters, RequestType.GET, "", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<LmsResultDto<List<LmsShipLogisticsDto>>>();
......@@ -520,27 +521,43 @@ namespace AutoTurnOver.DB
/// <returns></returns>
public static List<api_transport_count_order_transfer_dto> GetLmsTransportCountList(api_transport_count_order_transfer_query_dto data)
{
try
{
//查询采购建议明细
string url = ConfigHelper.GetValue("api_lms_transport_count_transfer_list");
string resultStr = HttpHelper.Request(url, RequestType.POST, data.ToJson(), entype: "application/json; charset=utf-8", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<List<api_transport_count_order_transfer_dto>>();
if (result == null)
{
return new List<api_transport_count_order_transfer_dto>() { };
}
else
{
return result;
}
}
catch (Exception ex)
{
return new List<api_transport_count_order_transfer_dto>();
//throw new Exception("lms 调拨单时效 接口异常: " + ex.Message);
//throw new Exception("lms 调拨单时效 接口异常: " + ex.StackTrace);
}
return MyMySqlConnection._connection.Query<api_transport_count_order_transfer_dto>(@"select
t2.sku as 'bailun_sku',
sum(t2.deliverycount) as 'product_count',
count(DISTINCT t1.`code`) as 'order_count',
sum(case when t1.transporttype='海运' then t2.deliverycount else 0 end) as 'product_count_2',
count(DISTINCT case when t1.transporttype='海运' then t1.`code` else null end) as 'order_count_2',
sum(case when t1.transporttype='空运' then t2.deliverycount else 0 end) as 'product_count_3',
count(DISTINCT case when t1.transporttype='空运' then t1.`code` else null end) as 'order_count_3'
from dc_base_transfer_info as t1
left join dc_base_transfer_info_skus as t2 on t1.dataid = t2.dataid
where t2.sku=@sku and t1.targetwareno=@targetwareno
", new {
sku= data.bailun_sku,
targetwareno = data.targetwareno
}).ToList();
//try
//{
// //查询采购建议明细
// string url = ConfigHelper.GetValue("api_lms_transport_count_transfer_list");
// string resultStr = HttpHelper.Request(url, RequestType.POST, data.ToJson(), entype: "application/json; charset=utf-8", timeout: 1000 * 60 * 60 * 24);
// var result = resultStr.ToObj<List<api_transport_count_order_transfer_dto>>();
// if (result == null)
// {
// return new List<api_transport_count_order_transfer_dto>() { };
// }
// else
// {
// return result;
// }
//}
//catch (Exception ex)
//{
// return new List<api_transport_count_order_transfer_dto>();
// //throw new Exception("lms 调拨单时效 接口异常: " + ex.Message);
// //throw new Exception("lms 调拨单时效 接口异常: " + ex.StackTrace);
//}
}
/// <summary>
/// 获取lms 的调拨单时效
......
......@@ -4080,6 +4080,9 @@ where t2.hq_type='fba仓'").ToList();
/// </summary>
public static void ResetTransExpectArrivaltime()
{
// 查询真实的调拨在途
var datas = _connection.Query<dc_base_trans_expectarrivaltime_temp>(@"select
t2.expectarrivaltime as 'expectarrivaltime',
......
......@@ -23,6 +23,12 @@ namespace AutoTurnOver.Models.ApiDto
/// 运输方式 0-不限 1-陆运 2-空运 3-海运
/// </summary>
public int? TransportType { get; set; }
/// <summary>
/// 最低运费单价
/// </summary>
public decimal? min_freight_unit_price { get; set; }
public decimal? min_freight_unit_weight { get; set; }
}
public class LmsResultDto<T>
......@@ -39,5 +45,6 @@ namespace AutoTurnOver.Models.ApiDto
public string country_code { get; set; } = "";
public string endCountries { get; set; } = "";
public string character_skus { get; set; } = "";
public bool has_min_freight_unit_price { get; set; } = false;
}
}
......@@ -10,7 +10,6 @@ namespace AutoTurnOver.Models.ApiDto
public class api_transport_count_order_transfer_dto
{
public string bailun_sku { get; set; }
public string country { get; set; }
public int product_count { get; set; }
public int order_count { get; set; }
/// <summary>
......@@ -36,6 +35,6 @@ namespace AutoTurnOver.Models.ApiDto
public class api_transport_count_order_transfer_query_dto
{
public string bailun_sku { get; set; }
public string country { get; set; }
public string targetwareno { get; set; }
}
}
......@@ -11,8 +11,9 @@ namespace AutoTurnOver.Models
public string bailun_sku { get; set; }
public string sku_title_cn { get; set; }
public decimal weight { get; set; }
public string category_name { get; set; }
public string unit_price { get; set; }
public decimal unit_price { get; set; }
public string seller_name { get; set; }
public string suppliers_name { get; set; }
public string buyer_name { get; set; }
......
......@@ -13,7 +13,7 @@ namespace AutoTurnOver.Models
{
public DateTime date { get; set; }
public string date_str { get {
return date.ToString("MM-dd"+$"{Sinicization(date.DayOfWeek)}");
return date.ToString("MM-dd"+$"({Sinicization(date.DayOfWeek)})");
} }
public decimal? val { get; set; }
......
......@@ -32,7 +32,7 @@ namespace AutoTurnOver.Purchase.AverageTarget
//report.ResetTransExpectArrivaltime();
//dc_auto_return_goods_config_dao.NewCalculation();
//PurchaseAverageTargetServices.Calculation("368720104", days: 360);
//PurchaseAverageTargetServices.CalculationTransfer("LM-EO-007", 360);
//PurchaseAverageTargetServices.CalculationTransfer("803597202", 360);
//PurchaseAverageTargetServices.CalculationTransfer(days: (360 * 3),has_transfer:true);
}
......
......@@ -550,7 +550,7 @@ where t1.bailun_sku=@bailun_sku and t1.warehouse_code=@warehouse_code and t1.isp
var lmsTransportCountDatas = ApiUtility.GetLmsTransportCountList(new Models.ApiDto.api_transport_count_order_transfer_query_dto
{
bailun_sku = skuItem.bailun_sku,
country = base_wa
targetwareno = skuItem.warehouse_code
});
if (lmsTransportCountDatas != null && lmsTransportCountDatas.Count>=1)
......
......@@ -679,5 +679,10 @@ namespace AutoTurnOver.Services
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
}
public List<transfer_profit_dto> TransferProfitList(string bailun_sku, string warehouse_code) {
return DB.dc_auto_turnover.TransferProfitList(bailun_sku, warehouse_code);
}
}
}
......@@ -57,6 +57,32 @@ namespace AutoTurnOver.Controllers
}
[HttpGet]
[BrowseLog("Bailun_aims", "触发【百伦自动周转系统】->【自动周转列表】->【空运海运利润计算】->【搜索】页面", 0)]
public JsonResult TransferProfitList(string bailun_sku, string warehouse_code)
{
try
{
var service = new Services.SkuAutoTurnServices();
var list = service.TransferProfitList(bailun_sku, warehouse_code);
return new JsonResult(new
{
rows = list
});
}
catch (Exception ex)
{
return new JsonResult(new
{
message = ex.Message,
stack_trace = ex.StackTrace
});
}
}
/// <summary>
/// 查看平均数的数据来源
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment