啊啊啊
This commit is contained in:
parent
2e62b65e87
commit
75b2e279a0
|
|
@ -449,5 +449,22 @@ namespace Competition.Common.Util
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是福州海关数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="customCode">关区编码</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static bool IsFuZhouCustom(string customCode)
|
||||||
|
{
|
||||||
|
if (customCode == "3501" || customCode == "3502" || customCode == "3503" || customCode == "3505" || customCode == "3506")
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ActiveDebugProfile>CompetitionAPI</ActiveDebugProfile>
|
<ActiveDebugProfile>CompetitionAPI</ActiveDebugProfile>
|
||||||
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
|
||||||
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
|
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||||
<NameOfLastUsedPublishProfile>F:\项目\禄口机场农电竞赛\web\LKJCpowerSupplyOfficeSimulationSystem\CompetitionAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
<NameOfLastUsedPublishProfile>F:\项目\禄口机场农电竞赛\web\LKJCpowerSupplyOfficeSimulationSystem\CompetitionAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ namespace CompetitionAPI.Controllers.api
|
||||||
//查询企业表所有数据
|
//查询企业表所有数据
|
||||||
var list = bll.GetModelList("");
|
var list = bll.GetModelList("");
|
||||||
//按海关区分组统计
|
//按海关区分组统计
|
||||||
int rongCheng = 0;
|
|
||||||
int maWei = 0;
|
int maWei = 0;
|
||||||
|
int rongCheng = 0;
|
||||||
int ningDe = 0;
|
int ningDe = 0;
|
||||||
int puTian = 0;
|
int puTian = 0;
|
||||||
int sanMing = 0;
|
int sanMing = 0;
|
||||||
|
|
@ -47,11 +47,26 @@ namespace CompetitionAPI.Controllers.api
|
||||||
int wuYiShan = 0;
|
int wuYiShan = 0;
|
||||||
list.ForEach(model =>
|
list.ForEach(model =>
|
||||||
{
|
{
|
||||||
if (model.CUSTOMS_CODE == "3500" || model.CUSTOMS_CODE == "3505")
|
if(model.CUSTOMS_CODE =="3501")
|
||||||
|
{
|
||||||
|
//马尾
|
||||||
|
maWei++;
|
||||||
|
}
|
||||||
|
else if (model.CUSTOMS_CODE == "3500" || model.CUSTOMS_CODE == "3505")
|
||||||
{
|
{
|
||||||
//蓉城
|
//蓉城
|
||||||
rongCheng++;
|
rongCheng++;
|
||||||
}
|
}
|
||||||
|
else if(model.CUSTOMS_CODE == "3503")
|
||||||
|
{
|
||||||
|
//宁德
|
||||||
|
ningDe++;
|
||||||
|
}
|
||||||
|
else if(model.CUSTOMS_CODE=="3506")
|
||||||
|
{
|
||||||
|
//莆田
|
||||||
|
puTian++;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var data = new { rongCheng = rongCheng, maWei = maWei, ningDe = ningDe, puTian = puTian, sanMing = sanMing, pingTan = pingTan, changLeJiChang = changLeJiChang, wuYiShan = wuYiShan };
|
var data = new { rongCheng = rongCheng, maWei = maWei, ningDe = ningDe, puTian = puTian, sanMing = sanMing, pingTan = pingTan, changLeJiChang = changLeJiChang, wuYiShan = wuYiShan };
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
using Competition.Common.Util;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace CompetitionAPI.Controllers.api
|
||||||
|
{
|
||||||
|
//货物接口
|
||||||
|
[Route("api/[controller]/[action]")]
|
||||||
|
[ApiController]
|
||||||
|
public class StorageController : Controller
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 库存表
|
||||||
|
/// </summary>
|
||||||
|
Competition.Mysql.BLL.T_STK_STORAGE bll_storage = new Competition.Mysql.BLL.T_STK_STORAGE();
|
||||||
|
|
||||||
|
public IConfiguration Configuration { get; }
|
||||||
|
|
||||||
|
public StorageController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
Configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public JsonResult Index(string action)
|
||||||
|
{
|
||||||
|
if (action == "getGoodNum")
|
||||||
|
{
|
||||||
|
//进出口商品种类
|
||||||
|
|
||||||
|
//读取配置文件示例
|
||||||
|
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||||
|
|
||||||
|
//福州海关,本年度,按货种分类
|
||||||
|
var list = bll_storage.GetModelList("").FindAll(a=> Tool.IsFuZhouCustom(a.CUSTOMS_CODE) && a.INSTRG_DATE.Value.Year==DateTime.Now.Year).GroupBy(a=>a.GOODS_CODE).ToList();
|
||||||
|
list.ForEach(x =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var data = new { };
|
||||||
|
return Json(Tool.GetJsonWithCode(APICode.Success, data));
|
||||||
|
}
|
||||||
|
else if(action=="getLastNum")
|
||||||
|
{
|
||||||
|
//在库总量
|
||||||
|
decimal num=0;
|
||||||
|
|
||||||
|
//读取配置文件示例
|
||||||
|
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||||
|
var list = bll_storage.GetModelList("STOCK_BALANCE > 0");
|
||||||
|
list.ForEach(a =>
|
||||||
|
{
|
||||||
|
num += a.STOCK_BALANCE.Value;
|
||||||
|
});
|
||||||
|
|
||||||
|
return Json(Tool.GetJsonWithCode(APICode.Success, num));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Json(Tool.GetJsonWithCode(APICode.Fail, "action填写错误"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
using Competition.Common.Util;
|
using Competition.Common.Util;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NPOI.POIFS.Crypt.Dsig;
|
|
||||||
|
|
||||||
namespace CompetitionAPI.Controllers.api
|
namespace CompetitionAPI.Controllers.api
|
||||||
{
|
{
|
||||||
|
|
@ -9,7 +8,7 @@ namespace CompetitionAPI.Controllers.api
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class YardController : Controller
|
public class YardController : Controller
|
||||||
{
|
{
|
||||||
Competition.Mysql.BLL.T_BAS_YARD bll = new Competition.Mysql.BLL.T_BAS_YARD();
|
Competition.Mysql.BLL.T_BAS_CORPORATION bll_corporation = new Competition.Mysql.BLL.T_BAS_CORPORATION();
|
||||||
|
|
||||||
public IConfiguration Configuration { get; }
|
public IConfiguration Configuration { get; }
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@ namespace CompetitionAPI.Controllers.api
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 堆场
|
/// 首页堆场数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="action"></param>
|
/// <param name="action"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
|
|
@ -31,12 +30,33 @@ namespace CompetitionAPI.Controllers.api
|
||||||
{
|
{
|
||||||
//堆场总数
|
//堆场总数
|
||||||
int allNum = 0;
|
int allNum = 0;
|
||||||
|
//堆场面积
|
||||||
|
int allArea = 0;
|
||||||
|
//筒仓总数
|
||||||
|
int allSilo = 0;
|
||||||
//读取配置文件示例
|
//读取配置文件示例
|
||||||
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
var mysql = Configuration.GetConnectionString("MySQL").ToString();
|
||||||
//查询企业表所有数据
|
//查询企业表所有数据
|
||||||
var list = bll.GetModelList("");
|
var list = bll_corporation.GetModelList("");
|
||||||
|
list.ForEach(x =>
|
||||||
|
{
|
||||||
|
if(Tool.IsFuZhouCustom(x.CUSTOMS_CODE))
|
||||||
|
{
|
||||||
|
allNum += int.Parse(x.YARD_NUM);
|
||||||
|
allArea += int.Parse(x.YARD_AREA.Replace("平方米",""));
|
||||||
|
allSilo += int.Parse(x.SILO_NUM);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var data = new { allNum = allNum, allArea = allArea, allSilo = allSilo };
|
||||||
|
return Json(Tool.GetJsonWithCode(APICode.Success, data));
|
||||||
}
|
}
|
||||||
return Json(Tool.GetJsonWithCode(APICode.Success, null));
|
else
|
||||||
|
{
|
||||||
|
return Json(Tool.GetJsonWithCode(APICode.Fail, "action填写错误"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue