Commit 0dad9369 by 泽锋 李

fix

parent dba00e9e
......@@ -74,7 +74,35 @@ namespace AutoTurnOver.DB
}
public static List<LmsShipLogisticsDto> RealTimeShipLogisticsCompanyList()
{
return RealTimeShipLogisticsList().GroupBy(s => new { s.Company_Code }).Select(s=>new LmsShipLogisticsDto { Company_Code = s.Key.Company_Code,Company_Name = s.Max(v=>v.Company_Name)}).ToList();
return RealTimeShipLogisticsList().GroupBy(s => new { s.Company_Code }).Select(s => new LmsShipLogisticsDto { Company_Code = s.Key.Company_Code, Company_Name = s.Max(v => v.Company_Name) }).ToList();
}
/// <summary>
/// 抓取sku 刊登状态
/// </summary>
/// <returns></returns>
public static List<api_pps_sku_status_response_dto.sku_dto> GetPPSSkuStatus(api_pps_sku_status_request_dto data)
{
try
{
//查询采购建议明细
string url = ConfigHelper.GetValue("PPSSkuStatus");
string resultStr = HttpHelper.Request(url, RequestType.POST, data.ToJson(), "application/json", timeout: 1000 * 60 * 60 * 24);
var result = resultStr.ToObj<api_pps_sku_status_response_dto>();
if (result == null)
{
return new List<api_pps_sku_status_response_dto.sku_dto>() { };
}
else
{
return result.result;
}
}
catch (Exception ex)
{
throw new Exception("pps sku 刊登状态接口异常: " + ex.Message);
throw new Exception("pps sku 刊登状态接口异常: " + ex.StackTrace);
}
}
}
}
......@@ -2581,6 +2581,11 @@ where 1=1
public static List<platform_type_website_dto> PlatformtypeWebsiteList(string platform_type)
{
return _connection.Query<platform_type_website_dto>(" select DISTINCT platform_type,website from dc_base_oms_order ").AsList();
}
public static List<string> BrandList()
{
return _connection.Query<string>(" SELECT DISTINCT brand FROM `dc_base_sku` ").AsList();
}
}
}
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models.ApiDto
{
/// <summary>
/// sku 刊登状态
/// </summary>
public class api_pps_sku_status_response_dto
{
public List<sku_dto> result { get; set; }
public class sku_dto
{
public string sku { get; set; }
/// <summary>
/// 平台
/// </summary>
public string platformDesc { get; set; }
/// <summary>
/// 站点
/// </summary>
public string site { get; set; }
/// <summary>
/// 状态 【上架 下架】
/// </summary>
public string statusDesc { get; set; }
}
}
public class api_pps_sku_status_request_dto
{
public List<string> sku { get; set; }
}
}
using AutoTurnOver.Services;
using AutoTurnOver.DB;
using AutoTurnOver.Services;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
......@@ -24,6 +25,12 @@ namespace AutoTurnOver.Purchase.AverageTarget
{
var now = DateTime.Now;
// 判断是不是指定的时间
if (now.Hour == 23 && now.Minute == 58)
{
Console.WriteLine($"开始同步sku刊登状态,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
daily.SynchroPPSSkuStatus();
Console.WriteLine($"结束同步sku刊登状态,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
if (now.Hour == 23 && now.Minute == 59)
{
Console.WriteLine($"开始采购平均值统计任务,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
using AutoTurnOver.Services;
using AutoTurnOver.DB;
using AutoTurnOver.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace AutoTurnOver.Purchase.AverageTarget
......@@ -20,7 +22,9 @@ namespace AutoTurnOver.Purchase.AverageTarget
{
Console.WriteLine("采购平均值计算任务启动...");
// 创建采购计划
PurchaseAverageTargetServices.Calculation();
Console.WriteLine($"开始同步sku刊登状态,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
daily.SynchroPPSSkuStatus();
Console.WriteLine($"结束同步sku刊登状态,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
......
{
"ConnectionStrings": {
"Default": "server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
{
"ConnectionStrings": {
"Default": "server=10.0.8.15;port=3306;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
{
"ConnectionStrings": {
"Default": "server=10.0.8.15;port=3306;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
}
},
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
\ No newline at end of file
......@@ -32,6 +32,11 @@ namespace AutoTurnOver.Services
public List<purchase_user_dto> SearchPurchaseUser(string name)
{
return DB.common.SearchPurchaseUser(name);
}
public List<string> BrandList()
{
return report.BrandList();
}
......
......@@ -175,6 +175,12 @@ namespace AutoTurnOver.Controllers
var datas = ApiServices.PlatformtypeWebsiteList(platform_type);
return new JsonResult(datas);
}
public JsonResult BrandList()
{
var datas = new CommonServices().BrandList();
return new JsonResult(datas);
}
/// <summary>
/// crm 自定义出信模板
......
......@@ -62,14 +62,14 @@ namespace AutoTurnOver.Controllers
/// <returns></returns>
[UseAction]
public JsonResult RealtimeList(int? monitor_status, int? searchType, string key_words, string warehousecode, string buyer_name, string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea, int? has_tort = null, string categoryIds = null,
DateTime? start_date = null,DateTime? end_date =null,DateTime? f_start_date = null, DateTime? f_end_date = null,int? product_type = null)
DateTime? start_date = null, DateTime? end_date = null, DateTime? f_start_date = null, DateTime? f_end_date = null, int? product_type = null)
{
try
{
var services = new DailyServices();
var total = 0;
var list = services.RealtimeList(monitor_status, searchType, key_words, warehousecode, supplier_name, offset, limit, ref total, warehousetype, warehousearea, order: order, sort: sort, has_tort: has_tort, categoryIds: categoryIds, buyer_name: buyer_name,start_date:start_date,end_date:end_date,f_start_date:f_start_date,f_end_date:f_end_date, product_type: product_type);
var list = services.RealtimeList(monitor_status, searchType, key_words, warehousecode, supplier_name, offset, limit, ref total, warehousetype, warehousearea, order: order, sort: sort, has_tort: has_tort, categoryIds: categoryIds, buyer_name: buyer_name, start_date: start_date, end_date: end_date, f_start_date: f_start_date, f_end_date: f_end_date, product_type: product_type);
return new JsonResult(new
{
......@@ -89,7 +89,7 @@ namespace AutoTurnOver.Controllers
}
public JsonResult RealtimeListSumFooter(int? monitor_status, int? searchType, string key_words, string warehousecode, string buyer_name, string supplier_name, int offset, int limit, string order, string sort, string warehousetype, int? warehousearea, int? has_tort = null, string categoryIds = null,
DateTime? start_date = null, DateTime? end_date = null, DateTime? f_start_date = null, DateTime? f_end_date = null,int? product_type = null)
DateTime? start_date = null, DateTime? end_date = null, DateTime? f_start_date = null, DateTime? f_end_date = null, int? product_type = null)
{
var services = new DailyServices();
......@@ -114,7 +114,7 @@ namespace AutoTurnOver.Controllers
{
var services = new DailyServices();
var total = 0;
var list = services.ShortagePushList(platform, bailun_sku, offset, limit, ref total, start_date,end_date,warehousecode, warehousetype, warehousearea);
var list = services.ShortagePushList(platform, bailun_sku, offset, limit, ref total, start_date, end_date, warehousecode, warehousetype, warehousearea);
return new JsonResult(new
{
rows = list,
......@@ -228,12 +228,28 @@ namespace AutoTurnOver.Controllers
}
public JsonResult GetListingStatusPage(int offset, int limit, string order, string sort,
DateTime? end_date, DateTime? start_date,string brand,int? has_tort,int? listing_status,int? warehousearea,int? source,string warehousetype,string warehouse_code)
DateTime? end_date, DateTime? start_date, string brand, int? has_tort, int? listing_status, int? warehousearea, int? source, string warehousetype, string warehouse_code, int? product_type)
{
try
{
var services = new StockMonitorService();
var page_data = services.GetListingStatusPage(new listing_status_view_search_dto {warehouse_code = warehouse_code, warehousetype = warehousetype, source = source, warehousearea = warehousearea, listing_status = listing_status, brand = brand, has_tort = has_tort, page = offset + 1, rows = limit, sidx = sort, sord = order, start_date = start_date, end_date = end_date });
var page_data = services.GetListingStatusPage(new listing_status_view_search_dto
{
product_type= product_type,
source = source,
warehouse_code = warehouse_code,
warehousetype = warehousetype,
warehousearea = warehousearea,
listing_status = listing_status,
brand = brand,
has_tort = has_tort,
page = offset + 1,
rows = limit,
sidx = sort,
sord = order,
start_date = start_date,
end_date = end_date
});
return new JsonResult(new
{
......
......@@ -23,7 +23,7 @@ namespace ResetOutofstock
// throw;
//}
report.ResetCashFlowData();
//report.ResetCashFlowData();
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
......
......@@ -10,5 +10,6 @@
"Defaultdatabase": "0"
},
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
......@@ -11,5 +11,6 @@
},
"PPS_ShortagePush": "http://bltpro.bailuntec.com/api/EbayTask/PushSkuEditQtyTask",
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
......@@ -10,5 +10,6 @@
"Defaultdatabase": 0
},
"WipStockUrl": "http://mjzz.bailuntec.com/api/FullStockPageList",
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics"
"Lms_GetLogistics": "http://lms.bailuntec.com/api/DataInfo/ApiLogistics/GetLogistics",
"PPSSkuStatus": "http://pps.bailuntec.com/Api/Centre/Publish/External/SkuStatus"
}
\ No newline at end of file
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