|
|
using System.Collections;
|
|
|
using System.Text;
|
|
|
using Estsh.Core.IRepositories;
|
|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:公共业务处理类
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 公共服务层
|
|
|
/// </summary>
|
|
|
public class CommonService : BaseService<SysFactory>, ICommonService
|
|
|
{
|
|
|
private readonly ICommonRepository repository;
|
|
|
public CommonService(ICommonRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取工厂信息,用于下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getFactoryInfo()
|
|
|
{
|
|
|
return repository.getFactoryInfo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取部门信息,用于下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getDeptInfo()
|
|
|
{
|
|
|
return repository.getDeptInfo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取班别信息,用户下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getShiftInfo()
|
|
|
{
|
|
|
return repository.getShiftInfo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取枚举表中的数据
|
|
|
/// </summary>
|
|
|
/// <param name="enumType"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> GetSysEnum(String enumType)
|
|
|
{
|
|
|
return repository.GetSysEnum(enumType);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取供应商信息,用于下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getVendorInfo()
|
|
|
{
|
|
|
return repository.getVendorInfo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取项目名称信息,用于下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getModelTypeInfo()
|
|
|
{
|
|
|
return repository.getModelTypeInfo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据用户,访问菜单连接,操作类型,获取操作权限
|
|
|
/// </summary>
|
|
|
/// <param name="userInfo"></param>
|
|
|
/// <param name="url"></param>
|
|
|
/// <param name="opType"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<SysProgramFunOp> getOpMenuList(int empId, string url, string opType, string gridName)
|
|
|
{
|
|
|
return repository.getOpMenuListByUser(empId, url, opType, gridName);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据用户,访问菜单连接,操作类型,获取小尺寸工具栏的操作权限
|
|
|
/// </summary>
|
|
|
/// <param name="userInfo"></param>
|
|
|
/// <param name="url"></param>
|
|
|
/// <param name="opType"></param>
|
|
|
/// <returns></returns>
|
|
|
public string getMinToolbar(int empId, string url, string opType)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
List<SysProgramFunOp> dt;
|
|
|
StringBuilder sqlToolbar = new StringBuilder();
|
|
|
|
|
|
dt = repository.getOpMenuListByUser(empId, url, opType, null);
|
|
|
|
|
|
if (dt != null && dt.Count > 0)
|
|
|
{
|
|
|
foreach (SysProgramFunOp dr in dt)
|
|
|
{
|
|
|
sqlToolbar.Append("<a href=\"javascript:");
|
|
|
sqlToolbar.Append(dr.OpMethod);
|
|
|
sqlToolbar.Append("();\"><span class=\"");
|
|
|
sqlToolbar.Append(dr.OpClass);
|
|
|
sqlToolbar.Append("\">");
|
|
|
sqlToolbar.Append(dr.OpName);
|
|
|
sqlToolbar.Append("</span></a>");
|
|
|
sqlToolbar.Append("<div class=\"box_tool_line\"></div>");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
sqlToolbar.Append("<div class=\"clear\"></div>");
|
|
|
|
|
|
return sqlToolbar.ToString();
|
|
|
}
|
|
|
public List<SysWebMenu> GetWebMenus(int empid, int factoryId)
|
|
|
{
|
|
|
|
|
|
return repository.GetWebMenus(empid, factoryId);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
} |