using System;
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.AssetManagementSystem;
using System.Web.Mvc;
using System.Collections.Generic;
using System.Linq;
namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架
/// Copyright (c) 2013-2018 上海力软信息技术有限公司
/// 创 建:超级管理员
/// 日 期:2019-09-11 10:35
/// 描 述:资产报废
///
public class AssReportController : MvcControllerBase
{
#region 视图功能
Ass_AssetsInfoApplyIBLL assAssetsInfoApplyIbll = new Ass_AssetsInfoApplyBLL();
Ass_AssetsTypeIBLL assAssetsTypeIbll = new Ass_AssetsTypeBLL();
Ass_AssetsInfoIBLL assAssetsInfoIbll = new Ass_AssetsInfoBLL();
Ass_AssetsInfoItemIBLL assAssetsInfoItemIbll = new Ass_AssetsInfoItemBLL();
///
/// 主页面
///
///
[HttpGet]
public ActionResult AssAddReport()
{
return View();
}
[HttpGet]
public ActionResult AssTypeReport()
{
return View();
}
[HttpGet]
public ActionResult AssStatusReport()
{
return View();
}
#endregion
#region 获取数据
public ActionResult AssAddReportData()
{
var data = assAssetsInfoApplyIbll.AssAddReportData();
var list = data.GroupBy(a => a.AACreateTime.Value.Year).Select(a => new { a.Key, price = a.Sum(b => b.AAPrice) });
var name = list.Select(a => a.Key);
var value = list.Select(a => a.price);
return Success(new { name, value });
}
[HttpGet]
public ActionResult AssAddReportList()
{
var data = assAssetsInfoApplyIbll.AssAddReportData();
var list = data.GroupBy(a => a.AACreateTime.Value.Year).Select(a => new { name = a.Key, value = a.Sum(b => b.AAPrice) });
return JsonResult(list);
}
public ActionResult AssTypeData()
{
var data = assAssetsInfoIbll.GetList("{\"a\":\"false\"}");
var list = data.GroupBy(a => a.ATId).Select(a => new { a.Key, price = a.Sum(b => b.APrice * b.AStock) }).ToList();
List