139 lines
4.8 KiB
C#
139 lines
4.8 KiB
C#
|
using Newtonsoft.Json.Linq;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Net;
|
|||
|
using System.Net.Http;
|
|||
|
using System.Web.Http;
|
|||
|
using MyCode.Project.Domain.Message.Response.User;
|
|||
|
using MyCode.Project.Infrastructure.Constant;
|
|||
|
using MyCode.Project.WebApi.Controllers;
|
|||
|
using MyCode.Project.Domain.Config;
|
|||
|
using MyCode.Project.Services;
|
|||
|
using MyCode.Project.Infrastructure.Common;
|
|||
|
using MyCode.Project.Domain.Message.Request.User;
|
|||
|
using MyCode.Project.Infrastructure.Enumeration;
|
|||
|
using MyCode.Project.Domain.Message.Act.User;
|
|||
|
using MyCode.Project.Domain.Message.Response.Goods;
|
|||
|
using MyCode.Project.Domain.Model;
|
|||
|
using MyCode.Project.Domain.Message.Response.Common;
|
|||
|
using MyCode.Project.Domain.Businesses.BillKeeping;
|
|||
|
using MyCode.Project.Domain.Message.Response.Member;
|
|||
|
using MyCode.Project.Domain.Message.Response.WebSocket;
|
|||
|
using MyCode.Project.Domain.Message.Response.Chat;
|
|||
|
using MyCode.Project.Domain.Message.Request.WebSocket;
|
|||
|
using MyCode.Project.Domain.Message.Request.PerformanceRecord;
|
|||
|
using MyCode.Project.Domain.Message.Response.ZhaoShang;
|
|||
|
using MyCode.Project.Domain.Message.Act.Report2301;
|
|||
|
using MyCode.Project.Domain.Message.Request.Report40;
|
|||
|
using MyCode.Project.Domain.Message.Response.Report40;
|
|||
|
using Senparc.NeuChar.NeuralSystems;
|
|||
|
|
|||
|
namespace MyCode.Project.WebApi.Areas.Admin.Controllers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// mysql数据库的报表系统相关,仅供系统内部调用
|
|||
|
/// </summary>
|
|||
|
public class LxmReportApiController : BaseAdminController
|
|||
|
{
|
|||
|
private IUserService _userService;
|
|||
|
private IReport2308Service _report2308Service;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
///
|
|||
|
/// </summary>
|
|||
|
/// <param name="userService"></param>
|
|||
|
public LxmReportApiController(IUserService userService
|
|||
|
, IReport2308Service report2308Service )
|
|||
|
{
|
|||
|
_userService = userService;
|
|||
|
_report2308Service = report2308Service;
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#region GetShopListByLoginId(根据账号ID获取店铺权限数组)
|
|||
|
/// <summary>
|
|||
|
/// 根据账号ID获取店铺权限数组
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
|
|||
|
public List<Guid> GetShopListByLoginId(BfyApiKeyAct request)
|
|||
|
{
|
|||
|
if (request.LxmZHMDReportKey.ToLower() == Const.LxmZHMDReportKey.ToLower())
|
|||
|
{
|
|||
|
return _userService.GetShopListByLoginIdForReport(request.Json);
|
|||
|
}
|
|||
|
return
|
|||
|
null;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
#region GetUserOrganizationTrees(获取树形结构的某账号下的组织架构用户)
|
|||
|
/// <summary>
|
|||
|
/// 获取树形结构的某账号下的组织架构用户
|
|||
|
/// </summary>
|
|||
|
/// <param name="req">组织ID,初始本人传"-1"</param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public List<UserOrganizationTree> GetUserOrganizationTrees(BfyApiKeyAct request)
|
|||
|
{
|
|||
|
if (request.LxmZHMDReportKey.ToLower() == Const.LxmZHMDReportKey.ToLower())
|
|||
|
{
|
|||
|
var req = JsonHelper.ToObject<GetUserOrganizationTrees>(request.Json);
|
|||
|
Guid userId = Guid.Empty;
|
|||
|
if (req.UserId.HasValue)
|
|||
|
{
|
|||
|
userId = req.UserId.Value;
|
|||
|
}
|
|||
|
|
|||
|
return _report2308Service.GetUserOrganizationTrees(req.OrganizationId, userId);
|
|||
|
}
|
|||
|
return
|
|||
|
null;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
#region QuYuZongLan2308(区域方块数据查询)
|
|||
|
/// <summary>
|
|||
|
/// 区域方块数据查询
|
|||
|
/// </summary>
|
|||
|
/// <param name="request"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public QuYuZongLan2308 QuYuZongLan(BfyApiKeyAct request)
|
|||
|
{
|
|||
|
if (request.LxmZHMDReportKey.ToLower() == Const.LxmZHMDReportKey.ToLower())
|
|||
|
{
|
|||
|
QuYu2308Query req = JsonHelper.ToObject<QuYu2308Query>(request.Json);
|
|||
|
var condition = req;
|
|||
|
//按区域类型,今日和月分别查询
|
|||
|
if (req.OrganizationId == null && (req.ShopIds.Count == 0 || req.ShopIds == null) && req.IfAllShop == 1
|
|||
|
|| (req.IfAllShop == 0 && condition.LabelQuery != null && condition.LabelQuery.SearchType > 0 && condition.LabelQuery.LabelIds.Count > 0))
|
|||
|
{
|
|||
|
var ids = _userService.GetShopListByLoginId(request.loginInfo.UserId, request.loginInfo.RoleId, request.loginInfo.OrganizationId);
|
|||
|
req.ShopIds = ids;
|
|||
|
}
|
|||
|
return _report2308Service.QuYuZongLan2308(req);
|
|||
|
}
|
|||
|
return
|
|||
|
null;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|