Browse Source

所有预约信息新增时间字段

master
liujiaqiang 2 years ago
parent
commit
3f117b987f
  1. 18
      24Hour/Controllers/Common/CommonController.cs
  2. 48
      24Hour/Controllers/Common/HearingController.cs
  3. 3
      24Hour/Controllers/Common/LawyerservicesController.cs
  4. 1
      24Hour/Controllers/Common/RemoteController.cs
  5. 1
      24Hour/Controllers/Common/ReservationController.cs
  6. 4
      24Hour/Controllers/LoginController.cs
  7. 264
      24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230626/11.log
  8. 6
      Elight.Entity/AppMode/App_HearingModel.cs
  9. 6
      Elight.Entity/AppMode/App_LawyerServicesModel.cs
  10. 6
      Elight.Entity/AppMode/App_ReceptionModel.cs
  11. 6
      Elight.Entity/AppMode/App_RemoteModel.cs
  12. 606
      Elight.Utility/HttpHelper.cs

18
24Hour/Controllers/Common/CommonController.cs

@ -30,6 +30,7 @@ namespace _24Hour.Controllers.Common
private readonly WriteSysLog _logs;//操作日志
private readonly WebSocketController _SocketCon;//WebSocket发送
App_Sys_UserModel _userdata = new App_Sys_UserModel();//当前用户
private readonly List<App_Sys_UnitModel> _Unitdata;//当前用户
private readonly ILogger<LoginController> _logger;//日志
Result result = new Result();
public CommonController(ILogger<LoginController> logger, SqlSugarClient db, WriteSysLog logs, User user, WebSocketController SocketCon)
@ -39,6 +40,7 @@ namespace _24Hour.Controllers.Common
_logs = logs;
_userdata = user.Userdata();
_SocketCon = SocketCon;
_Unitdata= _db.Queryable<App_Sys_UnitModel>().Where(q => q.IsDelete == 0).ToList();
}
#endregion
@ -249,11 +251,13 @@ namespace _24Hour.Controllers.Common
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var userda=Userdata.Where(x => x.Id == q.receptionuser).FirstOrDefault();
var Unitdata = _Unitdata.Where(x=>x.Id==q.unitId).FirstOrDefault();
list.Add(new
{
type = 0,
Id = q.Id,
daId = da?.Id,
Unitname= Unitdata?.unitname,
title = da?.title,
color = da?.color,
icon = da?.icon,
@ -285,6 +289,7 @@ namespace _24Hour.Controllers.Common
Remotedata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
type = 1,
@ -293,6 +298,7 @@ namespace _24Hour.Controllers.Common
title = da?.title,
color = da?.color,
icon = da?.icon,
Unitname = Unitdata?.unitname,
name = q.name,
phone = q.phone,
matter = "",//事由
@ -323,6 +329,7 @@ namespace _24Hour.Controllers.Common
Receptiondata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
type = 2,
@ -331,6 +338,7 @@ namespace _24Hour.Controllers.Common
title = da?.title,
color = da?.color,
icon = da?.icon,
Unitname = Unitdata?.unitname,
name ="",
phone = q.phone,
matter = q.matter,//事由
@ -362,6 +370,7 @@ namespace _24Hour.Controllers.Common
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var userda = Userdata.Where(x => x.Id == q.receptionuser).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
type = 3,
@ -370,6 +379,7 @@ namespace _24Hour.Controllers.Common
title = da?.title,
color = da?.color,
icon = da?.icon,
Unitname = Unitdata?.unitname,
name = q.lawyeruser,//律师律师名称
lawyerunit =q.lawyerunit,//律师事务所
@ -870,9 +880,11 @@ namespace _24Hour.Controllers.Common
Lawyerdata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
Id = q.Id,
Unitname = Unitdata?.unitname,
title = da?.title,
path = da?.path,
color = da?.color,
@ -894,9 +906,11 @@ namespace _24Hour.Controllers.Common
Remotedata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
Id = q.Id,
Unitname = Unitdata?.unitname,
title = da?.title,
path = da?.path,
color = da?.color,
@ -918,9 +932,11 @@ namespace _24Hour.Controllers.Common
Receptiondata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
Id = q.Id,
Unitname = Unitdata?.unitname,
title = da?.title,
path = da?.path,
color = da?.color,
@ -940,9 +956,11 @@ namespace _24Hour.Controllers.Common
Hearingdata.ToList().ForEach(q =>
{
var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault();
var Unitdata = _Unitdata.Where(x => x.Id == q.unitId).FirstOrDefault();
list.Add(new
{
Id = q.Id,
Unitname = Unitdata?.unitname,
title = da?.title,
path = da?.path,
color = da?.color,

48
24Hour/Controllers/Common/HearingController.cs

@ -184,5 +184,53 @@ namespace _24Hour.Controllers.Common
return result;
}
#endregion
#region 听证服务状态更改
/// <summary>
/// 修改听证服务预约状态
/// </summary>
/// <param name="Id">听证服务预约Id</param>
/// <param name="state">状态</param>
/// <param name="reason">拒绝原因</param>
/// <returns></returns>
[HttpGet]
[Route("UpdateHearingstate")]
public async Task<Result> UpdateHearingstate(string? Id, int state, string? reason)
{
try
{
var Hearingbol = await _db.Queryable<App_HearingModel>().Where(q => q.Id == Id).ToListAsync();
if (Hearingbol.Any())
{
Hearingbol.FirstOrDefault().state = state;
if (reason.NotNull())
Hearingbol.FirstOrDefault().reason = reason;
Hearingbol.FirstOrDefault().acceptancetime = DateTime.Now;
_db.BeginTran();
var num = await _db.Updateable(Hearingbol.FirstOrDefault()).UpdateColumns(it => new { it.state, it.reason, it.acceptancetime }).ExecuteCommandAsync();
_db.CommitTran();
if (num > 0)
{
result.IsSucceed = true;
result.result = "同意";
}
}
else
{
result.IsSucceed = false;
result.result = "未找到预约信息";
}
}
catch (System.Exception ex)
{
_db.RollbackTran();
result.IsSucceed = false;
result.Message = ex.Message;
LogService.WriteLog(ex, "修改听证服务预约状态");
}
_logs.WriteSysLogadd("听证服务", "修改听证服务预约状态", result, _db);
return result;
}
#endregion
}
}

3
24Hour/Controllers/Common/LawyerservicesController.cs

@ -248,8 +248,9 @@ namespace _24Hour.Controllers.Common
Lawyerbol.FirstOrDefault().state = state;
if(reason.NotNull())
Lawyerbol.FirstOrDefault().reason = reason;
Lawyerbol.FirstOrDefault().acceptancetime = DateTime.Now;
_db.BeginTran();
var num = await _db.Updateable(Lawyerbol.FirstOrDefault()).UpdateColumns(it => new { it.state, it.reason }).ExecuteCommandAsync();
var num = await _db.Updateable(Lawyerbol.FirstOrDefault()).UpdateColumns(it => new { it.state, it.reason,it.acceptancetime }).ExecuteCommandAsync();
_db.CommitTran();
if (num > 0)
{

1
24Hour/Controllers/Common/RemoteController.cs

@ -298,6 +298,7 @@ namespace _24Hour.Controllers.Common
Lawyerbol.FirstOrDefault().ettime = Remoteput.ettime;
if (Remoteput.reason.NotNull())
Lawyerbol.FirstOrDefault().reason = Remoteput.reason;
Lawyerbol.FirstOrDefault().acceptancetime = DateTime.Now;
_db.BeginTran();
var num = await _db.Updateable(Lawyerbol.FirstOrDefault()).ExecuteCommandAsync();
_db.CommitTran();

1
24Hour/Controllers/Common/ReservationController.cs

@ -218,6 +218,7 @@ namespace _24Hour.Controllers.Common
var Receptionlist = await _db.Queryable<App_ReceptionModel>().Where(q =>q.Id== Commonpagedata.Id).ToListAsync();
Receptionlist.ForEach(q => {
q.state = (int)Commonpagedata.state;
q.acceptancetime = DateTime.Now;
if (Commonpagedata.reason.NotNull())
q.reason = Commonpagedata.reason;
});

4
24Hour/Controllers/LoginController.cs

@ -107,8 +107,8 @@ namespace _24Hour.Controllers
photo = date.photo,
duties = date.duties,
identity = date.identity,
unitCode = "",
department = "",
unitCode = date.unitCode,
department = date.department,
token = tokenString
};
#endregion

264
24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230626/11.log

@ -418,3 +418,267 @@ Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, Sugar
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:18:02
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:18:02
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:18:02
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:18:02
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:19:39
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:19:39
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:19:59
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:19:59
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:25:45
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:25:45
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:25:57
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:25:57
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:25:59
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:25:59
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:26:02
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:26:02
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:26:04
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:26:04
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:26:09
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:26:09
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:27:13
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:27:13
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:38:06
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:38:06
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:38:16
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:38:16
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:38:55
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:38:55
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:38:58
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:38:58
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:39:01
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:39:01
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:45:49
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:45:49
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:45:57
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:45:57
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:45:59
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:45:59
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:50:59
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:50:59
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:51:04
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:51:04
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************
日志时间:2023-06-26 11:52:46
************************Exception Start********************************
Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常
Exception Date:2023/6/26 11:52:46
Exception Type:MySqlConnector.MySqlException
Exception Message:Data too long for column 'OperatingManual' at row 1
Exception Source:SqlSugar
Exception StackTrace: at SqlSugar.AdoProvider.ExecuteCommand(String sql, SugarParameter[] parameters)
at SqlSugar.InsertableProvider`1.ExecuteCommand()
at Elight.Logic.WriteSysLog.WriteSysLogadd(String operationType, String content, Result result, SqlSugarClient _db, String opeCasDepAccCas) in E:\Code\24Hour.Service\Elight.Logic\WriteSysLog.cs:line 52
************************Exception End************************************

6
Elight.Entity/AppMode/App_HearingModel.cs

@ -48,6 +48,12 @@ namespace Elight.Entity
[DataMember]
public DateTime? reservationtime { get; set; }
/// <summary>
/// 同意受理时间
/// </summary>
[DataMember]
public DateTime? acceptancetime { get; set; }
/// <summary>
/// 所在地
/// </summary>

6
Elight.Entity/AppMode/App_LawyerServicesModel.cs

@ -48,6 +48,12 @@ namespace Elight.Entity
[DataMember]
public DateTime? receptiontime { get; set; }
/// <summary>
/// 同意受理时间
/// </summary>
[DataMember]
public DateTime? acceptancetime { get; set; }
/// <summary>
/// 访问事由
/// </summary>

6
Elight.Entity/AppMode/App_ReceptionModel.cs

@ -51,6 +51,12 @@ namespace Elight.Entity
[DataMember]
public DateTime? ettime { get; set; }
/// <summary>
/// 同意受理时间
/// </summary>
[DataMember]
public DateTime? acceptancetime { get; set; }
/// <summary>
/// 会见人Id
/// </summary>

6
Elight.Entity/AppMode/App_RemoteModel.cs

@ -62,6 +62,12 @@ namespace Elight.Entity
[DataMember]
public DateTime? ettime { get; set; }
/// <summary>
/// 同意受理时间
/// </summary>
[DataMember]
public DateTime? acceptancetime { get; set; }
/// <summary>
/// 会见人Id
/// </summary>

606
Elight.Utility/HttpHelper.cs

@ -0,0 +1,606 @@
using Microsoft.IdentityModel.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Cache;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using Elight.Utility.logs;
namespace Elight.Utility
{
public class HttpHelper
{
public static string Post(string url, object obj_model)
{
ServicePointManager.DefaultConnectionLimit = 200;
return Post(url, obj_model, out string error);
}
/// <summary>
/// 提交Post数据 json
/// </summary>
/// <param name="url"></param>
/// <param name="obj_model"></param>
/// <param name="headersdic"></param>
/// <returns></returns>
public static string Post(string sUrl, dynamic obj_model, out string ErrMsg)
{
string sPostData = JsonConvert.SerializeObject(obj_model);
ErrMsg = sPostData;
if (string.IsNullOrEmpty(sUrl))
return "{}";
Encoding myEncoding = Encoding.UTF8;
string sMode = "POST";
sPostData = sPostData.Replace("_params", "params");
string sContentType = "application/json";
HttpWebRequest req = null;
HttpWebResponse res = null;
try
{
req = HttpWebRequest.Create(sUrl) as HttpWebRequest;
req.Method = sMode;
req.Accept = "*/*";
req.KeepAlive = true;
req.Timeout = 70000;
req.ReadWriteTimeout = 300000;
req.ServicePoint.Expect100Continue = false;
req.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
if (0 == string.Compare("POST", sMode))
{
byte[] bufPost = myEncoding.GetBytes(sPostData);
req.ContentType = sContentType;
req.ContentLength = bufPost.Length;
using (Stream newStream = req.GetRequestStream())
{
newStream.Write(bufPost, 0, bufPost.Length);
}
}
res = req.GetResponse() as HttpWebResponse;
req.Abort();
var re = "";
using (Stream resStream = res.GetResponseStream())
{
using (StreamReader resStreamReader = new StreamReader(resStream, myEncoding))
{
re = resStreamReader.ReadToEnd();
}
}
res.Close();
return re;
}
catch (System.Net.WebException ex)
{
Encoding encoding = Encoding.UTF8;
var strResponse = GetResponseAsString((System.Net.HttpWebResponse)ex.Response, encoding);//这样获取web服务器返回数据
ErrMsg = ex.Message;
LogService.WriteLog(ex, "接口调用");
return "{\"Message\":\"" + ErrMsg + "\",\"IsSucceed\":false}";
}
finally
{
if (req != null)
{
req.Abort();
req = null;
}
if (res != null)
{
res.Close();
res.Dispose();
req = null;
}
}
}
/// <summary>
/// 提交Post数据 json 7000毫秒停止
/// </summary>
/// <param name="url"></param>
/// <param name="obj_model"></param>
/// <param name="headersdic"></param>
/// <returns></returns>
public static string Post6000(string sUrl, dynamic obj_model, out string ErrMsg)
{
string sPostData = JsonConvert.SerializeObject(obj_model);
ErrMsg = sPostData;
if (string.IsNullOrEmpty(sUrl))
return "{}";
Encoding myEncoding = Encoding.UTF8;
string sMode = "POST";
sPostData = sPostData.Replace("_params", "params");
string sContentType = "application/json";
HttpWebRequest req = null;
HttpWebResponse res = null;
try
{
req = HttpWebRequest.Create(sUrl) as HttpWebRequest;
req.Method = sMode;
req.Accept = "*/*";
req.KeepAlive = true;
req.Timeout = 6000;
req.ReadWriteTimeout = 300000;
req.ServicePoint.Expect100Continue = false;
req.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
if (0 == string.Compare("POST", sMode))
{
byte[] bufPost = myEncoding.GetBytes(sPostData);
req.ContentType = sContentType;
req.ContentLength = bufPost.Length;
using (Stream newStream = req.GetRequestStream())
{
newStream.Write(bufPost, 0, bufPost.Length);
}
}
res = req.GetResponse() as HttpWebResponse;
req.Abort();
var re = "";
using (Stream resStream = res.GetResponseStream())
{
using (StreamReader resStreamReader = new StreamReader(resStream, myEncoding))
{
re = resStreamReader.ReadToEnd();
}
}
res.Close();
return re;
}
catch (System.Net.WebException ex)
{
Encoding encoding = Encoding.UTF8;
var strResponse = GetResponseAsString((System.Net.HttpWebResponse)ex.Response, encoding);//这样获取web服务器返回数据
ErrMsg = ex.Message;
LogService.WriteLog(ex, "接口调用");
return "{\"Message\":\"" + ErrMsg + "\",\"IsSucceed\":false}";
}
finally
{
if (req != null)
{
req.Abort();
req = null;
}
if (res != null)
{
res.Close();
res.Dispose();
req = null;
}
}
}
/// <summary>
/// 提交Post数据 byte[]
/// </summary>
/// <param name="url"></param>
/// <param name="postBase64String">Base64字符串</param>
/// <param name="headersdic"></param>
/// <returns></returns>
public static string PostBytes(string sUrl, string postBase64String, out string ErrMsg)
{
ErrMsg = postBase64String;
if (string.IsNullOrEmpty(sUrl))
return "{}";
Encoding myEncoding = Encoding.UTF8;
string sMode = "POST";
string sContentType = "application/json";
HttpWebRequest req = null;
HttpWebResponse res = null;
try
{
req = HttpWebRequest.Create(sUrl) as HttpWebRequest;
req.Method = sMode;
req.Accept = "*/*";
req.KeepAlive = true;
req.Timeout = 70000;
req.ReadWriteTimeout = 300000;
req.ServicePoint.Expect100Continue = false;
req.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
if (0 == string.Compare("POST", sMode))
{
byte[] bufPost = Convert.FromBase64String(postBase64String);
req.ContentType = sContentType;
req.ContentLength = bufPost.Length;
using (Stream newStream = req.GetRequestStream())
{
newStream.Write(bufPost, 0, bufPost.Length);
}
}
res = req.GetResponse() as HttpWebResponse;
req.Abort();
var re = "";
using (Stream resStream = res.GetResponseStream())
{
using (var mstream = new MemoryStream())
{
resStream.CopyTo(mstream);
re = Convert.ToBase64String(mstream.ToArray());
}
}
res.Close();
return re;
}
catch (Exception ex)
{
ErrMsg = ex.Message;
LogService.WriteLog(ex, "接口调用");
return "{\"Message\":\"" + ErrMsg + "\",\"IsSucceed\":false}";
}
finally
{
if (req != null)
{
req.Abort();
req = null;
}
if (res != null)
{
res.Close();
res.Dispose();
req = null;
}
}
}
/// <summary>
/// 发送数据
/// </summary>
/// <param name="url"></param>
/// <param name="dic"></param>
/// <returns></returns>
public static string Post(string url, Dictionary<string, string> dic, out string ErrMsg)
{
string result = "";
ErrMsg = "";
HttpWebResponse resp = null;
try
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Timeout = 70000;
req.ReadWriteTimeout = 300000;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
#region 添加Post 参数
StringBuilder builder = new StringBuilder();
int i = 0;
foreach (var item in dic)
{
if (i > 0)
builder.Append("&");
builder.AppendFormat("{0}={1}", item.Key, item.Value);
i++;
}
byte[] data = Encoding.UTF8.GetBytes(builder.ToString());
req.ContentLength = data.Length;
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
#endregion
resp = (HttpWebResponse)req.GetResponse();
Stream stream = resp.GetResponseStream();
//获取响应内容
using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
{
result = reader.ReadToEnd();
}
return result;
}
catch (Exception ex)
{
ErrMsg = ex.Message;
return "{\"Message\":\"" + ErrMsg + "\",\"IsSucceed\":false}";
}
finally
{
if (resp != null)
resp.Close();
}
}
/// <summary>
/// 提交Post数据 file
/// </summary>
/// <param name="sUrl"></param>
/// <param name="files"></param>
/// <param name="ErrMsg"></param>
/// <returns></returns>
public static string Post(string sUrl, Dictionary<string, Stream> files, out string ErrMsg)
{
ErrMsg = "{\"message\":\"文件:" + string.Join(",", files.Keys) + " 上传失败!\",\"code\":-1}";
if (string.IsNullOrEmpty(sUrl))
return "{}";
string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("x");
byte[] boundarybytes = Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
byte[] endbytes = Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
Encoding myEncoding = Encoding.UTF8;
string sMode = "POST";
string sContentType = "multipart/form-data; boundary=" + boundary;
HttpWebRequest req;
try
{
req = HttpWebRequest.Create(sUrl) as HttpWebRequest;
req.Method = sMode;
req.Accept = "*/*";
req.KeepAlive = false;
req.Timeout = 1000 * 60 * 2;
req.ReadWriteTimeout = 300000;
req.Credentials = CredentialCache.DefaultCredentials;
req.CachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore);
if (0 == string.Compare("POST", sMode))
{
using (var stream = req.GetRequestStream())
{
string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: application/octet-stream\r\n\r\n";
byte[] buffer = new byte[4096];
int bytesRead = 0;
foreach (var file in files)
{
stream.Write(boundarybytes, 0, boundarybytes.Length);
string header = string.Format(headerTemplate, file.Key, Path.GetFileName(file.Key));
byte[] headerbytes = myEncoding.GetBytes(header);
stream.Write(headerbytes, 0, headerbytes.Length);
while ((bytesRead = file.Value.Read(buffer, 0, buffer.Length)) != 0)
{
stream.Write(buffer, 0, bytesRead);
}
}
stream.Write(endbytes, 0, endbytes.Length);
}
}
// Response
HttpWebResponse res = req.GetResponse() as HttpWebResponse;
req.Abort();
var re = "";
using (Stream resStream = res.GetResponseStream())
{
using (StreamReader resStreamReader = new StreamReader(resStream, myEncoding))
{
re = resStreamReader.ReadToEnd();
}
}
res.Close();
return re;
}
catch (Exception ex)
{
ErrMsg = ex.Message;
return "{\"Message\":\"" + ErrMsg + "\",\"IsSucceed\":false}";
}
}
/// <summary>
/// GET请求获取信息
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string Get(string url, int timeout = 70000, List<System.Net.Cookie> cookies = null)
{
ServicePointManager.DefaultConnectionLimit = 10;
string ret = "{}";
try
{
HttpWebRequest web = (HttpWebRequest)HttpWebRequest.Create(url);
web.Method = "GET";
web.Timeout = timeout;
if (cookies != null && cookies.Count > 0)
{
web.CookieContainer = new CookieContainer();
string host = new Uri(url).Host;
foreach (System.Net.Cookie c in cookies)
{
c.Domain = host;
web.CookieContainer.Add(c);
}
}
HttpWebResponse res = (HttpWebResponse)web.GetResponse();
using (Stream s = res.GetResponseStream())
{
using (StreamReader sr = new StreamReader(s, Encoding.UTF8))
{
ret = sr.ReadToEnd();
}
}
res.Close();
web.Abort();
}
catch (Exception ex)
{
ret = "{\"Message\":\"" + ex.Message + "\",\"IsSucceed\":false}";
LogService.WriteLog(ex, "接口调用");
}
return ret;
}
public static string Get(string url, Encoding encode, int timeout = 70000, List<System.Net.Cookie> cookies = null)
{
ServicePointManager.DefaultConnectionLimit = 10;
string ret = "{}";
try
{
HttpWebRequest web = (HttpWebRequest)HttpWebRequest.Create(url);
web.Method = "GET";
web.Timeout = timeout;
if (cookies != null && cookies.Count > 0)
{
web.CookieContainer = new CookieContainer();
string host = new Uri(url).Host;
foreach (System.Net.Cookie c in cookies)
{
c.Domain = host;
web.CookieContainer.Add(c);
}
}
HttpWebResponse res = (HttpWebResponse)web.GetResponse();
using (Stream s = res.GetResponseStream())
{
using (StreamReader sr = new StreamReader(s, encode))
{
ret = sr.ReadToEnd();
}
}
res.Close();
web.Abort();
}
catch (Exception ex)
{
ret = "{\"Message\":\"" + ex.Message + "\",\"IsSucceed\":false}";
LogService.WriteLog(ex, "接口调用");
}
return ret;
}
public static string Get(string url, Dictionary<string, string> data, out string errorMsg)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
errorMsg = string.Empty;
if (data != null && data.Count > 0)
{
var urlSb = new StringBuilder();
var flag = 0;
foreach (var item in data)
{
urlSb.Append(flag == 0 ? "?" : "&");
urlSb.Append($"{item.Key}={HttpUtility.UrlEncode(item.Value)}");
flag++;
}
if (url.EndsWith("/"))
{
url = url.Substring(0, url.Length - 1);
}
url += urlSb.ToString();
}
try
{
var web = (HttpWebRequest)WebRequest.Create(url);
web.Timeout = 70 * 1000;
web.Method = "GET";
web.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36";
web.Accept = "*/*";
var res = (HttpWebResponse)web.GetResponse();
using var s = res.GetResponseStream();
using var sr = new StreamReader(s, Encoding.GetEncoding("gb2312"));
return sr.ReadToEnd();
}
catch (Exception e)
{
Console.WriteLine(e);
return string.Empty;
}
}
public static string Get(string url, Dictionary<string, string> data, out string errorMsg, out string outurl)
{
outurl = "";
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
errorMsg = string.Empty;
if (data != null && data.Count > 0)
{
var urlSb = new StringBuilder();
var flag = 0;
foreach (var item in data)
{
urlSb.Append(flag == 0 ? "?" : "&");
urlSb.Append($"{item.Key}={HttpUtility.UrlEncode(item.Value)}");
flag++;
}
if (url.EndsWith("/"))
{
url = url.Substring(0, url.Length - 1);
}
url += urlSb.ToString();
outurl = url;
}
try
{
var web = (HttpWebRequest)WebRequest.Create(url);
web.Timeout = 70 * 1000;
web.Method = "GET";
web.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36";
web.Accept = "*/*";
var res = (HttpWebResponse)web.GetResponse();
using var s = res.GetResponseStream();
using var sr = new StreamReader(s, Encoding.GetEncoding("gb2312"));
return sr.ReadToEnd();
}
catch (Exception e)
{
Console.WriteLine(e);
return string.Empty;
}
}
public static string Get(string url, Dictionary<string, string> data, Encoding encode, out string errorMsg)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
errorMsg = string.Empty;
if (data != null && data.Count > 0)
{
var urlSb = new StringBuilder();
var flag = 0;
foreach (var item in data)
{
urlSb.Append(flag == 0 ? "?" : "&");
urlSb.Append($"{item.Key}={HttpUtility.UrlEncode(item.Value)}");
flag++;
}
if (url.EndsWith("/"))
{
url = url.Substring(0, url.Length - 1);
}
url += urlSb.ToString();
}
try
{
var web = (HttpWebRequest)WebRequest.Create(url);
web.Timeout = 70 * 1000;
web.Method = "GET";
web.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36";
web.Accept = "*/*";
var res = (HttpWebResponse)web.GetResponse();
using var s = res.GetResponseStream();
using var sr = new StreamReader(s, encode);
return sr.ReadToEnd();
}
catch (Exception e)
{
Console.WriteLine(e);
return string.Empty;
}
}
private static string GetResponseAsString(HttpWebResponse res, Encoding encoding)
{
try
{
if (res != null)
{
StreamReader sr = new StreamReader(res.GetResponseStream(), encoding);
return sr.ReadToEnd();
}
else
{
return "{\"Message\":\"空响应\",\"IsSucceed\":false}"; ;
}
}
catch (Exception ex)
{
return "";
}
}
}
}
Loading…
Cancel
Save