BiDecisionOhterService.cs 1.78 KB
using Hh.Mes.Common.log;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.Response;
using Hh.Mes.Service.Repository;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hh.Mes.Service
{
    public partial class BiDecisionService : RepositorySqlSugar<sys_user>
    {
        /// <summary>
        /// 供应商列表
        /// </summary>
        public dynamic GetSuppliersInfo()
        {
            var response = new Response();
            return ExceptionsHelp.Instance.ExecuteT(() =>
            {
                var options = new List<dynamic>
                {
                    new { value = "全部", label = "全部" }
                };
                var list = base.Context.Queryable<base_project_client_info>().Select(x => new
                {
                    value = x.keys,
                    label = x.clientName
                }).ToList();
                var finalList = options.Concat(list).ToList();
                response.Result = finalList;
                response.Count = finalList.Count;
                return response;
            }, catchRetrunValue: "GetSuppliersInfo");
        }

        /// <summary>
        /// 供应商对应的项目 
        /// </summary>
        public dynamic GeteProjectInfoByClientInfoKeys(Guid clientInfoKeys)
        {
            var response = new Response();
            return ExceptionsHelp.Instance.ExecuteT(() =>
            {
                var list = base.Context.Queryable<base_project>().Where(x=>x.projectClientInfoKeys==clientInfoKeys).ToList();
                response.Result = list;
                response.Count = list.Count;
                return response;
            }, catchRetrunValue: "list");
        }
    }
}