把接口打印修改成日志记录

This commit is contained in:
曾艳 2024-07-11 17:40:29 +08:00
parent 5d38e1a413
commit 14ce0f5fad
8 changed files with 22 additions and 22 deletions

View File

@ -27,7 +27,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetList(string monotorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据企业id获取相机列表 GetList");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据企业id获取相机列表 GetList");
//获取公司所有相机信息
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list = bll_camera.GetModelList(string.Format("MONITOR_ID = '{0}'", monotorId)).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));

View File

@ -29,7 +29,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetNum()
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取福州海关所有监管企业总数 GetNum");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取福州海关所有监管企业总数 GetNum");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//查询企业表所有数据
var list = bll.GetModelList("");
@ -74,7 +74,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetInfo(string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据企业id获取企业信息 GetInfo");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据企业id获取企业信息 GetInfo");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var tmp = bll.GetModel(monitorId);
@ -89,7 +89,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetAllPosition(string customCodes)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取关区下所有企业图标的经纬度 GetAllPosition");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取关区下所有企业图标的经纬度 GetAllPosition");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
string[] customlist=customCodes.Split(',');
var list =bll_version.GetListByCustom(customlist);

View File

@ -24,7 +24,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetAll()
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取福州所有关区 GetAll");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取福州所有关区 GetAll");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list= bll_custom.GetModelList("").FindAll(a=>Tool.IsFuZhouCustom(a.CUSTOMS_CODE));

View File

@ -34,7 +34,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetGoodNumByYear(int year)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:全年进出口商品种类 GetGoodNumByYear");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年进出口商品种类 GetGoodNumByYear");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//福州海关下的,本年度,按货种分类
var list_good = bll_good.GetModelList("");
@ -143,7 +143,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetLastNum()
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:在库总量 GetLastNum");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:在库总量 GetLastNum");
//在库总量
decimal num = 0;
var mysql = Configuration.GetConnectionString("MySQL").ToString();
@ -169,7 +169,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetBoCiByYear(int year)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:全年累计进出口传播艘次 GetBoCiByYear");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年累计进出口传播艘次 GetBoCiByYear");
//全年累计进出口传播艘次
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//按年度福州海关下的按VOYAGE_NO+SHIP_NAME_EN 航次+船名算一个艘次
@ -203,7 +203,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetInNumByYear(int year)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:全年累计进口总量,按年度查询 GetInNumByYear");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年累计进口总量,按年度查询 GetInNumByYear");
//全年累计进口总量,按年度查询
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//按年度福州海关下的进口BILL_GROSS_WT提单毛重即入库数量
@ -239,7 +239,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetInNumWithCurrent()
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:本年度和本季度进口总量 GetInNumWithCurrent");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:本年度和本季度进口总量 GetInNumWithCurrent");
//本年度,本季度进口总量
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//本年度福州海关下的进口BILL_GROSS_WT提单毛重即入库数量

View File

@ -25,7 +25,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult Index()
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取企业接口 Index");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取企业接口 Index");
//读取配置文件示例
var mysql = Configuration.GetConnectionString("MySQL").ToString();

View File

@ -39,7 +39,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetInfo(string pipeCode,string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据皮带秤编码和企业id获取皮带秤信息 GetInfo");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据皮带秤编码和企业id获取皮带秤信息 GetInfo");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var pipe = bll_elec_weighter.GetModel(pipeCode, monitorId);
if (Tool.IsFuZhouCustom(pipe.CUSTOMS_CODE))
@ -60,7 +60,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetList(string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据企业id获取皮带秤列表 GetList");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据企业id获取皮带秤列表 GetList");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list = bll_elec_weighter.GetModelList(string.Format("MONITOR_ID = '{0}'", monitorId)).FindAll(a=>Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
return Json(Tool.GetJsonWithCode(APICode.Success, list));
@ -74,7 +74,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetRealTimeData(string pipeCode)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取一个皮带秤实时数据 GetRealTimeData");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取一个皮带秤实时数据 GetRealTimeData");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var tmp=bll_pipeReal.GetModel(pipeCode);
return Json(Tool.GetJsonWithCode(APICode.Success, tmp));
@ -88,7 +88,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetRealTimeDataByMonitorId(string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据企业id获取所有皮带秤实时数据 GetRealTimeDataByMonitorId");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据企业id获取所有皮带秤实时数据 GetRealTimeDataByMonitorId");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var tmp = bll_pipeReal.GetModelList(string.Format("MONITOR_ID = '{0}'",monitorId));
return Json(Tool.GetJsonWithCode(APICode.Success, tmp));
@ -102,7 +102,7 @@ namespace CompetitionAPI.Controllers.api
[HttpPost]
public JsonResult GetHistroyData([FromBody] RequestHistoryData req)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取一个皮带秤历史数据列表(按时间倒序,间隔筛选出N条) GetHistroyData");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取一个皮带秤历史数据列表(按时间倒序,间隔筛选出N条) GetHistroyData");
if (!string.IsNullOrEmpty(req.pipeCode) && req.startTime != null && req.endTime != null && req.startTime<=req.endTime)
{
var mysql = Configuration.GetConnectionString("MySQL").ToString();

View File

@ -49,7 +49,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetAllInfo()
{
Console.WriteLine(DateTime.Now.ToString()+ " 调接口:首页堆场总数 GetAllInfo");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString()+ " 调接口:首页堆场总数 GetAllInfo");
//堆场总数
int allNum = 0;
//堆场面积
@ -85,7 +85,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetYardList(string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据企业id获取堆场信息 GetYardList");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据企业id获取堆场信息 GetYardList");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list = bll_yard.GetModelList(string.Format("MONITOR_ID = '{0}'", monitorId)).FindAll(a=>Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
return Json(Tool.GetJsonWithCode(APICode.Success, list));
@ -99,7 +99,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetYardStorage(string SILO_CODE)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口根据堆场id获取堆场库存信息 GetYardStorage");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口根据堆场id获取堆场库存信息 GetYardStorage");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list = bll_storage.GetYardList(SILO_CODE).OrderByDescending(a=>a.INSTRG_DATE.Value).ToList();
return Json(Tool.GetJsonWithCode(APICode.Success, list));
@ -113,7 +113,7 @@ namespace CompetitionAPI.Controllers.api
[HttpGet]
public JsonResult GetYardLastStorage(string monitorId)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:获取企业每个堆场的在库数量 GetYardLastStorage");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:获取企业每个堆场的在库数量 GetYardLastStorage");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
var list = bll_storage.GetYardLastStorage(monitorId);
@ -147,7 +147,7 @@ namespace CompetitionAPI.Controllers.api
[HttpPost]
public JsonResult CheckYard([FromBody] ReqYardCheck req)
{
Console.WriteLine(DateTime.Now.ToString() + " 调接口:堆场模糊查询 CheckYard");
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:堆场模糊查询 CheckYard");
var mysql = Configuration.GetConnectionString("MySQL").ToString();
//查询商品库存地列表
var list = bll_storageSILO.CheckYardList(req);

View File

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>F:\项目\福州海关散货系统\项目\FuZhou_Custom_BulkCargo_Server\CompetitionAPI\CompetitionAPI\CompetitionAPI\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2024-06-25T10:55:08.1751359Z;True|2024-06-25T18:47:04.7420194+08:00;True|2024-06-25T18:44:23.4689695+08:00;True|2024-06-25T18:19:40.9912935+08:00;True|2024-06-25T08:44:00.2470909+08:00;False|2024-06-25T08:43:35.7645713+08:00;False|2024-06-19T09:51:07.8834743+08:00;False|2024-06-19T09:50:19.8828059+08:00;False|2024-06-19T09:49:31.4782067+08:00;True|2024-06-19T09:48:29.2943012+08:00;False|2024-06-19T09:48:02.6516665+08:00;True|2024-06-19T09:47:33.8215337+08:00;True|2024-06-17T13:24:10.4995074+08:00;False|2024-06-17T13:21:44.7372628+08:00;False|2024-06-17T13:21:10.7509626+08:00;True|2024-06-17T09:13:25.9817638+08:00;True|2024-06-17T09:00:04.5016133+08:00;</History>
<History>True|2024-07-11T08:15:57.1832176Z;True|2024-07-10T19:40:12.0560772+08:00;True|2024-07-03T08:34:47.9012194+08:00;True|2024-07-02T13:27:08.8864811+08:00;True|2024-06-30T10:44:01.4199530+08:00;True|2024-06-27T17:04:34.5042782+08:00;True|2024-06-26T15:13:55.0392343+08:00;True|2024-06-26T09:36:09.9993202+08:00;True|2024-06-25T18:55:08.1751359+08:00;True|2024-06-25T18:47:04.7420194+08:00;True|2024-06-25T18:44:23.4689695+08:00;True|2024-06-25T18:19:40.9912935+08:00;True|2024-06-25T08:44:00.2470909+08:00;False|2024-06-25T08:43:35.7645713+08:00;False|2024-06-19T09:51:07.8834743+08:00;False|2024-06-19T09:50:19.8828059+08:00;False|2024-06-19T09:49:31.4782067+08:00;True|2024-06-19T09:48:29.2943012+08:00;False|2024-06-19T09:48:02.6516665+08:00;True|2024-06-19T09:47:33.8215337+08:00;True|2024-06-17T13:24:10.4995074+08:00;False|2024-06-17T13:21:44.7372628+08:00;False|2024-06-17T13:21:10.7509626+08:00;True|2024-06-17T09:13:25.9817638+08:00;True|2024-06-17T09:00:04.5016133+08:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>