添加三维首页接口
This commit is contained in:
parent
14ce0f5fad
commit
5391a8241a
|
@ -2,3 +2,4 @@
|
|||
bin
|
||||
/CompetitionAPI/CompetitionAPI/Competition.Common/obj
|
||||
obj
|
||||
/CompetitionAPI/CompetitionAPI/CompetitionAPI/CompetitionAPI.csproj.user
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using Competition.Common.Util;
|
||||
using Competition.Mysql.Model;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.POIFS.Crypt.Dsig;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompetitionAPI.Controllers.api
|
||||
{
|
||||
|
@ -34,32 +36,33 @@ namespace CompetitionAPI.Controllers.api
|
|||
//查询企业表所有数据
|
||||
var list = bll.GetModelList("");
|
||||
//按海关区分组统计
|
||||
int maWei = 0;
|
||||
int rongCheng = 0;
|
||||
int ningDe = 0;
|
||||
int puTian = 0;
|
||||
List<T_BAS_CORPORATION> maWei = new List<T_BAS_CORPORATION>();
|
||||
List<T_BAS_CORPORATION> rongCheng = new List<T_BAS_CORPORATION>();
|
||||
List<T_BAS_CORPORATION> ningDe = new List<T_BAS_CORPORATION>();
|
||||
List<T_BAS_CORPORATION> puTian = new List<T_BAS_CORPORATION>();
|
||||
|
||||
|
||||
list.ForEach(model =>
|
||||
{
|
||||
if(model.CUSTOMS_CODE =="3501")
|
||||
{
|
||||
//马尾
|
||||
maWei++;
|
||||
maWei.Add(model);
|
||||
}
|
||||
else if (model.CUSTOMS_CODE == "3500" || model.CUSTOMS_CODE == "3505")
|
||||
{
|
||||
//蓉城
|
||||
rongCheng++;
|
||||
rongCheng.Add(model);
|
||||
}
|
||||
else if(model.CUSTOMS_CODE == "3503")
|
||||
{
|
||||
//宁德
|
||||
ningDe++;
|
||||
ningDe.Add(model);
|
||||
}
|
||||
else if(model.CUSTOMS_CODE=="3506")
|
||||
{
|
||||
//莆田
|
||||
puTian++;
|
||||
puTian.Add(model);
|
||||
}
|
||||
});
|
||||
var data = new { rongCheng = rongCheng, maWei = maWei, ningDe = ningDe, puTian = puTian };
|
||||
|
|
|
@ -26,20 +26,21 @@ namespace CompetitionAPI.Controllers.api
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// //全年进出口商品种类
|
||||
/// (首页)全年进出口商品种类(monitorId可不传)
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="year">年份</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public JsonResult GetGoodNumByYear(int year)
|
||||
public JsonResult GetGoodNumByYear(int year, string monitorId)
|
||||
{
|
||||
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年进出口商品种类 GetGoodNumByYear");
|
||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||
//福州海关下的,本年度,按货种分类
|
||||
var list_good = bll_good.GetModelList("");
|
||||
var list_good = bll_good.GetModelList("");
|
||||
//var list = bll_storage.GetModelList("YEAR(INSTRG_DATE) = YEAR(GETDATE())").FindAll(a=> Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
var list = bll_storage.GetModelList(string.Format("YEAR(INSTRG_DATE) = {0}",year)).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
string sql = string.IsNullOrEmpty(monitorId) ? string.Format("YEAR(INSTRG_DATE) = {0}", year) : string.Format("YEAR(INSTRG_DATE) = {0} AND MONITOR_ID = '{1}'", year, monitorId);
|
||||
var list = bll_storage.GetModelList(sql).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
//总进出口重量
|
||||
decimal allWT = 0;
|
||||
if(list.Count > 0)
|
||||
|
@ -162,18 +163,19 @@ namespace CompetitionAPI.Controllers.api
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全年累计进出口传播艘次
|
||||
/// 全年累计进出口传播艘次(monitorId可不传)
|
||||
/// </summary>
|
||||
/// <param name="year"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public JsonResult GetBoCiByYear(int year)
|
||||
public JsonResult GetBoCiByYear(int year,string monitorId)
|
||||
{
|
||||
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年累计进出口传播艘次 GetBoCiByYear");
|
||||
//全年累计进出口传播艘次
|
||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||
//按年度,福州海关下的,按VOYAGE_NO+SHIP_NAME_EN 航次+船名算一个艘次
|
||||
var list = bll_storage.GetModelList("YEAR(INSTRG_DATE) = " + year).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE) && a.INSTRG_DATE.HasValue && !string.IsNullOrEmpty(a.VOYAGE_NO) && !string.IsNullOrEmpty(a.SHIP_NAME_EN)).GroupBy(a => a.VOYAGE_NO + "," + a.SHIP_NAME_EN).ToList();
|
||||
string sql = string.IsNullOrEmpty(monitorId) ? string.Format("YEAR(INSTRG_DATE) = {0}", year) : string.Format("YEAR(INSTRG_DATE) = {0} AND MONITOR_ID = '{1}'", year, monitorId);
|
||||
var list = bll_storage.GetModelList(sql).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE) && a.INSTRG_DATE.HasValue && !string.IsNullOrEmpty(a.VOYAGE_NO) && !string.IsNullOrEmpty(a.SHIP_NAME_EN)).GroupBy(a => a.VOYAGE_NO + "," + a.SHIP_NAME_EN).ToList();
|
||||
Dictionary<int, decimal> dic = new Dictionary<int, decimal>();
|
||||
dic.Add(1, 0);
|
||||
dic.Add(2, 0);
|
||||
|
@ -197,17 +199,19 @@ namespace CompetitionAPI.Controllers.api
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 全年累计进口总量,按年度查询
|
||||
/// 全年累计进口总量,按年度查询(monitorId可不传)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public JsonResult GetInNumByYear(int year)
|
||||
public JsonResult GetInNumByYear(int year,string monitorId)
|
||||
{
|
||||
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:全年累计进口总量,按年度查询 GetInNumByYear");
|
||||
//全年累计进口总量,按年度查询
|
||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||
|
||||
string sql = string.IsNullOrEmpty(monitorId) ? string.Format("I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = {0}", year) : string.Format("I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = {0} AND MONITOR_ID = '{1}'", year, monitorId);
|
||||
//按年度,福州海关下的,进口,BILL_GROSS_WT提单毛重即入库数量
|
||||
var list = bll_storage.GetModelList("I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = " + year).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
var list = bll_storage.GetModelList(sql).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
Dictionary<int, decimal> dic = new Dictionary<int, decimal>();
|
||||
dic.Add(1, 0);
|
||||
dic.Add(2, 0);
|
||||
|
@ -237,13 +241,15 @@ namespace CompetitionAPI.Controllers.api
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public JsonResult GetInNumWithCurrent()
|
||||
public JsonResult GetInNumWithCurrent(string monitorId)
|
||||
{
|
||||
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString() + " 调接口:本年度和本季度进口总量 GetInNumWithCurrent");
|
||||
//本年度,本季度进口总量
|
||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||
|
||||
string sql = string.IsNullOrEmpty(monitorId) ? "I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = YEAR(GETDATE())" : string.Format("I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = YEAR(GETDATE()) AND MONITOR_ID = '{0}'", monitorId);
|
||||
//本年度,福州海关下的,进口,BILL_GROSS_WT提单毛重即入库数量
|
||||
var list = bll_storage.GetModelList("I_E_FLAG = 'I' AND YEAR(INSTRG_DATE) = YEAR(GETDATE())").FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
var list = bll_storage.GetModelList(sql).FindAll(a => Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
Dictionary<int, decimal> dic = new Dictionary<int, decimal>();
|
||||
dic.Add(1, 0);
|
||||
dic.Add(2, 0);
|
||||
|
|
|
@ -41,13 +41,13 @@ namespace CompetitionAPI.Controllers.api
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 首页堆场总数
|
||||
/// 首页堆场总数(monitorId不传就是所有的)
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public JsonResult GetAllInfo()
|
||||
public JsonResult GetAllInfo(string monitorId)
|
||||
{
|
||||
CompetitionAPI.Util.LogHelper.WriteLog(DateTime.Now.ToString()+ " 调接口:首页堆场总数 GetAllInfo");
|
||||
//堆场总数
|
||||
|
@ -59,7 +59,8 @@ namespace CompetitionAPI.Controllers.api
|
|||
//读取配置文件示例
|
||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||
//查询企业表所有数据
|
||||
var list = bll_corporation.GetModelList("").FindAll(a=> Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
string sql = string.IsNullOrEmpty(monitorId) ? "" : string.Format("MONITOR_ID = '{0}'", monitorId);
|
||||
var list = bll_corporation.GetModelList(sql).FindAll(a=> Tool.IsFuZhouCustom(a.CUSTOMS_CODE));
|
||||
list.ForEach(x =>
|
||||
{
|
||||
allNum += int.Parse(x.YARD_NUM);
|
||||
|
@ -77,6 +78,7 @@ namespace CompetitionAPI.Controllers.api
|
|||
return Json(Tool.GetJsonWithCode(APICode.Success, data));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据企业id获取堆场信息
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue