Compare commits

...

5 Commits

  1. BIN
      .vs/QualityControlPlatform/DesignTimeBuild/.dtbcache.v2
  2. 16
      .vs/QualityControlPlatform/project-colors.json
  3. BIN
      .vs/QualityControlPlatform/v17/.futdcache.v1
  4. BIN
      .vs/QualityControlPlatform/v17/.suo
  5. 12
      QualityControlPlatform/.config/dotnet-tools.json
  6. 33
      QualityControlPlatform/Controllers/Base/ErrorController.cs
  7. 91
      QualityControlPlatform/Controllers/Diseases/AnswerController.cs
  8. 101
      QualityControlPlatform/Controllers/Diseases/DiseasesController.cs
  9. 107
      QualityControlPlatform/Controllers/Diseases/QuestionController.cs
  10. 44
      QualityControlPlatform/Controllers/Menus/MenuController.cs
  11. 318
      QualityControlPlatform/Controllers/News/NewController.cs
  12. 142
      QualityControlPlatform/Controllers/User/HospitalController.cs
  13. 142
      QualityControlPlatform/Controllers/User/RoleController.cs
  14. 128
      QualityControlPlatform/Controllers/User/UserController.cs
  15. 49
      QualityControlPlatform/Controllers/WeatherForecastController.cs
  16. 13
      QualityControlPlatform/Helpers/Auth/JwtHelper.cs
  17. 45
      QualityControlPlatform/Helpers/Cache/CacheHelper.cs
  18. 55
      QualityControlPlatform/Helpers/File/FileHelper.cs
  19. 45
      QualityControlPlatform/Helpers/Menu/MenuHelper.cs
  20. 17
      QualityControlPlatform/Helpers/Nlog/LogHelper.cs
  21. 66
      QualityControlPlatform/Helpers/Pagination/PageHelper.cs
  22. 98
      QualityControlPlatform/Helpers/Response/ResponseHelper.cs
  23. 75
      QualityControlPlatform/Helpers/Sms/SmsHelper.cs
  24. 25
      QualityControlPlatform/Helpers/StringText/CodeHelper.cs
  25. 33
      QualityControlPlatform/Helpers/StringText/PinYinHelper.cs
  26. 19
      QualityControlPlatform/Middleware/JwtMiddleware.cs
  27. 29
      QualityControlPlatform/Models/ControllerModels/DiseaseModel.cs
  28. 36
      QualityControlPlatform/Models/ControllerModels/MenuModel.cs
  29. 59
      QualityControlPlatform/Models/ControllerModels/NewsModel.cs
  30. 25
      QualityControlPlatform/Models/ControllerModels/PartModel.cs
  31. 35
      QualityControlPlatform/Models/ControllerModels/ReportModel.cs
  32. 30
      QualityControlPlatform/Models/ControllerModels/ReportTemplateModel.cs
  33. 26
      QualityControlPlatform/Models/ControllerModels/RoleModel.cs
  34. 39
      QualityControlPlatform/Models/ControllerModels/UserModel.cs
  35. 20
      QualityControlPlatform/Models/DbContext/Attached.cs
  36. 25
      QualityControlPlatform/Models/DbContext/Disease.cs
  37. 23
      QualityControlPlatform/Models/DbContext/Hospital.cs
  38. 23
      QualityControlPlatform/Models/DbContext/Menu.cs
  39. 34
      QualityControlPlatform/Models/DbContext/News.cs
  40. 22
      QualityControlPlatform/Models/DbContext/Part.cs
  41. 319
      QualityControlPlatform/Models/DbContext/QualityControlPlatformContext.cs
  42. 21
      QualityControlPlatform/Models/DbContext/Report.cs
  43. 24
      QualityControlPlatform/Models/DbContext/ReportTemplate.cs
  44. 24
      QualityControlPlatform/Models/DbContext/Role.cs
  45. 17
      QualityControlPlatform/Models/DbContext/RoleMenu.cs
  46. 33
      QualityControlPlatform/Models/DbContext/User.cs
  47. 17
      QualityControlPlatform/Models/DbContext/UserRole.cs
  48. 19
      QualityControlPlatform/Models/LogicModel/PermissionModel.cs
  49. 43
      QualityControlPlatform/Models/SmsModel/SmsModel.cs
  50. 15
      QualityControlPlatform/Models/WeatherForecast.cs
  51. 30
      QualityControlPlatform/Nlog.config
  52. 4
      QualityControlPlatform/Program.cs
  53. 20
      QualityControlPlatform/Properties/PublishProfiles/FolderProfile.pubxml
  54. 10
      QualityControlPlatform/Properties/PublishProfiles/FolderProfile.pubxml.user
  55. 4
      QualityControlPlatform/Properties/launchSettings.json
  56. 13
      QualityControlPlatform/QualityControlPlatform.csproj
  57. 6
      QualityControlPlatform/QualityControlPlatform.csproj.user
  58. 4
      QualityControlPlatform/Startup.cs
  59. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/BouncyCastle.Crypto.dll
  60. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Google.Protobuf.dll
  61. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Humanizer.dll
  62. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/K4os.Compression.LZ4.Streams.dll
  63. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/K4os.Compression.LZ4.dll
  64. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/K4os.Hash.xxHash.dll
  65. 8
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Error/2022-03-29/error.txt
  66. 8
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Error/2022-03-30/error.txt
  67. 90
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Error/2022-03-31/error.txt
  68. 8
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Error/2022-04-01/error.txt
  69. 6
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Info/2022-03-28/info.txt
  70. 13
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Info/2022-03-29/info.txt
  71. 30
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Info/2022-03-30/info.txt
  72. 103
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Info/2022-03-31/info.txt
  73. 10
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Logs/Info/2022-04-01/info.txt
  74. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Razor.Language.dll
  75. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll
  76. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll
  77. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.Razor.dll
  78. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll
  79. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.CodeAnalysis.dll
  80. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Abstractions.dll
  81. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Design.dll
  82. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Relational.dll
  83. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.dll
  84. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Abstractions.dll
  85. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Memory.dll
  86. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Abstractions.dll
  87. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll
  88. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.dll
  89. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Abstractions.dll
  90. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.dll
  91. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.dll
  92. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Primitives.dll
  93. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Contracts.dll
  94. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll
  95. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll
  96. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll
  97. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll
  98. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGeneration.dll
  99. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll
  100. BIN
      QualityControlPlatform/bin/Debug/netcoreapp3.1/MySql.Data.EntityFrameworkCore.dll
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,16 @@
{
"Version": 1,
"ProjectMap": {
"7552727e-94c0-42e9-a793-6ceab50260cc": {
"ProjectGuid": "7552727e-94c0-42e9-a793-6ceab50260cc",
"DisplayName": "QualityControlPlatform",
"ColorIndex": 0
},
"a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": {
"ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3",
"DisplayName": "杂项文件",
"ColorIndex": -1
}
},
"NextColorIndex": 1
}

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "6.0.3",
"commands": [
"dotnet-ef"
]
}
}
}

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using System;
using QualityControlPlatform.Helpers.Nlog;
using QualityControlPlatform.Helpers.Response;
namespace QualityControlPlatform.Controllers.Base
{
/// <summary>
/// 全局异常返回
/// </summary>
[Route("error")]
[ApiController]
public class ErrorController : ControllerBase
{
/// <summary>
/// 全局错误返回
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
//UseExceptionHandler中间件中拦截到异常时,会将异常信息保存在请求上下文中,所以我们可以从HttpContext中拿到ExceptionHandler的异常信息:
var feature = HttpContext.Features.Get<IExceptionHandlerPathFeature>();
if (feature == null) return ResponseHelper.ServerError();
var exception = feature.Error;
LogHelper.Log.Error(exception);
Console.WriteLine("【ERROR】" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + exception.Message);
// todo:调用日志组件记录异常信息,或对异常做多路判断
return ResponseHelper.ServerError();
}
}
}

@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Auth;
using QualityControlPlatform.Helpers.Nlog;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
namespace QualityControlPlatform.Controllers.Diseases
{
/// <summary>
/// 内容上报
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class AnswerController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 上报内容填报
/// </summary>
/// <param name="reports">ReportId,UserId,ReportTime不需要填</param>
/// <returns></returns>
[HttpPost]
public ActionResult Add([FromBody]List<ReportModel> reports)
{
try
{
var time = DateTime.Now;
foreach (var report in reports)
{
_db.Reports.Add(new Report()
{
DiseasesId = report.DiseasesId,
ReportTemplateId = report.ReportTemplateId,
UserId = this.CurUserId(),
ReportContent = report.ReportContent,
ReportTime = time,
});
}
_db.SaveChanges();
}
catch (Exception e)
{
LogHelper.Log.Error($"问题上报出错:{e}");
ResponseHelper.ServerError();
}
return ResponseHelper.Success();
}
/// <summary>
/// 该病种下所有的填报信息
/// </summary>
/// <param name="diseasesId">病种Id</param>
/// <param name="userId">用户Id</param>
/// <param name="page">页码</param>
/// <param name="number">数量</param>
/// <returns></returns>
[HttpGet]
public ActionResult List(int diseasesId, int userId, int? page, int number)
{
var report = _db.Reports.Where(p => p.DiseasesId == diseasesId && p.UserId == userId).Select(s=> new
{
s.DiseasesId,
s.UserId,
s.ReportContent,
s.ReportTime,
s.ReportTemplate
}).ToList();
return ResponseHelper.Success(
PageHelper.Pagination(report.GroupBy(q => q.ReportTime).Select(t => new
{
ReportTime = t.Key,
Reports = report.Where(p => p.ReportTime == t.Key).Select(r => new
{
r.DiseasesId,
r.UserId,
r.ReportContent,
r.ReportTime,
r.ReportTemplate
})
}).ToList(), Convert.ToInt32(page), number));
}
}
}

@ -0,0 +1,101 @@
using System;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
using System.Linq;
using QualityControlPlatform.Helpers.StringText;
namespace QualityControlPlatform.Controllers.Diseases
{
/// <summary>
///
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class DiseasesController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 获取病种列表
/// </summary>
/// <param name="page">页码</param>
/// <param name="number">每页数量</param>
/// <param name="isUsing">是否启用,默认启用列表</param>
/// <returns></returns>
[HttpGet]
public ActionResult List(int? page, int number, bool isUsing=true)
{
var diseases = _db.Diseases.Select(q => new DiseaseModel()
{
DiseasesId = q.DiseasesId,
Description = q.Description,
DiseasesCode = q.DiseasesCode,
DiseasesName = q.DiseasesName,
IsUsing = q.IsUsing,
}).ToList();
if (isUsing)
diseases = _db.Diseases.Where(p=>p.IsUsing==isUsing).Select(q => new DiseaseModel()
{
DiseasesId = q.DiseasesId,
Description = q.Description,
DiseasesCode = q.DiseasesCode,
DiseasesName = q.DiseasesName,
IsUsing = q.IsUsing,
}).ToList();
return ResponseHelper.Success(
PageHelper.Pagination(diseases, Convert.ToInt32(page), number));
}
/// <summary>
/// 添加病种 DiseaseId, DiseasesCode 不需要填
/// </summary>
/// <param name="diseaseModel"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Add([FromBody]DiseaseModel diseaseModel)
{
_db.Diseases.Add(new Disease()
{
DiseasesName = diseaseModel.DiseasesName, Description = diseaseModel.Description, DiseasesCode =new CodeHelper().GetCode(diseaseModel.DiseasesName,10),IsUsing = diseaseModel.IsUsing,
});
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 编辑病种信息 DiseaseId,DiseasesName,Description(没有更改就把原来的传过来) 必填, DiseasesCode不需要填
/// </summary>
/// <param name="diseaseModel"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Edit([FromBody]DiseaseModel diseaseModel)
{
var disease = _db.Diseases.Find(diseaseModel.DiseasesId);
disease.Description = diseaseModel.Description;
disease.DiseasesName = diseaseModel.DiseasesName;
disease.DiseasesCode = new CodeHelper().GetCode(diseaseModel.DiseasesName, 10);
disease.IsUsing = diseaseModel.IsUsing;
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 修改病种状态(是否停用)
/// </summary>
/// <param name="diseaseId">病种Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult Change(int diseaseId)
{
var disease = _db.Diseases.Find(diseaseId);
disease.IsUsing = !disease.IsUsing;
_db.SaveChanges();
return ResponseHelper.Success();
}
}
}

@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
namespace QualityControlPlatform.Controllers.Diseases
{
/// <summary>
/// 预设病种的问题
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class QuestionController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 添加预设问题
/// </summary>
/// <param name="reportTemplates">ReportTemplateId 不填</param>
/// <returns></returns>
[HttpPost]
public ActionResult Add([FromBody]List<ReportTemplateModel> reportTemplates)
{
try
{
foreach (var reportTemplate in reportTemplates)
{
_db.ReportTemplates.Add(new ReportTemplate()
{
DiseasesId = reportTemplate.DiseasesId,
Question = reportTemplate.Question,
IfMust = reportTemplate.IfMust,
Type = reportTemplate.Type,
});
}
_db.SaveChanges();
}
catch
{
return ResponseHelper.ServerError();
}
return ResponseHelper.Success();
}
/// <summary>
/// 删除预设问题
/// </summary>
/// <param name="reportTemplateId">预设问题Id(必须是没有上报过的问题才可以删除)</param>
/// <returns></returns>
[HttpGet]
public ActionResult Delete(int reportTemplateId)
{
if (_db.Reports.Count(p => p.ReportTemplateId == reportTemplateId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DeletionIsProhibited);
var report = _db.ReportTemplates.Find(reportTemplateId);
_db.ReportTemplates.Remove(report);
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 相关病种的问题
/// </summary>
/// <param name="diseasesId">病种Id</param>
/// <param name="page">页码</param>
/// <param name="number">每页数量</param>
/// <returns></returns>
[HttpGet]
public ActionResult List(int diseasesId, int? page,int number)
{
return ResponseHelper.Success(
PageHelper.Pagination(_db.ReportTemplates.Where(p=>p.DiseasesId==diseasesId).Select(q => new
{
q.DiseasesId,
q.ReportTemplateId,
q.Question,
q.IfMust,
q.Type,
q.Diseases.DiseasesName
}).ToList(), Convert.ToInt32(page), number));
}
/// <summary>
/// 修改问题内容
/// </summary>
/// <param name="reportTemplate">需要传ReportTemplateId,IfMust,Question,Type(没做修改的把原来的值传过来) 如果已经有上报内容的预设问题将不允许修改</param>
/// <returns></returns>
[HttpPost]
public ActionResult Edit([FromBody]ReportTemplateModel reportTemplate)
{
if (_db.Reports.Count(p => p.ReportTemplateId == reportTemplate.ReportTemplateId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.EditIsProhibited);
var reportTemplateEntity = _db.ReportTemplates.Find(reportTemplate.ReportTemplateId);
reportTemplateEntity.IfMust = reportTemplate.IfMust;
reportTemplateEntity.Question = reportTemplate.Question;
reportTemplateEntity.Type = reportTemplate.Type;
_db.SaveChanges();
return ResponseHelper.Success();
}
}
}

@ -0,0 +1,44 @@
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Menu;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.DbContext;
namespace QualityControlPlatform.Controllers.Menus
{
/// <summary>
/// 菜单相关操作
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class MenuController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 获取菜单列表
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult List()
{
return ResponseHelper.Success(MenuHelper.Serialization(_db.Menus.ToList()));
}
/// <summary>
/// 更新菜单名称
/// </summary>
/// <param name="menuId"></param>
/// <param name="menuName"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Update(int menuId, string menuName)
{
var menu = _db.Menus.Find(menuId);
menu.MenuName = menuName;
_db.SaveChanges();
return ResponseHelper.Success();
}
}
}

@ -0,0 +1,318 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Auth;
using QualityControlPlatform.Helpers.File;
using QualityControlPlatform.Helpers.Nlog;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Helpers.StringText;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
namespace QualityControlPlatform.Controllers.News
{
/// <summary>
/// 新闻相关接口
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class NewController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 获取栏目列表
/// </summary>
/// <param name="page">当前页码,为空则表示0</param>
/// <param name="number">每页数量</param>
/// <returns></returns>
[HttpGet]
public ActionResult PartList(int? page,int number)
{
return ResponseHelper.Success(
PageHelper.Pagination(_db.Parts.Select(q=>new PartModel()
{
PartId = q.PartId,
PartCode = q.PartCode,
Description = q.Description,
PartName = q.PartName,
}).ToList(), Convert.ToInt32(page), number));
}
/// <summary>
/// 添加栏目
/// </summary>
/// <param name="partModel"></param>
/// <returns></returns>
[HttpPost]
public ActionResult AddPart([FromBody]PartModel partModel)
{
if (_db.Parts.Count(p => p.PartName == partModel.PartName) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DataRepeat);
var part = new Part()
{
PartName = partModel.PartName,
PartCode = new CodeHelper().GetCode(partModel.PartName,10),
Description = partModel.Description,
};
_db.Parts.Add(part);
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 删除栏目
/// </summary>
/// <param name="partId">需删除栏目Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult DeletePart(int partId)
{
if (_db.News.Count(p => p.PartId == partId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DeletionIsProhibited);
var part = _db.Parts.Find(partId);
_db.Parts.Remove(part);
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 编辑栏目
/// </summary>
/// <param name="partId"></param>
/// <param name="description"></param>
/// <param name="partName"></param>
/// <returns></returns>
[HttpGet]
public ActionResult EditPart(int partId, string description, string partName)
{
var part = _db.Parts.Find(partId);
part.Description = description;
part.PartName = partName;
part.PartCode = new CodeHelper().GetCode(part.PartName, 10);
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 新闻列表
/// </summary>
/// <param name="partId"></param>
/// <param name="page">当前页码,为空则表示0</param>
/// <param name="number">每页数量</param>
/// <param name="ifRelease">是否发布,不传为true(默认已发布)</param>
/// <returns></returns>
[HttpGet]
public ActionResult NewList(int partId,int? page,int number, bool ifRelease=true)
{
var news = _db.News.Where(p => p.PartId == partId).Select(q => new NewsModel()
{
PartId = partId,
NewId = q.NewId,
Content = q.Content,
Title = q.Title,
AttachedId = q.Attacheds.Select(p => p.AttachedId).ToList(),
UserName = q.User.UserName,
IfRelease = q.IfRelease
}).ToList();
if (ifRelease)
news = _db.News.Where(p => p.PartId == partId && p.IfRelease == ifRelease).Select(q => new NewsModel()
{
PartId = partId,
NewId = q.NewId,
Content = q.Content,
Title = q.Title,
AttachedId = q.Attacheds.Select(p => p.AttachedId).ToList(),
UserName = q.User.UserName,
IfRelease = q.IfRelease
}).ToList();
return ResponseHelper.Success(PageHelper.Pagination(news,
Convert.ToInt32(page),number ));
}
/// <summary>
/// 新闻详情
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult NewInfo(int newId)
{
var newSingle = _db.News.Find(newId);
newSingle.User = null;
return ResponseHelper.Success(new
{
newSingle.NewId,
newSingle.User,
newSingle.Title,
newSingle.Content,
newSingle.IfRelease,
newSingle.Time,
AttachedList = _db.Attacheds.Where(p=>p.NewId==newId).Select(q=>new
{
q.FileName,
q.FileSize,
q.AttachedTime,
q.AttachedId
})
});
}
/// <summary>
/// 添加新闻
/// </summary>
/// <param name="newsModel">数据集PartId,Title,Content必传</param>
/// <returns></returns>
[HttpPost]
public ActionResult AddNew([FromBody] NewsModel newsModel)
{
var newEntity = new Models.DbContext.News()
{
PartId = newsModel.PartId,
UserId = this.CurUserId(),
Title= newsModel.Title,
IfRelease = newsModel.IfRelease,
Content = newsModel.Content,
Time=DateTime.Now,
};
_db.News.Add(newEntity);
_db.SaveChanges();
newsModel.NewId = newEntity.NewId;
newsModel.Homology();
return ResponseHelper.Success();
}
/// <summary>
/// 编辑新闻
/// </summary>
/// <param name="newsModel">数据集(NewId,Title,Content 必填)</param>
/// <returns></returns>
[HttpPost]
public ActionResult EditNew([FromBody] NewsModel newsModel)
{
var newEntity = _db.News.Find(newsModel.NewId);
newEntity.Title = newsModel.Title;
newEntity.Content = newsModel.Content;
newEntity.UserId = this.CurUserId();
newEntity.IfRelease = newsModel.IfRelease;
_db.SaveChanges();
newsModel.NewId = newEntity.NewId;
newsModel.Homology();
return ResponseHelper.Success();
}
/// <summary>
/// 删除新闻信息(只能删除未发布的)
/// </summary>
/// <param name="newId"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Delete(int newId)
{
var newEntity = _db.News.Find(newId);
if (newEntity.IfRelease == true)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DeletionIsProhibited);
_db.News.Remove(newEntity);
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 修改当前新闻发布状态
/// </summary>
/// <param name="newId">新闻Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult Change(int newId)
{
var news= _db.News.Find(newId);
news.IfRelease = !news.IfRelease;
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 添加附件
/// </summary>
/// <returns></returns>
[HttpPost]
public ActionResult AddAttached()
{
try
{
var attachedList = new List<int>();
foreach (var file in Request.Form.Files)
{
FileHelper.CreateFile(Path.Combine(Directory.GetCurrentDirectory(), "UploadFile"));
using var stream =
new FileStream(Path.Combine(Directory.GetCurrentDirectory(), "UploadFile", file.FileName),
FileMode.Create);
file.CopyTo(stream);
var fileEntity = new Attached()
{
FileName = file.FileName,
UserId = this.CurUserId(),
AttachedTime = DateTime.Now,
FileSize = FileHelper.FileSize(file.Length),
};
_db.Attacheds.Add(fileEntity);
_db.SaveChanges();
attachedList.Add(fileEntity.AttachedId);
}
return ResponseHelper.Success(attachedList);
}
catch (Exception e)
{
LogHelper.Log.Error(e.ToString());
return ResponseHelper.ServerError();
}
}
/// <summary>
/// 获取附件列表
/// </summary>
/// <param name="newId">新闻Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult AttachedList(int newId)
{
return ResponseHelper.Success(_db.Attacheds.Where(p=>p.NewId==newId).Select(p=>new
{
p.User.UserName,
p.AttachedId,
p.AttachedTime,
p.FileName,
p.FileSize,
}));
}
/// <summary>
/// 下载附件
/// </summary>
/// <param name="attachedId">附件id</param>
/// <returns></returns>
[HttpGet]
public ActionResult DownloadAttached(int attachedId)
{
var attached = _db.Attacheds.Find(attachedId);
var path = Path.Combine(Directory.GetCurrentDirectory(), "UploadFile", attached.FileName);
//Read the File data into Byte Array.
var bytes = System.IO.File.ReadAllBytes(path);
//Send the File to Download.
return File(bytes, "application/octet-stream", attached.FileName);
}
/// <summary>
/// 删除附件
/// </summary>
/// <param name="attachedId">附件Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult DeleteAttached(int attachedId)
{
var attached = _db.Attacheds.Find(attachedId);
if (System.IO.File.Exists(Path.Combine(Directory.GetCurrentDirectory(), "UploadFile",attached.FileName)))
System.IO.File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "UploadFile", attached.FileName));
_db.Attacheds.Remove(attached);
_db.SaveChanges();
return ResponseHelper.Success();
}
}
}

@ -0,0 +1,142 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.DbContext;
using System.Linq;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.StringText;
namespace QualityControlPlatform.Controllers.User
{
/// <summary>
/// 医院基础信息
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class HospitalController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 医院列表
/// </summary>
/// <param name="page">页码</param>
/// <param name="number">数量</param>
/// <returns></returns>
[HttpGet]
public ActionResult List(int page, int number)
{
return ResponseHelper.Success(PageHelper.Pagination(_db.Hospitals.Select(p=> new
{
p.HospitalId,
p.HospitalName,
p.Address,
p.Phone,
p.HospitalCode
}).ToList(), page, number));
}
/// <summary>
/// 该医院下的用户
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="page"></param>
/// <param name="number"></param>
/// <returns></returns>
[HttpGet]
public ActionResult UserList(int hospitalId,int page, int number)
{
return ResponseHelper.Success(PageHelper.Pagination(_db.Users.Where(p=>p.HospitalId==hospitalId).Select(p=>new
{
p.UserName,
p.Phone,
p.UserCode,
p.UserId,
p.Department,
p.DepartCode
}).ToList(), page, number));
}
/// <summary>
/// 该医院下上报过该病种的用户
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="diseasesId"></param>
/// <param name="page"></param>
/// <param name="number"></param>
/// <returns></returns>
[HttpGet]
public ActionResult AnswerUsers(int hospitalId, int diseasesId, int page, int number)
{
return ResponseHelper.Success(PageHelper.Pagination(_db.Reports.Where(p => p.DiseasesId == diseasesId && p.User.HospitalId == hospitalId).Select(s => s.User).Select(p => new
{
p.UserName,
p.Phone,
p.UserCode,
p.UserId,
p.Department,
p.DepartCode
}).Distinct().ToList(),page,number));
}
/// <summary>
/// 添加医院信息
/// </summary>
/// <param name="hospitalName"></param>
/// <param name="address"></param>
/// <param name="phone"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Add(string hospitalName, string address, string phone)
{
if (_db.Hospitals.Count(p => p.HospitalName == hospitalName) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DataRepeat);
_db.Hospitals.Add(new Hospital()
{
HospitalName = hospitalName,
Address=address,
Phone =phone,
HospitalCode =new CodeHelper().GetCode(hospitalName,hospitalName.Length+1)
});
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 修改医院信息
/// </summary>
/// <param name="hospitalId"></param>
/// <param name="hospitalName"></param>
/// <param name="address"></param>
/// <param name="phone"></param>
/// <param name="hospitalCode"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Edit(int hospitalId, string hospitalName, string address, string phone, string hospitalCode)
{
var hospital = _db.Hospitals.Find(hospitalId);
hospital.Address = address;
hospital.Phone = phone;
hospital.HospitalCode = hospitalCode;
hospital.HospitalName= hospitalName;
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 删除医院信息
/// </summary>
/// <param name="hospitalId"></param>
/// <returns></returns>
[HttpGet]
public ActionResult Delete(int hospitalId)
{
if (_db.Users.Count(p => p.HospitalId == hospitalId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DeletionIsProhibited);
_db.Hospitals.Remove(_db.Hospitals.Find(hospitalId));
_db.SaveChanges();
return ResponseHelper.Success();
}
}
}

@ -0,0 +1,142 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using QualityControlPlatform.Helpers.StringText;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
using System.Linq;
using QualityControlPlatform.Helpers.Menu;
using QualityControlPlatform.Helpers.Pagination;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Models.LogicModel;
namespace QualityControlPlatform.Controllers.User
{
/// <summary>
/// 角色控制
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class RoleController : ControllerBase
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 添加角色
/// </summary>
/// <param name="roleModel"></param>
/// <returns></returns>
[HttpPost]
public ActionResult Add([FromBody]RoleModel roleModel)
{
if (_db.Roles.Count(p => p.RoleName == roleModel.RoleName) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DataRepeat);
_db.Roles.Add(new Role()
{
RoleCode = new CodeHelper().GetCode(roleModel.RoleName, 8),
RoleName = roleModel.RoleName,
Description = roleModel.Description,
});
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 删除角色
/// </summary>
/// <param name="roleId">角色Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult Delete(int roleId)
{
if (_db.UserRoles.Count(p => p.RoleId == roleId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DeletionIsProhibited);
_db.Roles.Remove(_db.Roles.Find(roleId));
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 编辑角色
/// </summary>
/// <param name="roleModel">RoleId,Description,RoleName,RoleCode必传 没有修改传原来的值</param>
/// <returns></returns>
[HttpPost]
public ActionResult Edit([FromBody]RoleModel roleModel)
{
var role = _db.Roles.Find(roleModel.RoleId);
role.Description = roleModel.Description;
role.RoleName = roleModel.RoleName;
role.RoleCode = roleModel.RoleCode;
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 角色列表
/// </summary>
/// <param name="page">页码</param>
/// <param name="number">数量</param>
/// <returns></returns>
[HttpGet]
public ActionResult List(int page, int number)
{
return ResponseHelper.Success(PageHelper.Pagination(_db.Roles.Select(p=>new
{
p.Description,
p.RoleCode,
p.RoleName,
p.RoleId
}).ToList(),page,number));
}
/// <summary>
/// 给用户分配角色
/// </summary>
/// <param name="roleId">角色Id</param>
/// <param name="userId">用户Id</param>
/// <returns></returns>
[HttpGet]
public ActionResult Distribute(int roleId, int userId)
{
if (_db.UserRoles.Count(p => p.RoleId == roleId && p.UserId == userId) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.DataRepeat);
_db.UserRoles.Add(new UserRole()
{
UserId = userId,
RoleId = roleId,
});
_db.SaveChanges();
return ResponseHelper.Success();
}
/// <summary>
/// 添加权限, 编辑权限,删除权限
/// </summary>
/// <param name="permissionModel">角色Id,跟权限Id数组</param>
/// <returns></returns>
[HttpPost]
public ActionResult Permission([FromBody] PermissionModel permissionModel)
{
var roleMenus = _db.Rolemenus.Where(p => p.RoleId == permissionModel.RoleId).ToList();
_db.Rolemenus.RemoveRange(roleMenus);
_db.SaveChanges();
foreach (var menId in permissionModel.MenuIdList)
{
_db.Rolemenus.Add(new Rolemenu() { RoleId = permissionModel.RoleId, MenuId = menId });
_db.SaveChanges();
}
return ResponseHelper.Success();
}
/// <summary>
/// 获取角色所有权限
/// </summary>
/// <param name="roleId"></param>
/// <returns></returns>
[HttpGet]
public ActionResult PermissionList(int roleId)
{
var roleMenus = _db.Rolemenus.Where(p => p.RoleId == roleId).Select(q=>q.Menu).ToList();
return ResponseHelper.Success(MenuHelper.Serialization(roleMenus));
}
}
}

@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Net.Http;
using System.Security.Claims;
using System.Text;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;
using QualityControlPlatform.Helpers.Cache;
using QualityControlPlatform.Helpers.Menu;
using QualityControlPlatform.Helpers.Response;
using QualityControlPlatform.Helpers.StringText;
using QualityControlPlatform.Models.ControllerModels;
using QualityControlPlatform.Models.DbContext;
using QualityControlPlatform.Models.SmsModel;
namespace QualityControlPlatform.Controllers.User
{
/// <summary>
/// 用户相关操作控制类
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class UserController : ControllerBase
{
private readonly IHttpClientFactory _clientFactory;
private readonly IMemoryCache _memoryCache;
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 用户相关
/// </summary>
/// <param name="clientFactory"></param>
/// <param name="memoryCache"></param>
public UserController(IHttpClientFactory clientFactory, IMemoryCache memoryCache)
{
_clientFactory = clientFactory;
_memoryCache = memoryCache;
}
private IConfiguration Configuration { get; set; }
/// <summary>
/// 用户登录
/// </summary>
/// <param name="userCode">用户代码</param>
/// <param name="passWord">密码</param>
/// <returns></returns>
[HttpGet]
public ActionResult Login(string userCode, string passWord)
{
var userInfo = _db.Users.FirstOrDefault(p => (p.UserCode == userCode||p.Phone==userCode) && p.Password == passWord);
if (userInfo == null)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.UserAndPwError);
var userRoles = userInfo.Userroles.Select(x => x.Role).Select(r=>r.Rolemenus).ToList();
var menuList = new List<Menu>();
userRoles.ForEach(x => x.ToList().ForEach(q=>menuList.Add(q.Menu)));
return ResponseHelper.Success(MenuHelper.Serialization(menuList),GetToken(userInfo.UserId.ToString(),userInfo.UserName));
}
/// <summary>
/// 发送验证码
/// </summary>
/// <param name="phone"></param>
/// <returns></returns>
[HttpGet]
public ActionResult SendSms(string phone)
{
var code = new CodeHelper().GetCode("", 5);
var smsModel = new SmsModel(_clientFactory,phone,code);
if(smsModel.Code!=200)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.SmsSendFailed);
new CacheHelper(_memoryCache).Set(phone, code);
return ResponseHelper.Success();
}
/// <summary>
/// 用户注册
/// </summary>
/// <param name="userModel">只需要传UserName, Phone, Password</param>
/// <returns></returns>
[HttpPost]
public ActionResult Register([FromBody]UserModel userModel)
{
if(new CacheHelper(_memoryCache).Get(userModel.Phone)!=userModel.Code)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.SmsIsError);
if (_db.Users.Count(p => p.Phone == userModel.Phone) > 0)
return ResponseHelper.Fail(ResponseHelper.ErrorEnum.PhoneIsUsed);
_db.Users.Add(new Models.DbContext.User()
{
UserCode =new CodeHelper().GetCode(userModel.UserName,8),
UserName = userModel.UserName,
Phone = userModel.Phone,
Password = userModel.Password,
HospitalId = userModel.HospitalId,
});
_db.SaveChanges();
return ResponseHelper.Success();
}
private string GetToken(string userId, string userName)
{
// token中的claims用于储存自定义信息,如登录之后的用户id等
var claims = new[]
{
new Claim("userId", userId.Trim()),
new Claim("userName",userName.Trim()),
};
// 获取SecurityKey
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetSection("Authentication")["SecurityKey"]));
var token = new JwtSecurityToken(
issuer: Configuration.GetSection("Authentication")["IsSure"], // 发布者
audience: Configuration.GetSection("Authentication")["Audience"], // 接收者
notBefore: DateTime.Now, // token签发时间
expires: DateTime.Now.AddMinutes(30), // token过期时间
claims: claims, // 该token内存储的自定义字段信息
signingCredentials: new SigningCredentials(key, SecurityAlgorithms.HmacSha256) // 用于签发token的秘钥算法
);
// 返回成功信息,写出token
return new JwtSecurityTokenHandler().WriteToken(token);
}
}
}

@ -1,49 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using QualityControlPlatform.Models;
namespace QualityControlPlatform.Controllers
{
/// <summary>
/// 测试
/// </summary>
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
/// <summary>
/// 测试
/// </summary>
/// <param name="logger"></param>
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
/// <summary>
/// 初始框架测试接口
/// </summary>
/// <returns></returns>
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

@ -1,4 +1,5 @@
using System.Linq; using System;
using System.Linq;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@ -10,12 +11,12 @@ namespace QualityControlPlatform.Helpers.Auth
/// <summary> /// <summary>
/// 获取当前登录用户的用户编号 /// 获取当前登录用户的用户编号
/// </summary> /// </summary>
public static string CurUserCode(this ControllerBase controller) public static int CurUserId(this ControllerBase controller)
{ {
var auth = controller.HttpContext.AuthenticateAsync().Result.Principal.Claims; //var auth = controller.HttpContext.AuthenticateAsync().Result.Principal.Claims;
var userId = auth.FirstOrDefault(t => t.Type.Equals("userCode"))?.Value; //var userId = auth.FirstOrDefault(t => t.Type.Equals("userId"))?.Value;
//return Convert.ToInt32(userId);
return userId ?? ""; return 1;
} }
/// <summary> /// <summary>

@ -0,0 +1,45 @@
using System;
using Microsoft.Extensions.Caching.Memory;
namespace QualityControlPlatform.Helpers.Cache
{
/// <summary>
/// 缓存框架
/// </summary>
public class CacheHelper
{
private readonly IMemoryCache _memoryCache;
/// <summary>
/// 缓存框架
/// </summary>
/// <param name="memoryCache"></param>
public CacheHelper(IMemoryCache memoryCache)
{
_memoryCache = memoryCache;
}
/// <summary>
/// 存缓存
/// </summary>
/// <param name="key">关键词</param>
/// <param name="value">值</param>
public void Set(string key, string value)
{
var cacheOptions = new MemoryCacheEntryOptions()
.SetSlidingExpiration(TimeSpan.FromMinutes(5));
_memoryCache.Set(key, value,cacheOptions);
}
/// <summary>
/// 获取缓存值
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string Get(string key)
{
return _memoryCache.TryGetValue(key, out string value) ? value:"";
}
}
}

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.IO;
using QualityControlPlatform.Helpers.Nlog;
namespace QualityControlPlatform.Helpers.File
{
/// <summary>
/// 文件相关操作
/// </summary>
public class FileHelper
{
/// <summary>
/// 创建文件夹
/// </summary>
/// <param name="file"></param>
public static void CreateFile(string file)
{
if (Directory.Exists(file))
//文件夹已经存在
return;
try
{
Directory.CreateDirectory(file);
//创建成功
}
catch (Exception e)
{
LogHelper.Log.Error($"文件创建出错:{e.ToString()}");
}
}
/// <summary>
/// 获取文件大小
/// </summary>
/// <param name="length">文件长度</param>
/// <returns></returns>
public static string FileSize(long length)
{
var unit = new List<string>() { "K", "M", "G" };
var size = Math.Round(length / 1024.0, 2);
var index = 0;
while (size > 1024&&index<2)
{
index++;
size = Math.Round(size/1024,2);
}
return $"{size}{unit[index]}";
}
}
}

@ -0,0 +1,45 @@
using System.Collections.Generic;
using System.Linq;
using QualityControlPlatform.Models.ControllerModels;
namespace QualityControlPlatform.Helpers.Menu
{
/// <summary>
/// 菜单对象封装
/// </summary>
public class MenuHelper
{
/// <summary>
/// 把菜单对象封装成标准的
/// </summary>
/// <param name="menuList">菜单对象</param>
/// <returns></returns>
public static List<MenuModel> Serialization(List<Models.DbContext.Menu> menuList)
{
var menus = (from menu in menuList
where menu.ParentId == null
select new MenuModel
{
MenuId = menu.MenuId,
MenuName = menu.MenuName,
MenuCode = menu.MenuCode,
Description = menu.Description,
ChildModels = new List<MenuModel>()
}).ToList();
foreach (var menu in menuList)
{
var parentMenu = menus.Find(p => p.MenuId == menu.ParentId);
parentMenu?.ChildModels.Add(new MenuModel
{
MenuId= menu.MenuId,
MenuName= menu.MenuName,
MenuCode = menu.MenuCode,
Description = menu.Description,
ParentId= menu.ParentId,
});
}
return menus;
}
}
}

@ -0,0 +1,17 @@
using NLog;
namespace QualityControlPlatform.Helpers.Nlog
{
/// <summary>
/// 日志静态类
/// </summary>
public class LogHelper
{
/// <summary>
/// 日志调用对象
/// </summary>
public static readonly NLog.Logger Log = LogManager.GetCurrentClassLogger();
}
}

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace QualityControlPlatform.Helpers.Pagination
{
/// <summary>
/// 分页帮助类
/// </summary>
public class PageHelper
{
/*
* 1. list.Skip(x).Take(y);
* 2.(x,y)(0,list.Count)list为空[],()
*/
/// <summary>
/// 分页
/// </summary>
/// <typeparam name="T">数据类型</typeparam>
/// <param name="list">数据</param>
/// <param name="page">页码</param>
/// <param name="size">数据量/页</param>
/// <returns></returns>
public static Data Pagination<T>(List<T> list, int page, int size)
{
if (list == null)
return new Data(0, page, null);
if (list.Count != 0 && list.Count >= size)
return new Data(list.Count, page <= 0 ? 0 : page,
list.Skip(Convert.ToInt32((page <= 0 ? 0 : page - 1) * size)).Take(size).ToList());
return new Data(list.Count, page, list);
}
}
/// <summary>
/// 数据
/// </summary>
public class Data
{
/// <summary>
/// 总数
/// </summary>
public int? Total { get; set; }
/// <summary>
/// 当前页码
/// </summary>
public int? Current { get; set; }
/// <summary>
/// 数据
/// </summary>
public object List { get; set; }
/// <summary>
/// 数据实体
/// </summary>
/// <param name="total"></param>
/// <param name="current"></param>
/// <param name="list"></param>
public Data(int? total, int? current, object list)
{
Total = total ?? 0;
Current = current;
List = list;
}
}
}

@ -18,6 +18,9 @@ namespace QualityControlPlatform.Helpers.Response
/// </summary> /// </summary>
public enum ErrorEnum public enum ErrorEnum
{ {
/// <summary>
/// 登录失败,用户名或密码为空
/// </summary>
[Description("登录失败,用户名或密码为空")] [Description("登录失败,用户名或密码为空")]
UserAndPwIsNull = 60001, UserAndPwIsNull = 60001,
/// <summary> /// <summary>
@ -26,16 +29,72 @@ namespace QualityControlPlatform.Helpers.Response
[Description("Token错误")] [Description("Token错误")]
TokenError = 50001, TokenError = 50001,
/// <summary>
/// 参数错误
/// </summary>
[Description("参数错误")] [Description("参数错误")]
ParamsError = 50002, ParamsError = 50002,
/// <summary>
/// 验证码发送失败
/// </summary>
[Description("验证码发送失败")]
SmsSendFailed = 50003,
/// <summary>
/// 验证码错误
/// </summary>
[Description("验证码错误")]
SmsIsError = 50004,
/// <summary>
/// 登录失败,用户名或密码错误
/// </summary>
[Description("登录失败,用户名或密码错误")] [Description("登录失败,用户名或密码错误")]
UserAndPwError = 50011, UserAndPwError = 50011,
/// <summary>
/// 手机号已被注册
/// </summary>
[Description("手机号已被注册")]
PhoneIsUsed = 50012,
/// <summary> /// <summary>
/// 未找到数据 /// 未找到数据
/// </summary> /// </summary>
[Description("未找到数据")] [Description("未找到数据")]
NotFindData = 30041, NotFindData = 30041,
/// <summary>
/// 禁止删除
/// </summary>
[Description("禁止删除")]
DeletionIsProhibited = 30011,
/// <summary>
/// 禁止修改
/// </summary>
[Description("禁止修改")]
EditIsProhibited = 30012,
/// <summary>
/// 禁止修改
/// </summary>
[Description("编辑人与发布人不同,修改被禁止")]
PeopleIsDifferent = 30013,
/// <summary>
/// 重复添加
/// </summary>
[Description("重复添加")]
DataRepeat = 30014,
} }
/// <summary> /// <summary>
/// 获取枚举对应的Description /// 获取枚举对应的Description
@ -92,6 +151,18 @@ namespace QualityControlPlatform.Helpers.Response
var result = new ResultModel(200, "Success", data); var result = new ResultModel(200, "Success", data);
return new OkObjectResult(result); return new OkObjectResult(result);
} }
/// <summary>
/// 带token的成功返回
/// </summary>
/// <param name="data"></param>
/// <param name="token"></param>
/// <returns></returns>
public static ActionResult Success(object data, string token)//File(ms.ToArray(), "application/pdf");
{
var result = new ResultTokenModel(200, "Success", data, token);
return new OkObjectResult(result);
}
/// <summary> /// <summary>
/// 返回自定义错误 /// 返回自定义错误
/// </summary> /// </summary>
@ -145,4 +216,31 @@ namespace QualityControlPlatform.Helpers.Response
Data = data; Data = data;
} }
} }
/// <summary>
/// 带token的实体
/// </summary>
public class ResultTokenModel:ResultModel
{
/// <summary>
/// 令牌
/// </summary>
public string Token { get; set; }
/// <summary>
/// 有参构造
/// </summary>
/// <param name="code"></param>
/// <param name="message"></param>
/// <param name="data"></param>
/// <param name="token"></param>
public ResultTokenModel(int code, string message, object data, string token)
{
Code = code;
Message = message;
Data = data;
Token = token;
}
}
} }

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Newtonsoft.Json;
using QualityControlPlatform.Models.SmsModel;
namespace QualityControlPlatform.Helpers.Sms
{
/// <summary>
/// 短信发送帮助类
/// </summary>
public class SmsHelper:PageModel
{
private readonly IHttpClientFactory _clientFactory;
/// <summary>
/// 短信返回
/// </summary>
public SmsModel SmsModel { get; private set; }
/// <summary>
/// 获取返回是否正确
/// </summary>
public bool GetBranchesError { get; private set; }
/// <summary>
/// 需发送验证码手机号
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 需发送验证码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 发送短信接口
/// </summary>
/// <param name="clientFactory"></param>
/// <param name="phone">电话</param>
/// <param name="code">验证码</param>
public SmsHelper(IHttpClientFactory clientFactory,string phone, string code)
{
SmsModel = new SmsModel();
_clientFactory = clientFactory;
Phone = phone;
Code = code;
}
/// <summary>
/// 发送
/// </summary>
public async Task OnGet()
{
var request = new HttpRequestMessage(HttpMethod.Post,
$"http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel={Phone}&code={Code}");
var client = _clientFactory.CreateClient();
var response = await client.SendAsync(request);
if (response.IsSuccessStatusCode)
{
var responseStr = await response.Content.ReadAsStringAsync();
SmsModel = JsonConvert.DeserializeObject<SmsModel>(responseStr);
}
else
{
GetBranchesError = true;
SmsModel = null;
}
}
}
}

@ -0,0 +1,25 @@
using System;
namespace QualityControlPlatform.Helpers.StringText
{
/// <summary>
/// 相关码的生成
/// </summary>
public class CodeHelper
{
/// <summary>
///获取文本数字码
/// </summary>
/// <param name="code">需要转换的文本</param>
/// <param name="length">需要码长度</param>
/// <returns></returns>
public string GetCode(string code, int length)
{
code = PinYinHelper.GetFirstPinyin(code);
var random = new Random();
var numberLength = length - code.Length;
code += random.Next(Convert.ToInt32(Math.Pow(10, numberLength)),Convert.ToInt32(Math.Pow(10, numberLength + 1)));
return code;
}
}
}

@ -0,0 +1,33 @@
using Microsoft.International.Converters.PinYinConverter;
namespace QualityControlPlatform.Helpers.StringText
{
/// <summary>
/// 拼音帮助类
/// </summary>
public class PinYinHelper
{
/// <summary>
/// 获取首字母
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string GetFirstPinyin(string str)
{
var r = string.Empty;
foreach (var obj in str)
{
try
{
var chineseChar = new ChineseChar(obj);
var t = chineseChar.Pinyins[0];
r += t[..1];
}
catch
{
r += obj.ToString();
}
}
return r;
}
}
}

@ -8,24 +8,39 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json; using Newtonsoft.Json;
using QualityControlPlatform.Helpers.Nlog;
using QualityControlPlatform.Helpers.Response; using QualityControlPlatform.Helpers.Response;
using static QualityControlPlatform.Helpers.Response.ResponseHelper; using static QualityControlPlatform.Helpers.Response.ResponseHelper;
namespace QualityControlPlatform.Middleware namespace QualityControlPlatform.Middleware
{ {
/// <summary>
/// 中间件
/// </summary>
public class JwtMiddleware public class JwtMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;
private readonly JwtSecurityTokenHandler _jwtSecurityTokenHandler = new JwtSecurityTokenHandler(); private readonly JwtSecurityTokenHandler _jwtSecurityTokenHandler = new JwtSecurityTokenHandler();
private static IConfiguration Configuration { get; set; } private static IConfiguration Configuration { get; set; }
/// <summary>
/// 中间件私有化
/// </summary>
/// <param name="next"></param>
/// <param name="config"></param>
public JwtMiddleware(RequestDelegate next, IConfiguration config) public JwtMiddleware(RequestDelegate next, IConfiguration config)
{ {
_next = next; _next = next;
Configuration = config; Configuration = config;
} }
/// <summary>
/// 请求接口之前需要过这一验证
/// </summary>
/// <param name="context"></param>
/// <exception cref="ArgumentNullException"></exception>
public async Task Invoke(HttpContext context) public async Task Invoke(HttpContext context)
{ {
if (context == null) throw new ArgumentNullException(nameof(context)); if (context == null) throw new ArgumentNullException(nameof(context));
var tokenStr = context.Request.Headers["Authorization"].ToString(); var tokenStr = context.Request.Headers["Authorization"].ToString();
//未携带token请求不需要授权页面,让其直接通过,用方法名上面的校验来判断 //未携带token请求不需要授权页面,让其直接通过,用方法名上面的校验来判断
@ -52,10 +67,8 @@ namespace QualityControlPlatform.Middleware
} }
var claims = new[] var claims = new[]
{ {
new Claim("userCode",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("userCode"))?.Value) , new Claim("userId",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("userId"))?.Value) ,
new Claim("userName",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("userName"))?.Value), new Claim("userName",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("userName"))?.Value),
new Claim("deptCode",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("deptCode"))?.Value) ,
new Claim("deptName",GetJwtSecurityToken(tokenStr)?.Claims.FirstOrDefault(p=>p.Type.Equals("deptName"))?.Value)
}; };
// 获取SecurityKey // 获取SecurityKey
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetSection("Authentication")["SecurityKey"])); var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetSection("Authentication")["SecurityKey"]));

@ -0,0 +1,29 @@
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 病种实体
/// </summary>
public class DiseaseModel
{
/// <summary>
/// 病种Id
/// </summary>
public int DiseasesId { get; set; }
/// <summary>
/// 病种名称
/// </summary>
public string DiseasesName { get; set; }
/// <summary>
/// 病种代码
/// </summary>
public string DiseasesCode { get; set; }
/// <summary>
/// 病种描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 是否使用
/// </summary>
public bool? IsUsing { get; set; }
}
}

@ -0,0 +1,36 @@
using System.Collections.Generic;
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 菜单实体
/// </summary>
public class MenuModel
{
/// <summary>
/// 菜单Id
/// </summary>
public int MenuId { get; set; }
/// <summary>
/// 菜单名称
/// </summary>
public string MenuName { get; set; }
/// <summary>
/// 菜单代码
/// </summary>
public string MenuCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 父级Id
/// </summary>
public int? ParentId { get; set; }
/// <summary>
/// 子Id
/// </summary>
public List<MenuModel> ChildModels { get; set; }
}
}

@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Linq;
using QualityControlPlatform.Models.DbContext;
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 用来接收接口参数的Model
/// </summary>
public class NewsModel
{
private readonly QualityControlPlatformContext _db = new QualityControlPlatformContext();
/// <summary>
/// 栏目Id
/// </summary>
public int? PartId { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 新闻Id
/// </summary>
public int? NewId { get; set; }
/// <summary>
/// 附件Id列表
/// </summary>
public List<int> AttachedId { get; set; }
/// <summary>
/// 是否发布
/// </summary>
public bool? IfRelease { get; set; }
/// <summary>
/// 用户名 不需要传,只作显示使用
/// </summary>
/// <returns></returns>
public string UserName { get; set; }
/// <summary>
/// 将栏目跟新闻对应
/// </summary>
public void Homology()
{
foreach (var attached in AttachedId.Select(attachedId => _db.Attacheds.Find(attachedId)))
{
attached.NewId = NewId;
_db.SaveChanges();
}
}
}
}

@ -0,0 +1,25 @@
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 接口用model
/// </summary>
public class PartModel
{
/// <summary>
/// 栏目Id 添加的时候不需要上传
/// </summary>
public int? PartId { get; set; }
/// <summary>
/// 栏目名 必传
/// </summary>
public string PartName { get; set; }
/// <summary>
/// 栏目代码 不需要上传
/// </summary>
public string PartCode { get; set; }
/// <summary>
/// 栏目描述
/// </summary>
public string Description { get; set; }
}
}

@ -0,0 +1,35 @@
using System;
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 回答实体
/// </summary>
public class ReportModel
{
/// <summary>
/// 回答Id 新增不需要传
/// </summary>
public int ReportId { get; set; }
/// <summary>
/// 病种Id
/// </summary>
public int? DiseasesId { get; set; }
/// <summary>
/// 预设问题Id
/// </summary>
public int? ReportTemplateId { get; set; }
/// <summary>
/// 用户Id(谁填报的)
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 填报内容
/// </summary>
public string ReportContent { get; set; }
/// <summary>
/// 填报时间
/// </summary>
public DateTime? ReportTime { get; set; }
}
}

@ -0,0 +1,30 @@
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 预设问题Id
/// </summary>
public class ReportTemplateModel
{
/// <summary>
/// 预设问题Id 新增不需要填
/// </summary>
public int ReportTemplateId { get; set; }
/// <summary>
/// 病种Id
/// </summary>
public int? DiseasesId { get; set; }
/// <summary>
/// 预设问题
/// </summary>
public string Question { get; set; }
/// <summary>
/// 是否必填
/// </summary>
public bool? IfMust { get; set; }
/// <summary>
/// 类型 int 整数 decimal 小数 date 时间 string 文本
/// </summary>
public string Type { get; set; }
}
}

@ -0,0 +1,26 @@
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 角色实体
/// </summary>
public class RoleModel
{
/// <summary>
/// 角色Id
/// </summary>
public int RoleId { get; set; }
/// <summary>
/// 角色名称
/// </summary>
public string RoleName { get; set; }
/// <summary>
/// 角色代码
/// </summary>
public string RoleCode { get; set; }
/// <summary>
/// 角色描述
/// </summary>
public string Description { get; set; }
}
}

@ -0,0 +1,39 @@
namespace QualityControlPlatform.Models.ControllerModels
{
/// <summary>
/// 用户数据
/// </summary>
public class UserModel
{
/// <summary>
/// 用户id 新增不填
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 所属医院Id
/// </summary>
public int? HospitalId { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户代码
/// </summary>
public string UserCode { get; set; }
/// <summary>
/// 用户密码
/// </summary>
public string Password { get; set; }
/// <summary>
/// 电话号码 搞自主注册用
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 验证码
/// </summary>
public string Code{ get; set; }
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Attached
{
public int AttachedId { get; set; }
public int? UserId { get; set; }
public int? NewId { get; set; }
public string FileName { get; set; }
public DateTime? AttachedTime { get; set; }
public string FileSize { get; set; }
public virtual News New { get; set; }
public virtual User User { get; set; }
}
}

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Disease
{
public Disease()
{
Reports = new HashSet<Report>();
ReportTemplates = new HashSet<ReportTemplate>();
}
public int DiseasesId { get; set; }
public string DiseasesName { get; set; }
public string DiseasesCode { get; set; }
public string Description { get; set; }
public bool? IsUsing { get; set; }
public virtual ICollection<Report> Reports { get; set; }
public virtual ICollection<ReportTemplate> ReportTemplates { get; set; }
}
}

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Hospital
{
public Hospital()
{
Users = new HashSet<User>();
}
public int HospitalId { get; set; }
public string HospitalName { get; set; }
public string HospitalCode { get; set; }
public string Address { get; set; }
public string Phone { get; set; }
public virtual ICollection<User> Users { get; set; }
}
}

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Menu
{
public Menu()
{
Rolemenus = new HashSet<Rolemenu>();
}
public int MenuId { get; set; }
public string MenuName { get; set; }
public string MenuCode { get; set; }
public string Description { get; set; }
public int? ParentId { get; set; }
public virtual ICollection<Rolemenu> Rolemenus { get; set; }
}
}

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using QualityControlPlatform.Models.ControllerModels;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
/// <summary>
/// 新闻表
/// </summary>
public partial class News
{
public News()
{
Attacheds = new HashSet<Attached>();
}
public int NewId { get; set; }
public int? UserId { get; set; }
public int? PartId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime? Time { get; set; }
public bool? IfRelease { get; set; }
public virtual Part Part { get; set; }
public virtual User User { get; set; }
public virtual ICollection<Attached> Attacheds { get; set; }
}
}

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Part
{
public Part()
{
News = new HashSet<News>();
}
public int PartId { get; set; }
public string PartName { get; set; }
public string PartCode { get; set; }
public string Description { get; set; }
public virtual ICollection<News> News { get; set; }
}
}

@ -0,0 +1,319 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
/// <summary>
/// EF上下文
/// </summary>
public partial class QualityControlPlatformContext : Microsoft.EntityFrameworkCore.DbContext
{
/// <summary>
/// 私有化
/// </summary>
public QualityControlPlatformContext()
{
}
/// <summary>
///
/// </summary>
/// <param name="options"></param>
public QualityControlPlatformContext(DbContextOptions<QualityControlPlatformContext> options)
: base(options)
{
}
/// <summary>
/// 附件表
/// </summary>
public virtual DbSet<Attached> Attacheds { get; set; }
/// <summary>
/// 病种表
/// </summary>
public virtual DbSet<Disease> Diseases { get; set; }
/// <summary>
/// 医院基础信息表
/// </summary>
public virtual DbSet<Hospital> Hospitals { get; set; }
/// <summary>
/// 菜单表
/// </summary>
public virtual DbSet<Menu> Menus { get; set; }
/// <summary>
/// 新闻表
/// </summary>
public virtual DbSet<News> News { get; set; }
/// <summary>
/// 栏目表
/// </summary>
public virtual DbSet<Part> Parts { get; set; }
/// <summary>
/// 内容上报表
/// </summary>
public virtual DbSet<Report> Reports { get; set; }
/// <summary>
/// 内容上报问题表
/// </summary>
public virtual DbSet<ReportTemplate> ReportTemplates { get; set; }
/// <summary>
/// 角色表
/// </summary>
public virtual DbSet<Role> Roles { get; set; }
/// <summary>
/// 角色菜单表
/// </summary>
public virtual DbSet<Rolemenu> Rolemenus { get; set; }
/// <summary>
/// 用户表
/// </summary>
public virtual DbSet<User> Users { get; set; }
/// <summary>
/// 用户角色表
/// </summary>
public virtual DbSet<UserRole> UserRoles { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
optionsBuilder.UseMySql("server=10.20.10.120;userid=root;pwd=000626;port=3306;database=qualitycontrolplatform;sslmode=none", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.28-mysql"));
}
}
/// <summary>
/// 实体映射关系
/// </summary>
/// <param name="modelBuilder"></param>
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasCharSet("utf8mb4")
.UseCollation("utf8mb4_0900_ai_ci");
modelBuilder.Entity<Attached>(entity =>
{
entity.ToTable("attacheds");
entity.HasIndex(e => e.UserId, "FK_Reference_8");
entity.Property(e => e.AttachedTime).HasColumnType("datetime");
entity.Property(e => e.FileName).HasMaxLength(200);
entity.Property(e => e.FileSize).HasMaxLength(20);
entity.HasOne(d => d.User)
.WithMany(p => p.Attacheds)
.HasForeignKey(d => d.UserId)
.HasConstraintName("FK_Reference_8");
});
modelBuilder.Entity<Disease>(entity =>
{
entity.HasKey(e => e.DiseasesId)
.HasName("PRIMARY");
entity.ToTable("diseases");
entity.Property(e => e.Description).HasMaxLength(500);
entity.Property(e => e.DiseasesCode).HasMaxLength(100);
entity.Property(e => e.DiseasesName).HasMaxLength(100);
});
modelBuilder.Entity<Hospital>(entity =>
{
entity.ToTable("hospitals");
entity.Property(e => e.Address).HasMaxLength(50);
entity.Property(e => e.HospitalCode).HasMaxLength(30);
entity.Property(e => e.HospitalName).HasMaxLength(100);
entity.Property(e => e.Phone).HasMaxLength(30);
});
modelBuilder.Entity<Menu>(entity =>
{
entity.ToTable("menus");
entity.Property(e => e.Description).HasMaxLength(100);
entity.Property(e => e.MenuCode).HasMaxLength(30);
entity.Property(e => e.MenuName).HasMaxLength(20);
});
modelBuilder.Entity<News>(entity =>
{
entity.HasKey(e => e.NewId)
.HasName("PRIMARY");
entity.ToTable("news");
entity.HasIndex(e => e.PartId, "FK_Reference_13");
entity.HasIndex(e => e.UserId, "FK_Reference_5");
entity.Property(e => e.Content).HasColumnType("text");
entity.Property(e => e.Time).HasColumnType("datetime");
entity.Property(e => e.Title).HasMaxLength(200);
entity.HasOne(d => d.Part)
.WithMany(p => p.News)
.HasForeignKey(d => d.PartId)
.HasConstraintName("FK_Reference_13");
entity.HasOne(d => d.User)
.WithMany(p => p.News)
.HasForeignKey(d => d.UserId)
.HasConstraintName("FK_Reference_5");
});
modelBuilder.Entity<Part>(entity =>
{
entity.ToTable("parts");
entity.Property(e => e.Description).HasMaxLength(200);
entity.Property(e => e.PartCode).HasMaxLength(30);
entity.Property(e => e.PartName).HasMaxLength(30);
});
modelBuilder.Entity<Report>(entity =>
{
entity.ToTable("reports");
entity.HasIndex(e => e.DiseasesId, "FK_Reference_10");
entity.HasIndex(e => e.ReportTemplateId, "FK_Reference_11");
entity.HasIndex(e => e.UserId, "FK_Reference_12");
entity.Property(e => e.ReportContent).HasMaxLength(500);
entity.Property(e => e.ReportTime).HasColumnType("datetime");
entity.HasOne(d => d.Diseases)
.WithMany(p => p.Reports)
.HasForeignKey(d => d.DiseasesId)
.HasConstraintName("FK_Reference_10");
entity.HasOne(d => d.ReportTemplate)
.WithMany(p => p.Reports)
.HasForeignKey(d => d.ReportTemplateId)
.HasConstraintName("FK_Reference_11");
entity.HasOne(d => d.User)
.WithMany(p => p.Reports)
.HasForeignKey(d => d.UserId)
.HasConstraintName("FK_Reference_12");
});
modelBuilder.Entity<ReportTemplate>(entity =>
{
entity.ToTable("reporttemplates");
entity.HasIndex(e => e.DiseasesId, "FK_Reference_9");
entity.Property(e => e.Question).HasMaxLength(300);
entity.Property(e => e.Type)
.HasMaxLength(20)
.HasComment("int 整型\r\n decimal 小数\r\n date 时间\r\n string 文本");
entity.HasOne(d => d.Diseases)
.WithMany(p => p.ReportTemplates)
.HasForeignKey(d => d.DiseasesId)
.HasConstraintName("FK_Reference_9");
});
modelBuilder.Entity<Role>(entity =>
{
entity.ToTable("roles");
entity.Property(e => e.Description).HasMaxLength(300);
entity.Property(e => e.RoleCode).HasMaxLength(20);
entity.Property(e => e.RoleName).HasMaxLength(20);
});
modelBuilder.Entity<Rolemenu>(entity =>
{
entity.ToTable("rolemenu");
entity.HasIndex(e => e.RoleId, "FK_Reference_3");
entity.HasIndex(e => e.MenuId, "FK_Reference_4");
entity.HasOne(d => d.Menu)
.WithMany(p => p.Rolemenus)
.HasForeignKey(d => d.MenuId)
.HasConstraintName("FK_Reference_4");
entity.HasOne(d => d.Role)
.WithMany(p => p.Rolemenus)
.HasForeignKey(d => d.RoleId)
.HasConstraintName("FK_Reference_3");
});
modelBuilder.Entity<User>(entity =>
{
entity.ToTable("users");
entity.HasIndex(e => e.HospitalId, "FK_Reference_14");
entity.Property(e => e.DepartCode).HasMaxLength(20);
entity.Property(e => e.Department).HasMaxLength(20);
entity.Property(e => e.Password).HasMaxLength(16);
entity.Property(e => e.Phone).HasMaxLength(20);
entity.Property(e => e.UserCode).HasMaxLength(30);
entity.Property(e => e.UserName).HasMaxLength(30);
entity.HasOne(d => d.Hospital)
.WithMany(p => p.Users)
.HasForeignKey(d => d.HospitalId)
.HasConstraintName("FK_Reference_14");
});
modelBuilder.Entity<UserRole>(entity =>
{
entity.ToTable("userrole");
entity.HasIndex(e => e.RoleId, "FK_Reference_1");
entity.HasIndex(e => e.UserId, "FK_Reference_2");
entity.HasOne(d => d.Role)
.WithMany(p => p.Userroles)
.HasForeignKey(d => d.RoleId)
.HasConstraintName("FK_Reference_1");
entity.HasOne(d => d.User)
.WithMany(p => p.Userroles)
.HasForeignKey(d => d.UserId)
.HasConstraintName("FK_Reference_2");
});
OnModelCreatingPartial(modelBuilder);
}
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
}

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Report
{
public int ReportId { get; set; }
public int? DiseasesId { get; set; }
public int? ReportTemplateId { get; set; }
public int? UserId { get; set; }
public string ReportContent { get; set; }
public DateTime? ReportTime { get; set; }
public virtual Disease Diseases { get; set; }
public virtual ReportTemplate ReportTemplate { get; set; }
public virtual User User { get; set; }
}
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class ReportTemplate
{
public ReportTemplate()
{
Reports = new HashSet<Report>();
}
public int ReportTemplateId { get; set; }
public int? DiseasesId { get; set; }
public string Question { get; set; }
public bool? IfMust { get; set; }
public string Type { get; set; }
public virtual Disease Diseases { get; set; }
public virtual ICollection<Report> Reports { get; set; }
}
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Role
{
public Role()
{
Rolemenus = new HashSet<Rolemenu>();
Userroles = new HashSet<UserRole>();
}
public int RoleId { get; set; }
public string RoleName { get; set; }
public string RoleCode { get; set; }
public string Description { get; set; }
public virtual ICollection<Rolemenu> Rolemenus { get; set; }
public virtual ICollection<UserRole> Userroles { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class Rolemenu
{
public int RoleMenuId { get; set; }
public int? RoleId { get; set; }
public int? MenuId { get; set; }
public virtual Menu Menu { get; set; }
public virtual Role Role { get; set; }
}
}

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class User
{
public User()
{
Attacheds = new HashSet<Attached>();
News = new HashSet<News>();
Reports = new HashSet<Report>();
Userroles = new HashSet<UserRole>();
}
public int UserId { get; set; }
public int? HospitalId { get; set; }
public string UserName { get; set; }
public string UserCode { get; set; }
public string Password { get; set; }
public string Phone { get; set; }
public string Department { get; set; }
public string DepartCode { get; set; }
public virtual Hospital Hospital { get; set; }
public virtual ICollection<Attached> Attacheds { get; set; }
public virtual ICollection<News> News { get; set; }
public virtual ICollection<Report> Reports { get; set; }
public virtual ICollection<UserRole> Userroles { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace QualityControlPlatform.Models.DbContext
{
public partial class UserRole
{
public int UserRoleId { get; set; }
public int? RoleId { get; set; }
public int? UserId { get; set; }
public virtual Role Role { get; set; }
public virtual User User { get; set; }
}
}

@ -0,0 +1,19 @@
using System.Collections.Generic;
namespace QualityControlPlatform.Models.LogicModel
{
/// <summary>
/// 权限实体
/// </summary>
public class PermissionModel
{
/// <summary>
/// 角色Id
/// </summary>
public int RoleId { get; set; }
/// <summary>
/// 菜单Id
/// </summary>
public List<int> MenuIdList { get; set; }
}
}

@ -0,0 +1,43 @@
using System.Net.Http;
using QualityControlPlatform.Helpers.Sms;
namespace QualityControlPlatform.Models.SmsModel
{
/// <summary>
/// 短信回传实体
/// </summary>
public class SmsModel
{
/// <summary>
/// 无参构造
/// </summary>
public SmsModel()
{
}
/// <summary>
/// 发送短信验证
/// </summary>
/// <param name="httpClientFactory"></param>
/// <param name="phone"></param>
/// <param name="code"></param>
public SmsModel(IHttpClientFactory httpClientFactory, string phone, string code)
{
var smsHelper = new SmsHelper(httpClientFactory, phone, code);
var response = smsHelper?.OnGet();
response.Wait();
Code = smsHelper.SmsModel.Code;
Message = smsHelper.SmsModel.Message;
}
/// <summary>
/// 回传编码
/// </summary>
public int Code { get; set; }
/// <summary>
/// 回传信息
/// </summary>
public string Message { get; set; }
}
}

@ -1,15 +0,0 @@
using System;
namespace QualityControlPlatform.Models
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="true"
internalLogLevel="Off" internalLogFile="log\console.log">
<targets>
<target name="console" xsi:type="ColoredConsole"
layout="${date:format=HH\:mm\:ss}> ${message}"/>
<!--VS输出窗口-->
<target name="debugger" xsi:type="Debugger"
layout="${date:format=HH\:mm\:ss} | ${level:padding=-5} | ${message}" />
<target name="info" xsi:type="File" fileName="${basedir}/Logs/Info/${shortdate}/info.txt" layout="${date:format=HH\:mm\:ss} | ${level:padding=-5} | ${message}" />
<!--保存至文件-->
<target name="error_file" xsi:type="File" maxArchiveFiles="30"
fileName="${basedir}/Logs/Error/${shortdate}/error.txt"
layout="${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="debugger" />
<logger name="*" minlevel="Info" writeTo="info" />
<logger name="*" minlevel="Error" writeTo="error_file" />
</rules>
</nlog>

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using NLog.Web;
namespace QualityControlPlatform namespace QualityControlPlatform
{ {
@ -28,11 +29,12 @@ namespace QualityControlPlatform
/// </summary> /// </summary>
/// <param name="args"></param> /// <param name="args"></param>
/// <returns></returns> /// <returns></returns>
public static IHostBuilder CreateHostBuilder(string[] args) => public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.UseStartup<Startup>(); webBuilder.UseStartup<Startup>();
}); }).UseNLog();
} }
} }

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>True</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp3.1\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>netcoreapp3.1</TargetFramework>
<ProjectGuid>7552727e-94c0-42e9-a793-6ceab50260cc</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_PublishTargetUrl>C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform\bin\Release\netcoreapp3.1\publish\</_PublishTargetUrl>
<History>True|2022-04-02T03:07:02.7025104Z;True|2022-04-02T11:05:05.0164538+08:00;True|2022-04-02T10:57:08.8591733+08:00;True|2022-04-01T15:57:57.5665938+08:00;True|2022-04-01T15:54:58.0119669+08:00;False|2022-04-01T15:53:47.6374896+08:00;False|2022-04-01T15:53:43.2750363+08:00;True|2022-04-01T15:03:24.1510077+08:00;True|2022-04-01T14:59:08.0985019+08:00;True|2022-04-01T11:54:56.3726545+08:00;True|2022-04-01T09:46:24.5186543+08:00;True|2022-03-31T17:28:22.1977365+08:00;True|2022-03-31T15:54:28.1290856+08:00;True|2022-03-31T14:06:22.8758855+08:00;True|2022-03-31T13:54:25.5675661+08:00;True|2022-03-31T13:51:30.7873503+08:00;True|2022-03-30T16:41:42.6453509+08:00;True|2022-03-30T16:35:53.6149884+08:00;True|2022-03-30T16:34:00.2235055+08:00;True|2022-03-30T14:38:56.8683897+08:00;True|2022-03-30T11:16:54.7219857+08:00;True|2022-03-30T11:03:11.0441361+08:00;True|2022-03-30T11:00:14.2103028+08:00;True|2022-03-30T10:55:09.9274616+08:00;True|2022-03-29T17:15:18.1938072+08:00;True|2022-03-29T17:09:11.6160085+08:00;True|2022-03-29T16:09:51.8242088+08:00;True|2022-03-29T16:04:11.2664468+08:00;True|2022-03-29T14:25:43.7878641+08:00;True|2022-03-29T14:20:22.2346044+08:00;True|2022-03-29T14:16:02.5438368+08:00;True|2022-03-29T11:06:33.8952384+08:00;True|2022-03-29T10:33:15.7460920+08:00;True|2022-03-29T10:29:07.5049720+08:00;True|2022-03-29T10:28:47.4402777+08:00;False|2022-03-29T10:28:20.2160731+08:00;False|2022-03-29T10:28:14.3347639+08:00;True|2022-03-28T17:21:08.5705042+08:00;True|2022-03-28T17:20:46.6275941+08:00;True|2022-03-28T17:19:44.2274822+08:00;True|2022-03-28T17:15:34.3182712+08:00;True|2022-03-28T17:09:12.8709067+08:00;True|2022-03-28T17:08:18.4171207+08:00;True|2022-03-28T17:03:16.6659368+08:00;True|2022-03-28T16:53:51.8486606+08:00;True|2022-03-28T16:50:06.5700087+08:00;True|2022-03-28T16:43:41.4908492+08:00;True|2022-03-28T15:49:19.8644978+08:00;True|2022-03-28T15:30:16.1887515+08:00;True|2022-03-28T15:06:57.2865964+08:00;True|2022-03-28T15:03:42.2284750+08:00;True|2022-03-28T14:49:13.4972233+08:00;True|2022-03-28T14:45:43.6790721+08:00;True|2022-03-28T13:46:43.0286919+08:00;True|2022-03-28T13:29:06.5082288+08:00;True|2022-03-17T15:01:35.6143080+08:00;True|2022-03-17T14:42:43.6898518+08:00;True|2022-03-17T13:52:25.3883162+08:00;True|2022-03-16T17:08:50.2525079+08:00;</History>
</PropertyGroup>
</Project>

@ -21,10 +21,10 @@
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger", "launchUrl": "swagger",
"applicationUrl": "https://localhost:5001;http://localhost:5000", "applicationUrl": "https://localhost:5001;http://localhost:5000;http://0.0.0.0:5000;",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
} }
} }
} }

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
@ -7,8 +7,19 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.22" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>
</Project> </Project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
</Project>

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using System.Collections.Generic; using System.Collections.Generic;
using QualityControlPlatform.Helpers.Cache;
using QualityControlPlatform.Middleware; using QualityControlPlatform.Middleware;
namespace QualityControlPlatform namespace QualityControlPlatform
{ {
@ -39,6 +40,9 @@ namespace QualityControlPlatform
/// <param name="services"></param> /// <param name="services"></param>
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddHttpClient();
services.AddMemoryCache();
services.AddSingleton<CacheHelper>();
services.AddControllers(); services.AddControllers();
// swagger ÅäÖÃ // swagger ÅäÖÃ
services.AddSwaggerGen(c => services.AddSwaggerGen(c =>

@ -0,0 +1,8 @@
2022-03-29 16:09:00.2552 | Error | An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - QualityControlPlatform.Controllers.News.NewController.Change (QualityControlPlatform). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException

@ -0,0 +1,8 @@
2022-03-30 17:23:08.5393 | Error | An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - QualityControlPlatform.Controllers.User.UserController.SendSms (QualityControlPlatform). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException

@ -0,0 +1,90 @@
2022-03-31 10:36:19.0361 | Error | An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - QualityControlPlatform.Controllers.User.UserController.CacheSet (QualityControlPlatform). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException
2022-03-31 17:00:20.7176 | Error | An unhandled exception has occurred while executing the request. System.InvalidOperationException: This MySqlConnection is already in use. See https://fl.vu/mysql-conn-reuse
at MySqlConnector.Core.ServerSession.StartQuerying(ICancellableCommand command) in /_/src/MySqlConnector/Core/ServerSession.cs:line 279
at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 56
at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 319
at MySqlConnector.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) in /_/src/MySqlConnector/MySqlCommand.cs:line 261
at System.Data.Common.DbCommand.ExecuteReader()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(DbContext _, Boolean result)
at Pomelo.EntityFrameworkCore.MySql.Storage.Internal.MySqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
at System.Text.Json.JsonSerializer.HandleEnumerable(JsonClassInfo elementClassInfo, JsonSerializerOptions options, Utf8JsonWriter writer, WriteStack& state)
at System.Text.Json.JsonSerializer.Write(Utf8JsonWriter writer, Int32 originalWriterDepth, Int32 flushThreshold, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteAsyncCore(Stream utf8Json, Object value, Type inputType, JsonSerializerOptions options, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|21_0(ResourceInvoker invoker, IActionResult result)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at QualityControlPlatform.Middleware.JwtMiddleware.Invoke(HttpContext context) in C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform\Middleware\JwtMiddleware.cs:line 87
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException
2022-03-31 17:23:12.8322 | Error | An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Ambiguous HTTP method for action - QualityControlPlatform.Controllers.User.HospitalController.AnswerUsers (QualityControlPlatform). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException
2022-03-31 17:26:11.7694 | Error | An unhandled exception has occurred while executing the request. System.InvalidOperationException: Unable to translate the given 'GroupBy' pattern. Call 'AsEnumerable' before 'GroupBy' to evaluate it client-side.
at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.VisitExtension(Expression extensionExpression)
at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.ShaperProcessingExpressionVisitor.ProcessShaper(Expression shaperExpression, RelationalCommandCache& relationalCommandCache, LambdaExpression& relatedDataLoaders)
at Microsoft.EntityFrameworkCore.Query.RelationalShapedQueryCompilingExpressionVisitor.VisitShapedQuery(ShapedQueryExpression shapedQueryExpression)
at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.VisitExtension(Expression extensionExpression)
at System.Linq.Expressions.Expression.Accept(ExpressionVisitor visitor)
at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at QualityControlPlatform.Controllers.User.HospitalController.AnswerUsers(Int32 hospitalId, Int32 diseasesId, Int32 page, Int32 number)
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at QualityControlPlatform.Middleware.JwtMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException

@ -0,0 +1,8 @@
2022-04-01 15:57:27.2064 | Error | An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Conflicting method/path combination "GET api/Menu" for actions - QualityControlPlatform.Controllers.Menus.MenuController.List (QualityControlPlatform),QualityControlPlatform.Controllers.Menus.MenuController.Update (QualityControlPlatform). Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
AsyncMethodBuilderCore.Start => <Invoke>d__9.MoveNext => DiagnosticsLoggerExtensions.UnhandledException

@ -0,0 +1,6 @@
17:02:00 | Info | Application started. Press Ctrl+C to shut down.
17:02:00 | Info | Hosting environment: Development
17:02:00 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:08:03 | Info | Application started. Press Ctrl+C to shut down.
17:08:03 | Info | Hosting environment: Development
17:08:03 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform

@ -0,0 +1,13 @@
14:20:00 | Info | Application started. Press Ctrl+C to shut down.
14:20:00 | Info | Hosting environment: Development
14:20:00 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
14:59:14 | Info | Application started. Press Ctrl+C to shut down.
14:59:14 | Info | Hosting environment: Development
14:59:14 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:08:59 | Info | Application started. Press Ctrl+C to shut down.
16:08:59 | Info | Hosting environment: Development
16:08:59 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:09:00 | Error | An unhandled exception has occurred while executing the request.
16:09:31 | Info | Application started. Press Ctrl+C to shut down.
16:09:31 | Info | Hosting environment: Development
16:09:31 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform

@ -0,0 +1,30 @@
16:29:54 | Info | Application started. Press Ctrl+C to shut down.
16:29:54 | Info | Hosting environment: Development
16:29:54 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:31:12 | Info | Application started. Press Ctrl+C to shut down.
16:31:12 | Info | Hosting environment: Development
16:31:12 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:41:09 | Info | Application started. Press Ctrl+C to shut down.
16:41:09 | Info | Hosting environment: Development
16:41:09 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:23:07 | Info | Application started. Press Ctrl+C to shut down.
17:23:07 | Info | Hosting environment: Development
17:23:07 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:23:08 | Error | An unhandled exception has occurred while executing the request.
17:24:55 | Info | Application started. Press Ctrl+C to shut down.
17:24:55 | Info | Hosting environment: Development
17:24:55 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:25:12 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=482625
17:25:12 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=482625
17:25:12 | Info | Received HTTP response after 775.7383ms - OK
17:25:12 | Info | End processing HTTP request after 800.4319ms - OK
17:26:41 | Info | Application started. Press Ctrl+C to shut down.
17:26:41 | Info | Hosting environment: Development
17:26:42 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:26:57 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=552422
17:26:57 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=552422
17:27:49 | Info | Application started. Press Ctrl+C to shut down.
17:27:49 | Info | Hosting environment: Development
17:27:49 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:28:05 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=741943
17:28:05 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=741943

@ -0,0 +1,103 @@
09:56:01 | Info | Application started. Press Ctrl+C to shut down.
09:56:01 | Info | Hosting environment: Development
09:56:01 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
09:56:17 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=781886
09:56:17 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=781886
09:56:18 | Info | Received HTTP response after 795.0085ms - OK
09:56:18 | Info | End processing HTTP request after 820.831ms - OK
09:57:09 | Info | Application started. Press Ctrl+C to shut down.
09:57:09 | Info | Hosting environment: Development
09:57:09 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
09:57:20 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=835601
09:57:20 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=835601
09:57:21 | Info | Received HTTP response after 655.951ms - OK
09:57:21 | Info | End processing HTTP request after 689.1809ms - OK
10:09:02 | Info | Application started. Press Ctrl+C to shut down.
10:09:02 | Info | Hosting environment: Development
10:09:02 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:09:15 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=156967
10:09:15 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=156967
10:09:15 | Info | Received HTTP response after 839.5721ms - OK
10:09:15 | Info | End processing HTTP request after 862.6124ms - OK
10:10:04 | Info | Application started. Press Ctrl+C to shut down.
10:10:04 | Info | Hosting environment: Development
10:10:04 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:10:15 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=397299
10:10:15 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=397299
10:10:16 | Info | Received HTTP response after 683.3551ms - OK
10:10:16 | Info | End processing HTTP request after 704.156ms - OK
10:10:42 | Info | Application started. Press Ctrl+C to shut down.
10:10:43 | Info | Hosting environment: Development
10:10:43 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:10:54 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=343204
10:10:54 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=343204
10:10:55 | Info | Received HTTP response after 474.2142ms - OK
10:10:55 | Info | End processing HTTP request after 508.0662ms - OK
10:17:21 | Info | Application started. Press Ctrl+C to shut down.
10:17:21 | Info | Hosting environment: Development
10:17:21 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:17:33 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=251544
10:17:33 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=251544
10:17:33 | Info | Received HTTP response after 738.7785ms - OK
10:17:33 | Info | End processing HTTP request after 772.3697ms - OK
10:19:46 | Info | Application started. Press Ctrl+C to shut down.
10:19:46 | Info | Hosting environment: Development
10:19:46 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:20:14 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=199139
10:20:14 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=199139
10:20:15 | Info | Received HTTP response after 675.8955ms - OK
10:20:15 | Info | End processing HTTP request after 698.8691ms - OK
10:26:02 | Info | Application started. Press Ctrl+C to shut down.
10:26:02 | Info | Hosting environment: Development
10:26:02 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:28:24 | Info | Application started. Press Ctrl+C to shut down.
10:28:24 | Info | Hosting environment: Development
10:28:24 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:29:37 | Info | Application started. Press Ctrl+C to shut down.
10:29:37 | Info | Hosting environment: Development
10:29:37 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:29:49 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=934174
10:29:49 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=934174
10:29:50 | Info | Received HTTP response after 720.4541ms - OK
10:29:50 | Info | End processing HTTP request after 751.7425ms - OK
10:36:18 | Info | Application started. Press Ctrl+C to shut down.
10:36:18 | Info | Hosting environment: Development
10:36:18 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:36:19 | Error | An unhandled exception has occurred while executing the request.
10:36:42 | Info | Application started. Press Ctrl+C to shut down.
10:36:42 | Info | Hosting environment: Development
10:36:42 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:41:26 | Info | Application started. Press Ctrl+C to shut down.
10:41:26 | Info | Hosting environment: Development
10:41:26 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
10:41:51 | Info | Start processing HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=213003
10:41:51 | Info | Sending HTTP request POST http://wx.hhzyy.com/micro/api/smsHelp?callNo=xbd_code_001&tel=18206787486&code=213003
10:41:51 | Info | Received HTTP response after 726.0046ms - OK
10:41:51 | Info | End processing HTTP request after 745.5751ms - OK
14:05:42 | Info | Application started. Press Ctrl+C to shut down.
14:05:42 | Info | Hosting environment: Development
14:05:42 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
15:51:46 | Info | Application started. Press Ctrl+C to shut down.
15:51:46 | Info | Hosting environment: Development
15:51:46 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
15:53:19 | Info | Application started. Press Ctrl+C to shut down.
15:53:19 | Info | Hosting environment: Development
15:53:19 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:56:21 | Info | Application started. Press Ctrl+C to shut down.
16:56:21 | Info | Hosting environment: Development
16:56:21 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
16:59:39 | Info | Application started. Press Ctrl+C to shut down.
16:59:39 | Info | Hosting environment: Development
16:59:39 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:00:20 | Error | An unhandled exception has occurred while executing the request.
17:05:39 | Info | Application started. Press Ctrl+C to shut down.
17:05:39 | Info | Hosting environment: Development
17:05:39 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:23:12 | Info | Application started. Press Ctrl+C to shut down.
17:23:12 | Info | Hosting environment: Development
17:23:12 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:23:12 | Error | An unhandled exception has occurred while executing the request.
17:23:32 | Info | Application started. Press Ctrl+C to shut down.
17:23:32 | Info | Hosting environment: Development
17:23:32 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
17:26:11 | Error | An unhandled exception has occurred while executing the request.

@ -0,0 +1,10 @@
09:59:43 | Info | Application started. Press Ctrl+C to shut down.
09:59:44 | Info | Hosting environment: Development
09:59:44 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
15:57:26 | Info | Application started. Press Ctrl+C to shut down.
15:57:26 | Info | Hosting environment: Development
15:57:26 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform
15:57:27 | Error | An unhandled exception has occurred while executing the request.
15:57:44 | Info | Application started. Press Ctrl+C to shut down.
15:57:44 | Info | Hosting environment: Development
15:57:44 | Info | Content root path: C:\My Space\ProjectForUnit\QualityControlPlatform\QualityControlPlatform

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save