Commit 913b9db1 by yw

创建主干

parents
using System.Web;
using System.Web.Optimization;
namespace SuValue.API
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
using System.Web;
using System.Web.Mvc;
namespace SuValue.API
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace SuValue.API
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional }
);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace SuValue.API
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
<TelemetryInitializers>
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.Web.WebTestTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.SyntheticUserAgentTelemetryInitializer, Microsoft.AI.Web">
<!-- Extended list of bots:
search|spider|crawl|Bot|Monitor|BrowserMob|BingPreview|PagePeeker|WebThumb|URL2PNG|ZooShot|GomezA|Google SketchUp|Read Later|KTXN|KHTE|Keynote|Pingdom|AlwaysOn|zao|borg|oegp|silk|Xenu|zeal|NING|htdig|lycos|slurp|teoma|voila|yahoo|Sogou|CiBra|Nutch|Java|JNLP|Daumoa|Genieo|ichiro|larbin|pompos|Scrapy|snappy|speedy|vortex|favicon|indexer|Riddler|scooter|scraper|scrubby|WhatWeb|WinHTTP|voyager|archiver|Icarus6j|mogimogi|Netvibes|altavista|charlotte|findlinks|Retreiver|TLSProber|WordPress|wsr-agent|http client|Python-urllib|AppEngine-Google|semanticdiscovery|facebookexternalhit|web/snippet|Google-HTTP-Java-Client-->
<Filters>search|spider|crawl|Bot|Monitor|AlwaysOn</Filters>
</Add>
<Add Type="Microsoft.ApplicationInsights.Web.ClientIpHeaderTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.OperationNameTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.UserTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.AuthenticatedUserIdTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.AccountIdTelemetryInitializer, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.SessionTelemetryInitializer, Microsoft.AI.Web"/>
</TelemetryInitializers>
<TelemetryModules>
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector"/>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
<!--
Use the following syntax here to collect additional performance counters:
<Counters>
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
...
</Counters>
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
NOTE: performance counters configuration will be lost upon NuGet upgrade.
The following placeholders are supported as InstanceName:
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
-->
</Add>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
<Handlers>
<!--
Add entries here to filter out additional handlers:
NOTE: handler configuration will be lost upon NuGet upgrade.
-->
<Add>System.Web.Handlers.TransferRequestHandler</Add>
<Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
<Add>System.Web.StaticFileHandler</Add>
<Add>System.Web.Handlers.AssemblyResourceLoader</Add>
<Add>System.Web.Optimization.BundleHandler</Add>
<Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
<Add>System.Web.Handlers.TraceHandler</Add>
<Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
<Add>System.Web.HttpDebugHandler</Add>
</Handlers>
</Add>
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web"/>
</TelemetryModules>
<TelemetryProcessors>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
</Add>
</TelemetryProcessors>
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
<!--
Learn more about Application Insights configuration with ApplicationInsights.config here:
http://go.microsoft.com/fwlink/?LinkID=513840
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
--></ApplicationInsights>
\ No newline at end of file
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}
using SuValue.Entity.Request;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SuValue.API.Controllers
{
public class BaseController : ApiController
{
public readonly string KEY = "350E6436-8A02-4683-9697-8AAD368B1D91";//API
/// <summary>
/// 验证Token
/// </summary>
/// <param name="key"></param>
/// <param name="date"></param>
/// <returns></returns>
public bool Authentication(string key)
{
if (string.IsNullOrEmpty(key)) return false;
return key.ToUpper().Equals(KEY);
}
/// <summary>
/// 用于将错误信息输出到txt文件
/// </summary>
/// <param name="errorMessage">错误详细信息</param>
public static void WriteError(string errorMessage)
{
try
{
string path = "~/Error/" + DateTime.Today.ToString("yyMMdd") + ".txt";
if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
{
File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
}
using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))
{
w.WriteLine("\r\nLog Entry : ");
w.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture));
w.WriteLine(errorMessage);
w.WriteLine("________________________________________________________");
w.Flush();
w.Close();
}
}
catch (Exception ex)
{
WriteError(ex.Message);
}
}
}
}

using Suvalue.Redis;
using SuValue.BLL;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SuValue.API.Controllers
{
/// <summary>
/// 首页信息
/// </summary>
public class HomeController : BaseController
{
HospitalBLL bll = new HospitalBLL();
/// <summary>
/// 各省份医院数量情况
/// </summary>
/// <param name="model">校验码</param>
[HttpGet]
[Route("api/Home/GetProvincialHospital")]
public EntityResult GetProvincialHospital([FromUri]EntityBase model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
List<EntityProvinceCount> list = bll.GetProvincialHospital();
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 医院地区分布情况
/// </summary>
/// <param name="model">校验码</param>
[HttpGet]
[Route("api/Home/GetHospArea")]
public EntityResult GetHospArea([FromUri]EntityBase model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
List<EntityReport> list = bll.GetHospAreaTable();
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 医院等级分布情况
/// </summary>
/// <param name="model">校验码</param>
[HttpGet]
[Route("api/Home/GetHospGrade")]
public EntityResult GetHospGrade([FromUri]EntityBase model)
{
try
{
HospitalBLL hbll = new HospitalBLL();
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
List<EntityReport> list = hbll.GetHospLevelTable();
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 医院性质分布情况
/// </summary>
/// <param name="model">校验码</param>
[HttpGet]
[Route("api/Home/GetHospType")]
public EntityResult GetHospType([FromUri]EntityBase model)
{
HospitalBLL hbll = new HospitalBLL();
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
List<EntityReport> list = hbll.GetHospNaturesTable();
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
}
}

using Suvalue.Redis;
using SuValue.BLL;
using SuValue.Entity;
using SuValue.Entity.Request;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SuValue.API.Controllers.SystemInfo
{
/// <summary>
/// 菜单信息
/// </summary>
public class MenuController : BaseController
{
/// <summary>
/// 获取一级菜单
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpGet]
public EntityResult GetMenuListAll([FromUri]EntityBase model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
MenuBLL bll = new MenuBLL();
List<EntityMenu> list = bll.GetMenuLevelList(1, model.token);
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 获取二级三级菜单
/// </summary>
/// <param name="model"></param>
/// <param name="parentid">父级编码</param>
/// <returns></returns>
[HttpGet]
public EntityResult GetMenuParentID([FromUri]EntityBase model, int ParentID)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
// RedisHelper redis = new RedisHelper();
//string key = "Menu_GetMenuParentID__ParentID&UserID" + ParentID + "&" + model.userid;
//List<EntityMenu> list = redis.StringGet<List<EntityMenu>>(key);
//if (list == null)
//{
MenuBLL bll = new MenuBLL();
List<EntityMenu> list = bll.GetMenuParentidList(Convert.ToInt32(model.userid), ParentID);
// redis.StringSet<List<EntityMenu>>(key, list, new TimeSpan(DateTime.Now.AddDays(30).Ticks));
//}
return new EntityResult(ResultType.Success, "", list);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
}
}

using SuValue.BLL;
using SuValue.Entity;
using SuValue.Entity.Request;
using SuValue.Entity.Responese;
using SuValue.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SuValue.API.Controllers
{
public class ReportController : BaseController
{
/// <summary>
/// 报表搜索
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
public EntityResult Search([FromBody] EntitySearch model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
ReportBLL bll = new ReportBLL();
EntityResult result = new EntityResult(ResultType.Success);
WriteError(JsonHelper.ToJson(model));
result.data = bll.GetReportData(model);
WriteError(JsonHelper.ToJson(result));
return result;
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
}
}
using Suvalue.Redis;
using SuValue.BLL;
using SuValue.DAL;
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace SuValue.API.Controllers
{
public class TestController : Controller
{
// GET: Test
public ActionResult Index()
{
return View();
}
public ActionResult Task()
{
return View();
}
/// <summary>
/// 导入医院数据
/// </summary>
/// <param name="taskid">任务编码</param>
/// <param name="hosid">医院编码,当不填写医院编码讲导入所有医院的数据</param>
/// <param name="begindate">导入数据开始日期</param>
/// <param name="enddate">导入医院结束日期</param>
/// <returns></returns>
[HttpPost]
public ActionResult Task(int taskid, int? hosid, DateTime begindate, DateTime enddate)
{
TaskBLL bll = new TaskBLL();
bll.ExecTask(taskid, hosid, begindate, enddate);
return View();
}
//public ActionResult test()
//{
// SMSBLL sbll = new SMSBLL();//短信验证码
// EntityResult result = sbll.Mesage("18116218911", Entity.Enum.SMSType.Voice, Entity.Enum.MessageType.Login);
// return View();
//}
//public ActionResult Redis()
//{
// RedisHelper redis = new RedisHelper();
// redis.GetKeys();
// bool b = redis.StringSet("redis_string_model", new Entity.EntityResult(Entity.ResultType.Success)); ;
// Entity.EntityResult result = redis.StringGet<Entity.EntityResult>("redis_string_model");
// return View();
//}
}
}
\ No newline at end of file

using SuValue.BLL;
using SuValue.Database.Entity;
using SuValue.Entity;
using SuValue.Entity.Enum;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SuValue.API.Controllers
{
/// <summary>
/// 用户信息
/// </summary>
public class UserController : BaseController
{
UserBLL bll = new UserBLL();
/// <summary>
/// 将验证码发送至用户手机
/// </summary>
/// <param name="model">校验码</param>
/// <param name="mobile">手机号</param>
/// <param name="type">验证方式:1是短信 2是语音</param>
/// <returns></returns>
[HttpGet]
public EntityResult Message([FromUri]EntityBase model, string mobile, SMSType type, MessageType messagetype)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
SMSBLL sbll = new SMSBLL();//短信验证码
EntityResult result = sbll.Mesage(mobile, type, messagetype);
//返回一个状态,用于判断是否成功
//如果成功,页面就提示“验证码获取成功”
return result;
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 手机验证
/// </summary>
/// <param name="model"></param>
/// <param name="mobile"></param>
/// <param name="code"></param>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet]
public EntityResult CheckMessage([FromUri]EntityBase model, string mobile, string code, SMSType type, MessageType messagetype)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
SMSBLL sbll = new SMSBLL();//短信验证码
EntityResult result = sbll.CheckMessage(mobile, code, type, messagetype);
//返回一个状态,用于判断是否成功
//如果成功,页面就提示“验证码获取成功”
return result;
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 根据用户ID查询用户信息
/// </summary>
/// <param name="model">校验码</param>
/// <param name="userid">用户ID</param>
/// <returns>此接口用于个人信息查询</returns>
[HttpGet]
public EntityResult GetUserList([FromUri]EntityBase model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
sys_user list = bll.GetUserInfo(Convert.ToInt32(model.userid));
if (list == null) return new EntityResult(ResultType.Fail, "用户信息不存在");
EntityUser lists = new EntityUser(list);
return new EntityResult(ResultType.Success, "", lists);
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 修改用户信息
/// </summary>
/// <param name="model">校验码</param>
/// <param name="UserName">用户名称</param>
/// <param name="HeadPortrait">头像地址</param>
/// <param name="Mobile">手机号</param>
/// <param name="Mail">邮箱</param>
/// <param name="CorporateName">公司名称</param>
/// <param name="Department">部门</param>
/// <param name="Duties">职务</param>
/// <param name="ID">用户ID</param>
/// <param name="LandingCode">绑定微信号</param>
/// <param name="LandingVoucher">登陆凭证</param>
/// <returns></returns>
[HttpPost]
public EntityResult PostUpdate([FromBody] SuValue.Entity.Request.EntityUser model)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
EntityResult result = bll.Update(model);
return result;
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
/// <summary>
/// 手机号登陆
/// </summary>
/// <param name="model">校验码</param>
/// <param name="mobile">手机号码</param>
/// <param name="code">验证码</param>
[HttpGet]
public EntityResult Login([FromUri]EntityBase model, string mobile, string code)
{
try
{
if (!Authentication(model.token)) return new EntityResult(ResultType.TokenError);
EntityResult result = bll.Login(mobile, code, model.token);
return result;
}
catch (Exception ex)
{
return new EntityResult(ResultType.ServiceError, ex.ToString());
}
}
}
}
<%@ Application Codebehind="Global.asax.cs" Inherits="SuValue.API.WebApiApplication" Language="C#" %>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace SuValue.API
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SuValue.API")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuValue.API")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e9fa35e0-2e1f-4018-aac6-f854ca292a63")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. Insofar as a script file is dual licensed under GPL,
* Microsoft neither took the code under GPL nor distributes it thereunder but
* under the terms set out in this paragraph. All notices and licenses
* below are for informational purposes only.
*
* NUGET: END LICENSE TEXT */
/*
** Unobtrusive validation support library for jQuery and jQuery Validate
** Copyright (C) Microsoft Corporation. All rights reserved.
*/
(function(a){var d=a.validator,b,e="unobtrusiveValidation";function c(a,b,c){a.rules[b]=c;if(a.message)a.messages[b]=a.message}function j(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function h(a){return a.substr(0,a.lastIndexOf(".")+1)}function g(a,b){if(a.indexOf("*.")===0)a=a.replace("*.",b);return a}function m(c,e){var b=a(this).find("[data-valmsg-for='"+f(e[0].name)+"']"),d=b.attr("data-valmsg-replace"),g=d?a.parseJSON(d)!==false:null;b.removeClass("field-validation-valid").addClass("field-validation-error");c.data("unobtrusiveContainer",b);if(g){b.empty();c.removeClass("input-validation-error").appendTo(b)}else c.hide()}function l(e,d){var c=a(this).find("[data-valmsg-summary=true]"),b=c.find("ul");if(b&&b.length&&d.errorList.length){b.empty();c.addClass("validation-summary-errors").removeClass("validation-summary-valid");a.each(d.errorList,function(){a("<li />").html(this.message).appendTo(b)})}}function k(d){var b=d.data("unobtrusiveContainer"),c=b.attr("data-valmsg-replace"),e=c?a.parseJSON(c):null;if(b){b.addClass("field-validation-valid").removeClass("field-validation-error");d.removeData("unobtrusiveContainer");e&&b.empty()}}function n(){var b=a(this),c="__jquery_unobtrusive_validation_form_reset";if(b.data(c))return;b.data(c,true);try{b.data("validator").resetForm()}finally{b.removeData(c)}b.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");b.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function i(b){var c=a(b),f=c.data(e),i=a.proxy(n,b),g=d.unobtrusive.options||{},h=function(e,d){var c=g[e];c&&a.isFunction(c)&&c.apply(b,d)};if(!f){f={options:{errorClass:g.errorClass||"input-validation-error",errorElement:g.errorElement||"span",errorPlacement:function(){m.apply(b,arguments);h("errorPlacement",arguments)},invalidHandler:function(){l.apply(b,arguments);h("invalidHandler",arguments)},messages:{},rules:{},success:function(){k.apply(b,arguments);h("success",arguments)}},attachValidation:function(){c.off("reset."+e,i).on("reset."+e,i).validate(this.options)},validate:function(){c.validate();return c.valid()}};c.data(e,f)}return f}d.unobtrusive={adapters:[],parseElement:function(b,h){var d=a(b),f=d.parents("form")[0],c,e,g;if(!f)return;c=i(f);c.options.rules[b.name]=e={};c.options.messages[b.name]=g={};a.each(this.adapters,function(){var c="data-val-"+this.name,i=d.attr(c),h={};if(i!==undefined){c+="-";a.each(this.params,function(){h[this]=d.attr(c+this)});this.adapt({element:b,form:f,message:i,params:h,rules:e,messages:g})}});a.extend(e,{__dummy__:true});!h&&c.attachValidation()},parse:function(c){var b=a(c),e=b.parents().addBack().filter("form").add(b.find("form")).has("[data-val=true]");b.find("[data-val=true]").each(function(){d.unobtrusive.parseElement(this,true)});e.each(function(){var a=i(this);a&&a.attachValidation()})}};b=d.unobtrusive.adapters;b.add=function(c,a,b){if(!b){b=a;a=[]}this.push({name:c,params:a,adapt:b});return this};b.addBool=function(a,b){return this.add(a,function(d){c(d,b||a,true)})};b.addMinMax=function(e,g,f,a,d,b){return this.add(e,[d||"min",b||"max"],function(b){var e=b.params.min,d=b.params.max;if(e&&d)c(b,a,[e,d]);else if(e)c(b,g,e);else d&&c(b,f,d)})};b.addSingleVal=function(a,b,d){return this.add(a,[b||"val"],function(e){c(e,d||a,e.params[b])})};d.addMethod("__dummy__",function(){return true});d.addMethod("regex",function(b,c,d){var a;if(this.optional(c))return true;a=(new RegExp(d)).exec(b);return a&&a.index===0&&a[0].length===b.length});d.addMethod("nonalphamin",function(c,d,b){var a;if(b){a=c.match(/\W/g);a=a&&a.length>=b}return a});if(d.methods.extension){b.addSingleVal("accept","mimtype");b.addSingleVal("extension","extension")}else b.addSingleVal("extension","extension","accept");b.addSingleVal("regex","pattern");b.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");b.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");b.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength");b.add("equalto",["other"],function(b){var i=h(b.element.name),j=b.params.other,d=g(j,i),e=a(b.form).find(":input").filter("[name='"+f(d)+"']")[0];c(b,"equalTo",e)});b.add("required",function(a){(a.element.tagName.toUpperCase()!=="INPUT"||a.element.type.toUpperCase()!=="CHECKBOX")&&c(a,"required",true)});b.add("remote",["url","type","additionalfields"],function(b){var d={url:b.params.url,type:b.params.type||"GET",data:{}},e=h(b.element.name);a.each(j(b.params.additionalfields||b.element.name),function(i,h){var c=g(h,e);d.data[c]=function(){var d=a(b.form).find(":input").filter("[name='"+f(c)+"']");return d.is(":checkbox")?d.filter(":checked").val()||d.filter(":hidden").val()||"":d.is(":radio")?d.filter(":checked").val()||"":d.val()}});c(b,"remote",d)});b.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&c(a,"minlength",a.params.min);a.params.nonalphamin&&c(a,"nonalphamin",a.params.nonalphamin);a.params.regex&&c(a,"regex",a.params.regex)});a(function(){d.unobtrusive.parse(document)})})(jQuery);
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav"></ul>
</div>
</div>
</div>
<div class="container body-content">
<hr />
<footer>
<p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
</body>
</html>
\ No newline at end of file

@{
Layout = null;
}
<h2>Index</h2>
<form action="/api/Report/Search/" method="post">
<table>
<thead>
</thead>
<tbody>
<tr>
<td>UserName</td>
<td><input type="text" name="MenuID" value="21" /></td>
</tr>
<tr>
<td>year</td>
<td><input type="text" name="year" value="" /></td>
</tr>
<tr>
<td>month</td>
<td><input type="text" name="month" value="" /></td>
</tr>
<tr>
<td>hoslevel</td>
<td><input type="text" name="hoslevel" value="三级" /></td>
</tr>
<tr>
<td>hostype</td>
<td><input type="text" name="hostype" value="中医" /></td>
</tr>
<tr>
<td>disease</td>
<td><input type="text" name="disease" value="" /></td>
</tr>
<tr>
<td>province</td>
<td><input type="text" name="province" value="" /></td>
</tr>
<tr>
<td>source</td>
<td><input type="text" name="source" value="" /></td>
</tr>
<tr>
<td>token</td>
<td><input type="text" name="token" value="350E6436-8A02-4683-9697-8AAD368B1D91" /></td>
</tr>
</tbody>
</table>
<input type="submit" value="提交" />
</form>
\ No newline at end of file

@{
Layout = null;
}
<h2>Task</h2>
<form action="/test/Task/" method="post">
<table>
<thead>
</thead>
<tbody>
<tr>
<td>TaskID</td>
<td><input type="text" name="TaskID" value="1" /></td>
</tr>
<tr>
<td>HospitalID</td>
<td><input type="text" name="HosID" value="" /></td>
</tr>
<tr>
<td>BeginDate</td>
<td><input type="text" name="BeginDate" value="2015-01-01" /></td>
</tr>
<tr>
<td>EndDate</td>
<td><input type="text" name="EndDate" value="2019-01-01" /></td>
</tr>
</tbody>
</table>
<input type="submit" value="提交" />
</form>
\ No newline at end of file
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
</configuration>
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<connectionStrings>
<add name="RedisExchangeHosts" connectionString="116.62.245.55:6379,allowadmin=true" />
<add name="connectionString" connectionString="Server=116.62.245.55;Database=bigdata_base;Uid=suvalue;Pwd=suvalue2017;pooling=true;charset=utf8;Convert Zero Datetime=True;port=3306;Connection Timeout=120;"></add>
<add name="sqlserver_connectionString" connectionString="data source={server};initial catalog={database};user id={login};password={password};"></add>
<add name="mysql_connectionString" connectionString="Server={server};Database={database};Uid={login};Pwd={password};pooling=true;charset=utf8;Convert Zero Datetime=True;port=3306;Connection Timeout=120;Allow User Variables=True;"></add>
</connectionStrings>
<appSettings>
<add key="redisKey" value="Suvalue:Report:" />
<add key="WebReference.Service.PostUrl" value="http://106.ihuyi.cn/webservice/sms.php?method=Submit" />
<add key="WebReference.Service.VoicePostUrl" value="http://api.voice.wx96.com/webservice/voice.php?method=Submit" />
<!--短信接口配置-->
<add key="WebReference.sms" value="http://106.ihuyi.cn/webservice/sms.php?smsService" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
<add name="errorCatchModule" type="WebModules.ErrorHandlerModule, WebModules" />
</httpModules>
</system.web>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
</compilers>
</system.codedom>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
<package id="jQuery" version="1.10.2" targetFramework="net45" />
<package id="jQuery.Validation" version="1.11.1" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.Web" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.WindowsServer" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.2.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="MySql.Data" version="6.9.11" targetFramework="net45" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
</packages>
\ No newline at end of file

using SuValue.DAL;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.BLL
{
/// <summary>
/// 医院
/// </summary>
public class HospitalBLL
{
/// <summary>
/// 医院地域分布情况
/// </summary>
/// <returns></returns>
public List<EntityReport> GetHospAreaTable()
{
using (sys_hospitalDAL dal = new sys_hospitalDAL())
{
List<EntityChartData> data = dal.GetHospAreaTable();
List<EntityReport> list = new List<EntityReport>();
list.Add(new EntityReport { chartData = data });
return list;
}
}
/// <summary>
/// 医院等级分布情况
/// </summary>
/// <returns></returns>
public List<EntityReport> GetHospLevelTable()
{
using (sys_hospitalDAL dal = new sys_hospitalDAL())
{
List<EntityChartData> data = dal.GetHospLevelTable();
List<EntityReport> list = new List<EntityReport>();
list.Add(new EntityReport { chartData = data });
return list;
}
}
/// <summary>
/// 医院性质
/// </summary>
/// <returns></returns>
public List<EntityReport> GetHospNaturesTable()
{
using (sys_hospitalDAL dal = new sys_hospitalDAL())
{
List<EntityChartData> data = dal.GetHospNaturesTable();
List<EntityReport> list = new List<EntityReport>();
list.Add(new EntityReport { chartData = data });
return list;
}
}
/// <summary>
/// 各省份医院数量
/// </summary>
/// <returns></returns>
public List<EntityProvinceCount> GetProvincialHospital()
{
using (sys_hospitalDAL dal = new sys_hospitalDAL())
{
List<EntityProvinceCount> list = dal.GetHospDataTable();//省份信息
return list;
}
}
}
}

using SuValue.DAL;
using SuValue.Database.Entity;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.BLL
{
/// <summary>
/// 菜单
/// </summary>
public class MenuBLL
{
/// <summary>
/// 根据菜单等级获取菜单集合
/// </summary>
/// <param name="level">级别</param>
/// <param name="openkey">项目编码</param>
/// <returns></returns>
public List<EntityMenu> GetMenuLevelList(int level, string openkey)
{
using (sys_menuDAL dal = new sys_menuDAL())
{
List<sys_menu> menuList = dal.GetMenuLevelList(level, openkey);
List<EntityMenu> mol = new List<EntityMenu>();
foreach (var item in menuList)
{
mol.Add(new EntityMenu(item));
}
return mol;
}
}
/// <summary>
/// 根据父级菜单ID获取二、三级菜单
/// </summary>
/// <param name="userid">用户编码</param>
/// <param name="parentID"></param>
/// <returns></returns>
public List<EntityMenu> GetMenuParentidList(int userid, int parentID)
{
using (sys_menuDAL dal = new sys_menuDAL())
{
List<EntityMenu> mol = new List<EntityMenu>();
//获取所有菜单
List<sys_menu> menuList = dal.GetObjects().Where(o => o.States == 0).OrderBy(o => o.Sort).ToList();
//获取一级菜单对应的条件
List<EntitySearchData> SearchDataList = new List<EntitySearchData>();
da_selectionDAL sdal = new da_selectionDAL(dal._db);
List<da_selection> selectionList = sdal.GetMenuIdList(parentID);
foreach (var item in selectionList)
{
EntitySearchData data = new EntitySearchData(item);
//1 表示直接获取 2表示需要到数据库中获取
if (item.type == 1)
{
foreach (var value in item.values.Split(','))
{
string[] key_value = value.Split('|');
if (key_value.Length > 1)
{
data.SelectItemList.Add(new EntitySelectItem { name = key_value[0], value = key_value[1] });
}
else
{
data.SelectItemList.Add(new EntitySelectItem { name = value, value = value });
}
}
}
else if (item.type == 2)
{
data.SelectItemList = sdal.GetSelectItem(userid, item.execSql);
}
SearchDataList.Add(data);
}
foreach (var item in menuList.Where(o => o.ParentID == parentID))//获取二级菜单
{
EntityMenu entity2 = new EntityMenu(item);
entity2.SearchDataList = SearchDataList;
mol.Add(entity2);
foreach (var item3 in menuList.Where(o => o.ParentID == item.ID))//获取三级菜单
{
EntityMenu entity3 = new EntityMenu(item3);
// entity3.SearchDataList = SearchDataList;
entity2.MenuList.Add(entity3);
}
}
return mol;
}
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SuValue.BLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuValue.BLL")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("f898f389-b960-44f7-b3c5-0544d1396b7d")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

using SuValue.DAL;
using SuValue.Entity;
using SuValue.Entity.Enum;
using SuValue.Entity.Request;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.BLL
{
public class ReportBLL
{
/// <summary>
/// 通过传入的条件拼接sql语句
/// </summary>
/// <param name="search"></param>
/// <returns></returns>
public string SqlWhere(EntitySearch mol)
{
string sql = " ";
if (!string.IsNullOrWhiteSpace(mol.Province))
{
sql = " and Province in (" + ToInStr(mol.Province) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.CommonName))
{
string CommonName = string.Empty;
string DrugName = string.Empty;
foreach (var item in mol.CommonName.Split(','))
{
var item1 = item.Split('&');
if (item1.Length > 1)
{
DrugName += " '" + item1[1] + "',";
}
CommonName += " '" + item1[0] + "',";
}
if (!string.IsNullOrEmpty(CommonName))
sql += " and CommonName in (" + (CommonName.Length > 1 ? CommonName.Substring(0, CommonName.Length - 1) : "") + ")";
if (!string.IsNullOrEmpty(DrugName))
sql += " and DrugName in (" + (DrugName.Length > 1 ? DrugName.Substring(0, DrugName.Length - 1) : "") + ")";
}
if (!string.IsNullOrWhiteSpace(mol.DrugName))
{
sql += " and DrugName in (" + ToInStr(mol.DrugName) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.Disease))
{
sql += " and Disease in (" + ToInStr(mol.Disease) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.HosLevel))
{
sql += " and HosLevel in (" + ToInStr(mol.HosLevel) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.HosType))
{
sql += " and HosType in (" + ToInStr(mol.HosType) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.Year))
{
sql += " and Year in (" + ToInStr(mol.Year) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.Month))
{
sql += " and Month in (" + ToInStr(mol.Month) + ")";
}
if (!string.IsNullOrWhiteSpace(mol.Source))
{
sql += " and Source in (" + ToInStr(mol.Source) + ")";
}
return sql;
}
/// <summary>
/// 转换sql In 条件
/// </summary>
/// <param name="str">需要转换sql语句</param>
/// <returns></returns>
private string ToInStr(string str)
{
string insql = string.Empty;
foreach (var item in str.Split(','))
{
insql += " '" + item + "',";
}
return insql.Length > 1 ? insql.Substring(0, insql.Length - 1) : "";
}
/// <summary>
/// 根据页面条件获取具体报表内容
/// </summary>
/// <param name="search"></param>
/// <returns></returns>
public List<EntityReport> GetReportData(EntitySearch search)
{
//根据菜单编码ID获取具体报表信息
if (search == null || search.MenuID.GetValueOrDefault() == 0) return new List<EntityReport>();
string wheresql = SqlWhere(search);
return GetRepots(search, search.MenuID.GetValueOrDefault(), wheresql, search.token);
}
/// <summary>
/// 根据菜单条件获取缓存数据
/// </summary>
/// <param name="MenuID"></param>
/// <param name="sqlwhere"></param>
/// <returns></returns>
public List<EntityReport> GetRepots(EntitySearch search, int MenuID, string wheresql, string project_open_key)
{
List<EntityReport> reportList = new List<EntityReport>();
using (da_reportDAL dal = new da_reportDAL())
{
List<da_report> repots = dal.GetMenuIDReportList(MenuID);
sys_projectDAL projectdal = new sys_projectDAL();
sys_project project = projectdal.GetOpenKey(project_open_key);
Sys_dataDAL datadal = new Sys_dataDAL(project);
foreach (var item in repots.OrderBy(o => o.sort))//组装具体报表
{
string sql = item.ExecSql.Replace("{wh}", " " + wheresql).Replace("{w}", " where 1=1 " + wheresql);
if (!string.IsNullOrEmpty(search.Year) && search.Year.IndexOf(',') == -1) { sql = sql.Replace("{year}", "" + search.Year).Replace("{yesteryear}", "" + (Convert.ToInt32(search.Year) - 1)); }
EntityReport report = new EntityReport
{
title = item.title,
vTitle = item.VTitle,
vUnit = item.VUnit,
xTitle = item.XTitle,
xUnit = item.XUnit,
yTitle = item.YTitle,
yUnit = item.YUnit,
chartType = item.charttype,
chartData = datadal.GetChartData(sql),
formula = item.formula,
specialType = item.SpecialType,
dataType = item.datatype
};
if (item.charttype == 98) //转换树型结构数据 树型结构 name 表示 树名称、X 自身ID Y 父级ID VALUE 具体内容
{
if (report.chartData == null) break;
if (report.treeData == null) report.treeData = new List<EntityTreeData>();
foreach (var chartdata in report.chartData.Where(o => o.y == "0").ToList())
{
report.treeData.Add(LoadTreeData(chartdata, report.chartData));
}
}
reportList.Add(report);
}
}
return reportList;
}
/// <summary>
/// 重新加载树型数据
/// </summary>
/// <param name="report"></param>
public EntityTreeData LoadTreeData(EntityChartData chartdata, List<EntityChartData> chartdatalist)
{
EntityTreeData treedata = new EntityTreeData
{
name = chartdata.name,
value = chartdata.value.ToString(),
children = new List<EntityTreeData>()
};
foreach (var item in chartdatalist.Where(o => o.y == chartdata.x).ToList())
{
treedata.children.Add(LoadTreeData(item, chartdatalist));
}
return treedata;
}
/// <summary>
/// 根据条件再次柱状SQL语句
/// </summary>
/// <param name="search"></param>
/// <param name="sql">需要执行的SQL语句</param>
/// <returns></returns>
public List<EntityChartData> GetChartData(EntitySearch search, string sql)
{
string year = "";
if (search.Year != null)
{
year = search.Year;
search.Year = null;
}
string wheresql = SqlWhere(search);
sys_projectDAL projectdal = new sys_projectDAL();
sys_project project = projectdal.GetOpenKey(search.token);
Sys_dataDAL datadal = new Sys_dataDAL(project);
return datadal.GetChartData(sql.Replace("{wh}", " " + wheresql).Replace("{w}", " where 1=1 " + wheresql).Replace("{year}", "" + year), false, false);
}
/// <summary>
/// 根据条件获取表单
/// </summary>
/// <param name="search"></param>
/// <param name="sql">需要执行的SQL语句</param>
/// <returns></returns>
public List<T> GetTableData<T>(EntitySearch search, string sql) where T : new()
{
string year = "";
if (search.Year != null)
{
year = search.Year;
search.Year = null;
}
string wheresql = SqlWhere(search);
sys_projectDAL projectdal = new sys_projectDAL();
sys_project project = projectdal.GetOpenKey(search.token);
Sys_dataDAL datadal = new Sys_dataDAL(project);
return datadal.GetTableData<T>(sql.Replace("{wh}", " " + wheresql).Replace("{w}", " where 1=1 " + wheresql).Replace("{year}", "" + year).Replace("{yesteryear}", "" + (Convert.ToInt32(year) - 1)));
}
}
}

using SuValue.DAL;
using SuValue.Database.Entity;
using SuValue.Entity;
using SuValue.Entity.Enum;
using SuValue.Helpers.Message;
using System;
using System.Collections.Generic;
using System.Net;
namespace SuValue.BLL
{
/// <summary>
/// 短信
/// </summary>
public class SMSBLL
{
/// <summary>
/// 获取验证码
/// </summary>
/// <param name="mobile">手机号</param>
/// <param name="type">验证方式:1是短信 2是语音</param>
/// <returns></returns>
public EntityResult Mesage(string mobile, SMSType smstype, MessageType messagetype)
{
EntityResult result = new EntityResult(ResultType.Fail, "");
if (!MessageHelper.IsMobilePhone(mobile)) return new EntityResult(ResultType.Fail, "手机号格式错误");
using (sms_mtDAL dal = new sms_mtDAL())
{
//判断是否是用户
sys_userDAL udal = new sys_userDAL(dal._db);
sys_user user = udal.GetMobileLoginInfo(mobile);
if (messagetype == MessageType.Login && user == null) return new EntityResult(ResultType.Fail, "对不起,您输入的手机号码不是系统用户");
//生成随机数
Random rad = new Random();
int mobile_code = rad.Next(1000, 10000);
//SMSType 数据库存储 ,所有消息都为1
sms_mt mol = new sms_mt() { CreateDate = DateTime.Now, CreateUser = user == null ? 0 : user.ID, Message = mobile_code.ToString(), Mobile = mobile, SMSType = (int)SMSType.Message, MessageType = (int)messagetype };
sms_mtDAL mdal = new sms_mtDAL(dal._db);
result = mdal.Insert(mol);
if (result.state == ResultType.Success)
{
//如果保存成功
//调用发送验证码的接口
//短信验证
HttpWebResponse myResponse = MessageHelper.Message(mobile, mobile_code.ToString(), (int)smstype);
if (myResponse.StatusCode == HttpStatusCode.OK)
{
return new EntityResult(ResultType.Success, "验证码发送成功");
}
else
{
//访问失败
return new EntityResult(ResultType.Fail, "验证码获取失败");
}
}
return result;
}
}
/// <summary>
/// 校验验证码是否正确
/// </summary>
/// <param name="mobile">手机号码</param>
/// <param name="type">验证码类型</param>
/// <returns></returns>
public EntityResult CheckMessage(string mobile, string code, SMSType smstype, MessageType messagetype)
{
EntityResult result = new EntityResult(ResultType.Success, "");
if (!MessageHelper.IsMobilePhone(mobile)) return new EntityResult(ResultType.Fail, "手机号格式错误");
//判断是否是用户
using (sms_mtDAL dal = new sms_mtDAL())
{
sys_userDAL udal = new sys_userDAL(dal._db);
sys_user user = udal.GetMobileLoginInfo(mobile);
if (messagetype == MessageType.Login && user == null) return new EntityResult(ResultType.Fail, "对不起,您输入的手机号码不是系统用户");
if (messagetype == MessageType.Modify && user != null) return new EntityResult(ResultType.Fail, "对不起,您输入的手机号码已经是系统用户");
sms_mt mt = dal.GetSendMessage(mobile, code, smstype, messagetype);
if (mt == null) return new EntityResult(ResultType.Fail, "验证码错误");
return result;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F898F389-B960-44F7-B3C5-0544D1396B7D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SuValue.BLL</RootNamespace>
<AssemblyName>SuValue.BLL</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ReportBLL.cs" />
<Compile Include="HospitalBLL.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SMSBLL.cs" />
<Compile Include="MenuBLL.cs" />
<Compile Include="TaskBLL.cs" />
<Compile Include="UserBLL.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<ProjectReference Include="..\SuValue.DAL\SuValue.DAL.csproj">
<Project>{95747DBB-C070-4BEE-AFBB-ED60C32B309D}</Project>
<Name>SuValue.DAL</Name>
</ProjectReference>
<ProjectReference Include="..\SuValue.Database\SuValue.Database.csproj">
<Project>{d54fdaeb-8bc2-43df-aeea-afcdbdabbb7b}</Project>
<Name>SuValue.Database</Name>
</ProjectReference>
<ProjectReference Include="..\SuValue.Entity\SuValue.Entity.csproj">
<Project>{d1ad8be3-9869-4cb0-95e9-f18a0bfb1585}</Project>
<Name>SuValue.Entity</Name>
</ProjectReference>
<ProjectReference Include="..\SuValue.Helpers\SuValue.Helpers.csproj">
<Project>{78aeb25d-4cb5-4cb6-975d-6bd45e0799b0}</Project>
<Name>SuValue.Helpers</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file

using SuValue.DAL;
using SuValue.Database;
using SuValue.Database.Entity;
using SuValue.Entity;
using SuValue.Entity.Enum;
using SuValue.Entity.Responese;
using SuValue.Helpers.Message;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace SuValue.BLL
{
/// <summary>
/// 用户
/// </summary>
public class UserBLL
{
/// <summary>
/// Login
/// </summary>
/// <param name="mobile">手机号</param>
/// <param name="code">验证码</param>
/// <returns></returns>
public EntityResult Login(string mobile, string code, string openkey)
{
EntityResult result = new EntityResult(ResultType.Success, "");
if (!MessageHelper.IsMobilePhone(mobile))
{
return new EntityResult(ResultType.Fail, "手机号格式错误");
}
if (string.IsNullOrWhiteSpace(mobile) || string.IsNullOrWhiteSpace(code))
{
return new EntityResult(ResultType.Fail, "验证或手机号不能为空!");
}
using (sys_userDAL dal = new sys_userDAL())
{
sms_mtDAL sdal = new sms_mtDAL(dal._db);
sms_mt mt = sdal.GetSendMessage(mobile, code, MessageType.Login);
if (mt == null)//获取验证码没有保存成功
{
return new EntityResult(ResultType.Fail, "验证码或手机号输入有误!");
}
//从原先1天改成60秒内有效
if (mt.CreateDate.AddSeconds(60) <= DateTime.Now)
{
return new EntityResult(ResultType.Fail, "验证码已经失效,请重新获取!");//验证码还要提示
}
List<sys_user_project> uplist = new sys_user_projectDAL(dal._db).GetObjects(" where userid = " + mt.CreateUser + " and projectid in (select id from sys_project where open_key = '" + openkey + "') ");
if (uplist == null) return new EntityResult(ResultType.Fail, "登陆失败,此用户缺少与项目之前关联信息");
//获取用户信息
sys_user user = dal.GetObject(mt.CreateUser);
if (user == null) return new EntityResult(ResultType.Fail, "用户信息不存在请联系管理员");
EntityUser lists = new EntityUser(user);
//返回一个list集合
return new EntityResult(ResultType.Success, "", lists);
}
}
/// <summary>
/// 获取用户信息
/// </summary>
/// <param name="userid"></param>
/// <returns></returns>
public sys_user GetUserInfo(int userid)
{
using (sys_userDAL dal = new sys_userDAL())
{
//关联用户登陆表取微信号
sys_user obj = dal.GetObject(userid);
return obj;
}
}
/// <summary>
/// 修改用户信息
/// </summary>
/// <param name="mol">实体类</param>
/// <returns></returns>
public EntityResult Update(SuValue.Entity.Request.EntityUser model)
{
if (model == null) return new EntityResult(ResultType.Fail, "修改用户信息不存在");
if (string.IsNullOrWhiteSpace(model.UserName) || string.IsNullOrWhiteSpace(model.Mobile)) return new EntityResult(ResultType.Fail, "姓名与手机号不能为空!");
if (!MessageHelper.IsMobilePhone(model.Mobile)) return new EntityResult(ResultType.Fail, "手机号格式错误!");
sys_user mol = GetUserInfo(model.ID);
#region 赋值区
mol.CorporateName = model.CorporateName;
mol.Department = model.Department;
mol.Duties = model.Duties;
mol.HeadPortrait = model.HeadPortrait;
mol.Mail = model.Mail;
mol.Mobile = model.Mobile;
mol.UserName = model.UserName;
mol.Updateuser = model.ID;
mol.UpdateDate = DateTime.Now;
mol.Perfect = 1;
#endregion
//获取手机账号信息
EntityResult result = new EntityResult(ResultType.Success);
using (sys_userDAL dal = new sys_userDAL())
{
if (!string.IsNullOrEmpty(model.Mobile)) //如果手机号码为空,将不补全
{
sys_logininfoDAL ldal = new sys_logininfoDAL(dal._db);
sys_logininfo mobileLoginInfo = ldal.GetUserLoginInfo(model.ID).Where(o => o.Type == (int)LoginInfoType.Mobile).FirstOrDefault();
if (mobileLoginInfo == null) //需要新增用户手机登陆账号信息
{
result = ldal.Insert(new sys_logininfo { CreateDate = DateTime.Now, LoginName = model.Mobile, Type = (int)LoginInfoType.Mobile, UserID = model.ID });
}
else if (mobileLoginInfo.LoginName != model.Mobile && !string.IsNullOrEmpty(model.MobileCode))
{
sms_mtDAL sdal = new sms_mtDAL(dal._db);
sms_mt mt = sdal.GetSendMessage(model.Mobile, model.MobileCode, MessageType.Modify);
if (mt == null) return new EntityResult(ResultType.Fail, "手机验证码错误");
mobileLoginInfo.LoginName = model.Mobile;
ldal.Update(mobileLoginInfo);
}
}
if (result.state != ResultType.Success) return result;
result = dal.Update(mol);
return result;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
</configuration>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.

using SuValue.Database;
using SuValue.Database.Entity;
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public class DemoDAL : IDisposable
{
public DbUtility _db { get; set; }
public void Dispose()
{
_db.CloseConnection();
}
#region 构造函数
public DemoDAL()
{
_db = new DbUtility();
_db.OpenConnection();
}
public DemoDAL(DbUtility db)
{
this._db = db;
}
#endregion
#region 增删方法
/// <summary>
/// 删除对象
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public EntityResult Delete(int id)
{
string sql = _db.ObjectToDeleteSql<sys_user>(new sys_user { ID = id });
int result = _db.ExecuteNonQuerySql(sql);
if (result > 0) return new EntityResult(ResultType.Success);
else return new EntityResult(ResultType.Error);
}
/// <summary>
/// 添加对象
/// </summary>
/// <param name="t">添加对象</param>
/// <returns>默认添加成功后,将自增主键放在Data中,根据自己的类型自行转换</returns>
public EntityResult Insert(sys_user t)
{
string sql = _db.ObjectToInsertSql<sys_user>(t);
int result = _db.ExecuteNonQuerySql(sql);
int id = Convert.ToInt32(_db.ExecuteScalarSql(" select LAST_INSERT_ID(); "));
t.ID = id;
if (result > 0) return new EntityResult(ResultType.Success, string.Empty, id);
else return new EntityResult(ResultType.Error);
}
/// <summary>
/// 修改对象
/// </summary>
/// <param name="t">默认根据主键作为条件</param>
/// <returns></returns>
public EntityResult Update(sys_user t)
{
string sql = _db.ObjectToUpdateSql<sys_user>(t);
int result = _db.ExecuteNonQuerySql(sql);
if (result > 0) return new EntityResult(ResultType.Success);
else return new EntityResult(ResultType.Error);
}
#endregion
#region 返回单个对象
/// <summary>
/// 获取对象
/// </summary>
/// <returns>返回对象</returns>
protected sys_user GetObject()
{
sys_user obj = _db.QueryForObjectSql<sys_user>(new sys_user());
return obj;
}
/// <summary>
/// 获取对象
/// </summary>
/// <param name="where">查询条件</param>
/// <returns>返回对象</returns>
protected sys_user GetObject(string where)
{
sys_user obj = _db.QueryForObjectSql<sys_user>(new sys_user(), where);
return obj;
}
/// <summary>
/// 获取对象
/// </summary>
/// <param name="where">查询条件</param>
/// <param name="orderby">排序</param>
/// <returns>返回对象</returns>
protected sys_user GetObject(string where, string orderby)
{
sys_user obj = _db.QueryForObjectSql<sys_user>(new sys_user(), where, orderby);
return obj;
}
#endregion
#region 返回集合
/// <summary>
/// 获取对象集合
/// </summary>
/// <returns>返回象集合</returns>
protected List<sys_user> GetObjects()
{
List<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user());
return obj;
}
/// <summary>
/// 获取对象集合
/// </summary>
/// <param name="where">查询条件</param>
/// <returns>返回象集合</returns>
protected List<sys_user> GetObjects(string where)
{
List<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user(), where);
return obj;
}
/// <summary>
/// 获取对象集合
/// </summary>
/// <param name="where">查询条件</param>
/// <param name="orderby">排序</param>
/// <returns>返回象集合</returns>
protected List<sys_user> GetObjects(string where, string orderby)
{
List<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user(), where, orderby);
return obj;
}
#endregion
#region 返回分页集合
/// <summary>
/// 分页获取对象
/// </summary>
/// <param name="pageindex">当前页</param>
/// <param name="pagesize">每页条数</param>
/// <returns>返回分页集合</returns>
protected Page<sys_user> GetObjects(int pageindex, int pagesize)
{
Page<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user(), pageindex, pagesize);
return obj;
}
/// <summary>
/// 分页获取对象
/// </summary>
/// <param name="pageindex">当前页</param>
/// <param name="pagesize">每页条数</param>
/// <param name="where">查询条件</param>
/// <returns>返回分页集合</returns>
protected Page<sys_user> GetObjects(int pageindex, int pagesize, string where)
{
Page<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user(), pageindex, pagesize, where);
return obj;
}
/// <summary>
/// 分页获取对象
/// </summary>
/// <param name="pageindex">当前页</param>
/// <param name="pagesize">每页条数</param>
/// <param name="where">查询条件</param>
/// <param name="orderby">排序</param>
/// <returns>返回分页集合</returns>
protected Page<sys_user> GetObjects(int pageindex, int pagesize, string where, string orderby)
{
Page<sys_user> obj = _db.QueryForListSql<sys_user>(new sys_user(), pageindex, pagesize, where, orderby);
return obj;
}
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public class DiseaseDAL
{
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SuValue.DAL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuValue.DAL")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("95747dbb-c070-4bee-afbb-ed60c32b309d")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{95747DBB-C070-4BEE-AFBB-ED60C32B309D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SuValue.DAL</RootNamespace>
<AssemblyName>SuValue.DAL</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.11\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="da_reportDAL.cs" />
<Compile Include="da_selectionDAL.cs" />
<Compile Include="DemoDAL.cs" />
<Compile Include="DiseaseDAL.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Auto\TempDAL.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>TempDAL.tt</DependentUpon>
</Compile>
<Compile Include="sms_mtDAL.cs" />
<Compile Include="sys_areaDAL.cs" />
<Compile Include="Sys_dataDAL.cs" />
<Compile Include="sys_hospitalDAL.cs" />
<Compile Include="sys_loginInfoDAL.cs" />
<Compile Include="sys_menuDAL.cs" />
<Compile Include="sys_projectDAL.cs" />
<Compile Include="sys_taskDAL.cs" />
<Compile Include="sys_task_configDAL.cs" />
<Compile Include="sys_userDAL.cs" />
<Compile Include="T.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SuValue.Database\SuValue.Database.csproj">
<Project>{d54fdaeb-8bc2-43df-aeea-afcdbdabbb7b}</Project>
<Name>SuValue.Database</Name>
</ProjectReference>
<ProjectReference Include="..\SuValue.Entity\SuValue.Entity.csproj">
<Project>{D1AD8BE3-9869-4CB0-95E9-F18A0BFB1585}</Project>
<Name>SuValue.Entity</Name>
</ProjectReference>
<ProjectReference Include="..\SuValue.Helpers\SuValue.Helpers.csproj">
<Project>{78aeb25d-4cb5-4cb6-975d-6bd45e0799b0}</Project>
<Name>SuValue.Helpers</Name>
</ProjectReference>
<ProjectReference Include="..\Suvalue.Redis\Suvalue.Redis.csproj">
<Project>{040101e3-6011-49b0-b172-4d3bd3fea51d}</Project>
<Name>Suvalue.Redis</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<Content Include="Auto\TempDAL.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>TempDAL.cs</LastGenOutput>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
using SuValue.Database;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public class Sys_dataDAL : IDisposable
{
public string connstr = ConfigurationManager.ConnectionStrings["mysql_connectionString"].ToString();
public DbUtility _db { get; set; }
public void Dispose()
{
_db.CloseConnection();
}
#region 构造函数
public Sys_dataDAL(sys_project project)
{
_db = new DbUtility(connstr.Replace("{server}", project.data_server).Replace("{database}", project.data_database).Replace("{login}", project.data_login).Replace("{password}", project.data_password), Database.Enum.DbProviderType.MySql);
_db.OpenConnection();
}
#endregion
/// <summary>
/// 根据sql 获取具体报表数据
/// </summary>
/// <param name="sql"></param>
/// <returns></returns>
public List<EntityChartData> GetChartData(string sql)
{
if (string.IsNullOrEmpty(sql)) return new List<EntityChartData>();
List<EntityChartData> list = _db.QueryForListSql<EntityChartData>(sql);
// 清除X轴和Y轴空数据
list.RemoveAll(o => string.IsNullOrEmpty(o.y));
list.RemoveAll(o => string.IsNullOrEmpty(o.x));
return list;
}
}
}
namespace SuValue.DAL
{
internal class T
{
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data></configuration>
\ No newline at end of file
using SuValue.Database;
using SuValue.Entity;
using SuValue.Entity.Request;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class da_reportDAL
{
/// <summary>
/// 根据菜单ID获取报表
/// </summary>
/// <param name="menuid">菜单编码</param>
/// <returns></returns>
public List<da_report> GetMenuIDReportList(int menuid)
{
return _db.QueryForListSql<da_report>(new da_report(), " where menuid = " + menuid);
}
}
}
using Suvalue.Redis;
using SuValue.Database;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class da_selectionDAL
{
/// <summary>
/// 根据菜单ID获取条件
/// </summary>
/// <param name="meunid">菜单ID</param>
/// <returns></returns>
public List<da_selection> GetMenuIdList(int menuid)
{
RedisHelper redis = new RedisHelper();
List<da_selection> list = redis.StringGet<List<da_selection>>(menuid.ToString());
if (list == null)
{
list = _db.QueryForListSql(new da_selection(), string.Format(" where menuid = {0}", menuid), " order by sort ");
redis.StringSet(menuid.ToString(), list, new TimeSpan(DateTime.Now.Ticks));
}
return list;
}
/// <summary>
/// 根据sql语句获取报表条件
/// </summary>
/// <param name="sql"></param>
/// <returns></returns>
public List<EntitySelectItem> GetSelectItem(int userid, string sql)
{
if (string.IsNullOrEmpty(sql)) return new List<EntitySelectItem>();
sql = sql.Replace("{w}", " where userid = " + userid.ToString()).Replace("{wh}", " and userid = " + userid.ToString());
RedisHelper redis = new RedisHelper();
List<EntitySelectItem> list = redis.StringGet<List<EntitySelectItem>>(sql);
if (list == null)
{
list = _db.QueryForListSql<EntitySelectItem>(sql);
redis.StringSet(sql, list, new TimeSpan(DateTime.Now.Ticks));
}
return list;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MySql.Data" version="6.9.11" targetFramework="net45" />
</packages>
\ No newline at end of file
using SuValue.Entity;
using SuValue.Entity.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sms_mtDAL
{
/// <summary>
/// 根据手机号码获取短信验证码
/// </summary>
/// <param name="Mobile"></param>
/// <param name="code"></param>
/// <param name="smstype"></param>
/// <returns></returns>
public sms_mt GetSendMessage(string Mobile, string code, SMSType smstype, MessageType messagetype)
{
var where = " Where Mobile='" + Mobile + "' and message =" + code + " and smstype = " + (int)smstype + " and messagetype=" + (int)messagetype;
return _db.QueryForObjectSql(new sms_mt(), where, " order by createdate desc ");
}
/// <summary>
/// 根据手机号码获取短信验证码
/// </summary>
/// <param name="Mobile"></param>
/// <param name="code"></param>
/// <returns></returns>
public sms_mt GetSendMessage(string Mobile, string code, MessageType messagetype)
{
var where = " Where Mobile='" + Mobile + "' and message =" + code + " and messagetype=" + (int)messagetype;
return _db.QueryForObjectSql(new sms_mt(), where, " order by createdate desc ");
}
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
/// <summary>
/// 城市
/// </summary>
public partial class sys_areaDAL
{
}
}
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
/// <summary>
/// 医院
/// </summary>
public partial class sys_hospitalDAL
{
/// <summary>
/// 获取有效医院
/// </summary>
/// <returns></returns>
public List<sys_hospital> GetValidHospital()
{
return _db.QueryForListSql<sys_hospital>(new sys_hospital(), " where iscount = 1 ");
}
#region API首页数据源
/// <summary>
/// 医院地域分布情况
/// </summary>
/// <returns></returns>
public List<EntityChartData> GetHospAreaTable()
{
string sql = @"select count(*) as Value, area as Name from view_hos_info group by area order by name ";
List<EntityChartData> list = _db.QueryForListSql<EntityChartData>(sql);
return list;
}
/// <summary>
/// 医院等级分布情况
/// </summary>
/// <returns></returns>
public List<EntityChartData> GetHospLevelTable()
{
string sql = @"select count(*) as Value,Level as Name from view_hos_info group by Level order by name ";
List<EntityChartData> list = _db.QueryForListSql<EntityChartData>(sql);
return list;
}
/// <summary>
/// 医院性质
/// </summary>
/// <returns></returns>
public List<EntityChartData> GetHospNaturesTable()
{
string sql = @"select count(*) as Value, type as Name from view_hos_info group by type order by name ";
return _db.QueryForListSql<EntityChartData>(sql);
}
#endregion
/// <summary>
/// 各省医院数量
/// </summary>
/// <returns></returns>
public List<EntityProvinceCount> GetHospDataTable()
{
string sql = @" select area,city_name,max(case level when '一级综合' then num else 0 end ) 'ClaACompHosp',
max(case level when '一级中医' then num else 0 end) 'ClaAInHosp',
max(case level when '一级妇幼' then num else 0 end ) 'ClaAMaterHosp',
max(case level when '二级综合' then num else 0 end) 'ClaBCompHosp',
max(case level when '二级中医' then num else 0 end) 'ClaBInHosp',
max(case level when '二级妇幼' then num else 0 end) 'ClaBMaterHosp',
max(case level when '三级综合' then num else 0 end) 'ClaCCompHosp',
max(case level when '三级中医' then num else 0 end) 'ClaCInHosp',
max(case level when '三级妇幼' then num else 0 end ) 'ClaCMaterHosp',
max(case level when '汇总' then num else 0 end ) 'Summary'
from (
SELECT area, city_name,CONCAT(level,type)level,count(*) num FROM view_hos_info group by area, city_name, level ,type
union all
SELECT area,'汇总', CONCAT(level,type)level,count(*) num FROM view_hos_info group by area, level ,type
union all
SELECT area, city_name,'汇总'level,count(*) num FROM view_hos_info group by area,city_name
union all
SELECT area, '汇总'city_name, '汇总' level,count(*) num FROM view_hos_info group by area
) tab
group by area,city_name order by city_name<>'汇总' desc ";
return _db.QueryForListSql<EntityProvinceCount>(sql);
}
}
}
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_logininfoDAL
{
/// <summary>
/// 获取用户登陆账号信息
/// </summary>
/// <param name="userid">用户编码</param>
/// <returns></returns>
public List<sys_logininfo> GetUserLoginInfo(int userid)
{
return _db.QueryForListSql(new sys_logininfo(), string.Format(" where userid = {0}", userid));
}
}
}
using SuValue.Database;
using SuValue.Entity;
using SuValue.Entity.Responese;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_menuDAL
{
/// <summary>
/// 根据菜单级别查询
/// </summary>
/// <param name="Level">级别</param>
/// <param name="openkey">项目编码</param>
/// <returns></returns>
public List<sys_menu> GetMenuLevelList(int Level, string openkey)
{
return _db.QueryForListSql(new sys_menu(), " where states = 0 and Level=" + Level + " and projectid in (select id from sys_project where open_key = '" + openkey + "') ", " order by Sort ");
}
}
}
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_projectDAL
{
/// <summary>
/// 根据openkey返回项目信息
/// </summary>
/// <param name="openkey"></param>
/// <returns></returns>
public sys_project GetOpenKey(string openkey)
{
return _db.QueryForObjectSql(new sys_project(), string.Format(" where open_key = '{0}'", openkey));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_taskDAL
{
}
}
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_task_configDAL
{
/// <summary>
/// 根据任务编码获取配置文件
/// </summary>
/// <param name="taskid">任务ID</param>
/// <returns></returns>
public List<sys_task_config> GetTaksConfigList(int taskid)
{
return _db.QueryForListSql(new sys_task_config(), " where IsEnable = 1 and task_id = " + taskid.ToString());
}
}
}
using SuValue.Database;
using SuValue.Database.Entity;
using SuValue.Entity;
using SuValue.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.DAL
{
public partial class sys_userDAL
{
/// <summary>
/// 根据手机号码获取用户账号信息
/// </summary>
/// <param name="mobile"></param>
/// <returns></returns>
public sys_user GetMobileLoginInfo(string mobile)
{
return _db.QueryForObjectSql<sys_user>(string.Format("select * from sys_user where id in (select userid from sys_logininfo where loginname = '{0}' and type = 2 )", mobile));
}
}
}
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Database
{
/// <summary>
/// 自定义属性,用于指示如何从DataTable或者DbDataReader中读取类的属性值
/// </summary>
public class ColumnAttribute : Attribute
{
/// <summary>
/// 构造函数
/// </summary>
/// <param name="isFilter">是否过滤</param>
public ColumnAttribute(bool isFilter)
: this("", isFilter, false)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="columnName">属性对应的字段</param>
public ColumnAttribute(string columnName)
: this(columnName, false, false)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="columnName">类属性对应的列名</param>
/// <param name="isFilter">是否过滤</param>
public ColumnAttribute(string columnName, bool isFilter)
: this(columnName, isFilter, false)
{
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="columnName">类属性对应的列名</param>
/// <param name="isFilter">是否过滤</param>
/// <param name="isPrimaryKey">是否是主键</param>
public ColumnAttribute(string columnName, bool isFilter, bool isPrimaryKey)
{
ColumnName = columnName;
IsFilter = isFilter;
IsPrimaryKey = isPrimaryKey;
}
/// <summary>
/// 属性对应的字段名称
/// </summary>
public string ColumnName { get; set; }
/// <summary>
/// 属性是否参加拼写SQL语句
/// </summary>
public bool IsFilter { get; set; }
/// <summary>
/// 属性是否主键
/// </summary>
public bool IsPrimaryKey { get; set; }
/// <summary>
/// 属性值
/// </summary>
public object Value { get; set; }
/// <summary>
/// 字段数据类型
/// </summary>
public DbType? dbType { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Database.Entity
{
public class Page<T>
{
public Page(IList<T> t, int pageIndex, int pageSize, int totalItemCount)
{
PageList = t;
PageSize = pageSize;
PageIndex = pageIndex;
TotalItemCount = totalItemCount;
}
public Page(IList<T> t, int totalItemCount)
{
PageList = t;
PageSize = 0;
PageIndex = 0;
TotalItemCount = totalItemCount;
}
/// <summary>
/// 当前页数据集
/// </summary>
public IList<T> PageList { get; set; }
/// <summary>
/// 每页多少条
/// </summary>
public int PageSize { get; set; }
/// <summary>
/// 当前页数
/// </summary>
public int PageIndex { get; set; }
/// <summary>
/// 总条数
/// </summary>
public int TotalItemCount { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Database.Enum
{
/// <summary>
/// 数据库类型枚举
/// </summary>
public enum DbProviderType : byte
{
SqlServer,
MySql,
SQLite,
Oracle,
ODBC,
OleDb,
Firebird,
PostgreSql,
DB2,
Informix,
SqlServerCe
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SuValue.Database")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuValue.Database")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("d54fdaeb-8bc2-43df-aeea-afcdbdabbb7b")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using SuValue.Database.Enum;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Database
{
/// <summary>
/// DbProviderFactory工厂类
/// </summary>
public class ProviderFactory
{
private static Dictionary<DbProviderType, string> providerInvariantNames = new Dictionary<DbProviderType, string>();
private static Dictionary<DbProviderType, DbProviderFactory> providerFactoies = new Dictionary<DbProviderType, DbProviderFactory>(20);
static ProviderFactory()
{
//加载已知的数据库访问类的程序集
providerInvariantNames.Add(DbProviderType.SqlServer, "System.Data.SqlClient");
providerInvariantNames.Add(DbProviderType.OleDb, "System.Data.OleDb");
providerInvariantNames.Add(DbProviderType.ODBC, "System.Data.ODBC");
providerInvariantNames.Add(DbProviderType.Oracle, "Oracle.DataAccess.Client");
providerInvariantNames.Add(DbProviderType.MySql, "MySql.Data.MySqlClient");
providerInvariantNames.Add(DbProviderType.SQLite, "System.Data.SQLite");
providerInvariantNames.Add(DbProviderType.Firebird, "FirebirdSql.Data.Firebird");
providerInvariantNames.Add(DbProviderType.PostgreSql, "Npgsql");
providerInvariantNames.Add(DbProviderType.DB2, "IBM.Data.DB2.iSeries");
providerInvariantNames.Add(DbProviderType.Informix, "IBM.Data.Informix");
providerInvariantNames.Add(DbProviderType.SqlServerCe, "System.Data.SqlServerCe");
}
/// <summary>
/// 获取指定数据库类型对应的程序集名称
/// </summary>
/// <param name="providerType">数据库类型枚举</param>
/// <returns></returns>
public static string GetProviderInvariantName(DbProviderType providerType)
{
return providerInvariantNames[providerType];
}
/// <summary>
/// 获取指定类型的数据库对应的DbProviderFactory
/// </summary>
/// <param name="providerType">数据库类型枚举</param>
/// <returns></returns>
public static DbProviderFactory GetDbProviderFactory(DbProviderType providerType)
{
//如果还没有加载,则加载该DbProviderFactory
if (!providerFactoies.ContainsKey(providerType))
{
providerFactoies.Add(providerType, ImportDbProviderFactory(providerType));
}
return providerFactoies[providerType];
}
/// <summary>
/// 加载指定数据库类型的DbProviderFactory
/// </summary>
/// <param name="providerType">数据库类型枚举</param>
/// <returns></returns>
private static DbProviderFactory ImportDbProviderFactory(DbProviderType providerType)
{
string providerName = providerInvariantNames[providerType];
DbProviderFactory factory = null;
try
{
//从全局程序集中查找
factory = DbProviderFactories.GetFactory(providerName);
}
catch (ArgumentException e)
{
factory = null;
}
return factory;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D54FDAEB-8BC2-43DF-AEEA-AFCDBDABBB7B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SuValue.Database</RootNamespace>
<AssemblyName>SuValue.Database</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.11\lib\net45\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ColumnAttribute.cs" />
<Compile Include="DbUtility.cs" />
<Compile Include="EntityReader.cs" />
<Compile Include="ProviderFactory.cs" />
<Compile Include="Entity\Page.cs" />
<Compile Include="Enum\DbProviderType.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MySql.Data" version="6.9.11" targetFramework="net45" />
</packages>
\ No newline at end of file
<#@ template debug="true" hostspecific="false" language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="System" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="$(TargetDir)\MySql.Data.dll" #>
<#@ assembly name="System.xml" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="MySql.Data.MySqlClient" #>
<#@ import namespace="System.Data" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Linq" #>
<#
List<Entity> objs = new List<Entity>();
var server="116.62.245.55";
var database="bigdata_base";
var uid="suvalue";
var pwd="suvalue2017";
using (var connection = new MySqlConnection(string.Format("Server={0};Database={1};Uid={2};Pwd={3};pooling=true;charset=utf8;Convert Zero Datetime=True;Port=3306;",server,database,uid,pwd)))
{
var command = connection.CreateCommand();
connection.Open();
string queryString = @"select column_name,data_type,column_key,column_comment,table_name from information_schema.columns where (table_name like 'sys_%' || table_name like 'da_%' || table_name like 'sms_%') and table_schema='{0}'";
command.CommandText = string.Format(queryString, database);
MySqlDataReader reader = command.ExecuteReader();
try
{
while (reader.Read())
{
Entity obj = new Entity(){ table_name = reader.GetString(4),column_name = reader.GetString(0),data_type = reader.GetString(1),column_key = reader.GetString(2),column_comment = reader.GetString(3)};
objs.Add(obj);
}
}
finally
{
// always call Close when done reading.
reader.Close();
connection.Close();
}
}
#>
using System;
using SuValue.Database;
namespace SuValue.Entity
{
<# foreach (var table in objs.GroupBy(o => o.table_name))
{ #>
[Serializable]
public partial class <#=table.Key#>
{
<#
foreach (var item in table)
{#>
/// <summary>
/// <#=item.column_comment#>
/// </summary>
[ColumnAttribute("<#=item.column_name#>", false, <#=item.column_key == "PRI"?"true":"false"#>)]
public <#=GetFrameworkTypeFromNativeType(item.data_type)#> <#=item.column_name#> { get; set; }
<# } #>
}
<# } #>
}
<#+
private string ConvertTableNameToEntityName(string tableName)
{
bool ok = true;
StringBuilder r = new StringBuilder();
for (int i = 0; i < tableName.Length; i++)
{
if (tableName[i] == '_')
{
ok = true;
}
else
{
if (ok)
{
r.Append(tableName.Substring(i, 1).ToUpper());
ok = false;
}
else
{
r.Append(tableName.Substring(i, 1).ToLower());
}
}
}
return r.ToString();
}
#>
<#+
private static string GetFrameworkTypeFromNativeType(string NativeType)
{
if (NativeType == "uniqueidentifier" )
return "Guid";
else if (NativeType == "varchar" || NativeType == "char"|| NativeType == "longtext"|| NativeType == "text")
return "String";
else if (NativeType == "datetime")
return "DateTime";
else if (NativeType == "bigint")
return "Int64";
else if (NativeType == "int"||NativeType == "bit")
return "int";
else if (NativeType == "tinyint")
return "bool";
else if (NativeType == "decimal")
return "double";
return "Not .NET Framework DataType";
}
#>
<#+
public class Entity
{
/// <summary>
/// 表名称
/// </summary>
public string table_name { get; set; }
/// <summary>
/// 列名
/// </summary>
public string column_name { get; set; }
/// <summary>
/// 数据类型
/// </summary>
public string data_type { get; set; }
/// <summary>
/// 是否主键
/// </summary>
public string column_key { get; set; }
/// <summary>
/// 描述
/// </summary>
public string column_comment { get; set; }
}
#>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity
{
public class EntityBase
{
/// <summary>
/// app名称
/// </summary>
public string appname { get; set; }
/// <summary>
/// 校验码
/// </summary>
public string token { get; set; }
/// <summary>
/// 设备号 1 苹果 2 安卓 3 网页
/// </summary>
public string device { get; set; }
/// <summary>
/// 版本号 纯数字 如:10000 对应 1.0.0.0.0
/// </summary>
public string version { get; set; }
/// <summary>
/// 操作用户
/// </summary>
public string userid { get; set; }
}
}
using SuValue.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity
{
/// <summary>
/// 所有业务层非返回集合或者对象的方法必须返回此类
/// </summary>
public class EntityResult
{
public EntityResult(ResultType state) : this(state, String.Empty, null)
{ }
public EntityResult(ResultType state, string message, object data = null)
{
this.state = state;
this.message = message;
this.data = data;
}
/// <summary>
/// 结果类型。
/// </summary>
public ResultType state { get; set; }
/// <summary>
/// 消息内容。
/// </summary>
public string message { get; set; }
/// <summary>
/// 返回数据。
/// </summary>
public object data { get; set; }
}
/// <summary>
/// 结果类型枚举。
/// </summary>
public enum ResultType
{
/// <summary>
/// 异常。
/// </summary>
Error = 0,
/// <summary>
/// 成功。
/// </summary>
Success = 1,
/// <summary>
/// Token异常。
/// </summary>
TokenError = 2,
/// <summary>
/// 服务异常。
/// </summary>
ServiceError = 3,
/// <summary>
/// 操作失败
/// </summary>
Fail = 4
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity.Enum
{
public enum ChartType
{
线图 = 12,
柱状图和增长率 = 100,
地图 = 99,
柱状普通图 = 100,
柱状百分比 = 105,
普通散点图 = 106,
柱状动态求和图 = 113,
饼图 = 104
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity.Enum
{
public enum LoginInfoType
{
AccountNumber = 1,
Mobile = 2,
QQ = 3,
WeChat = 4,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity.Enum
{
public enum MessageType
{
Login = 1,
Modify = 2
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SuValue.Entity.Enum
{
public enum SMSType
{
Voice = 2,
Message = 1
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment