|
|
|
|
@ -364,6 +364,80 @@ namespace _24Hour.Controllers.Common
|
|
|
|
|
_logs.WriteSysLogadd("所有预约信息", "通过Id查询预约信息", result, _db); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 统计预约申请 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
[HttpGet] |
|
|
|
|
[Route("CountReservationInfo")] |
|
|
|
|
public async Task<Result> CountReservationInfo() |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
var lawyerdata = await _db.Queryable<App_LawyerServicesModel>() |
|
|
|
|
.Where(x => x.state == 1) |
|
|
|
|
.Where(x => x.IsDeleted == 0) |
|
|
|
|
.Where(x => x.createuserId == _userdata.Id) |
|
|
|
|
.CountAsync(); |
|
|
|
|
result.result = new |
|
|
|
|
{ |
|
|
|
|
CountApprovedReservation = lawyerdata, |
|
|
|
|
}; |
|
|
|
|
result.IsSucceed = true; |
|
|
|
|
} |
|
|
|
|
catch (Exception) |
|
|
|
|
{ |
|
|
|
|
result.IsSucceed = false; |
|
|
|
|
throw; |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 修改预约申请状态 |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="id"></param> |
|
|
|
|
/// <param name="type">律师预约申请=>lawyer</param> |
|
|
|
|
/// <param name="state"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
[HttpGet] |
|
|
|
|
[Route("ChangeReservationState")] |
|
|
|
|
public async Task<Result> ChangeReservationState(string id, string type, int state) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
result.IsSucceed = false; |
|
|
|
|
result.Message = "修改失败"; |
|
|
|
|
if (type == "lawyer") |
|
|
|
|
{ |
|
|
|
|
var data = await _db.Queryable<App_LawyerServicesModel>().FirstAsync(x => x.Id == id); |
|
|
|
|
if (data != null) |
|
|
|
|
{ |
|
|
|
|
data.state = state; |
|
|
|
|
_db.BeginTran(); |
|
|
|
|
var num = await _db.Updateable(data) |
|
|
|
|
.UpdateColumns(x => x.state) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
_db.CommitTran(); |
|
|
|
|
if (num > 0) |
|
|
|
|
{ |
|
|
|
|
result.IsSucceed = true; |
|
|
|
|
result.result = "修改成功"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
result.IsSucceed = true; |
|
|
|
|
result.result = "不支持的修改类型"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
_logger.LogInformation(ex.Message); |
|
|
|
|
result.IsSucceed = false; |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// app---根据当前登录人获取所有预约信息--type类型为:0律师服务,1远程会见,2远程接待 |
|
|
|
|
@ -2664,7 +2738,7 @@ namespace _24Hour.Controllers.Common
|
|
|
|
|
public async Task<ActionResult> Upload_Files1(IFormFile file) |
|
|
|
|
{ |
|
|
|
|
Result outParm = new Result(); |
|
|
|
|
return await Task.Run(() => |
|
|
|
|
return await Task.Run(async () => |
|
|
|
|
{ |
|
|
|
|
if (file.Length <= 0) |
|
|
|
|
{ |
|
|
|
|
@ -2678,10 +2752,9 @@ namespace _24Hour.Controllers.Common
|
|
|
|
|
IFormFile file = Request.Form.Files.FirstOrDefault(); |
|
|
|
|
var fname = $@"{file.FileName}"; |
|
|
|
|
var hzname = $"{Path.GetExtension(fname)}"; |
|
|
|
|
var _path = $"/CaseFile/card/{DateTime.Now.ToString("yyyy-MM-dd")}"; |
|
|
|
|
var dic = Path.Combine(Environment.CurrentDirectory, "wwwroot"); |
|
|
|
|
if (!string.IsNullOrEmpty(_path)) |
|
|
|
|
dic += _path; |
|
|
|
|
var _path = Path.Combine("CaseFile", "card", DateTime.Now.ToString("yyyy-MM-dd")); |
|
|
|
|
var dic = Path.Combine(Environment.CurrentDirectory, "wwwroot", _path); |
|
|
|
|
|
|
|
|
|
if (!System.IO.Directory.Exists(dic)) |
|
|
|
|
Directory.CreateDirectory(dic); |
|
|
|
|
var filename = $"{DateTime.Now:yyyyMMddHHmmssfff}{Path.GetExtension(fname)}"; |
|
|
|
|
@ -2689,11 +2762,20 @@ namespace _24Hour.Controllers.Common
|
|
|
|
|
var path = Path.Combine(dic, $"{filename}"); |
|
|
|
|
using (var stream = new FileStream(path, FileMode.OpenOrCreate)) |
|
|
|
|
{ |
|
|
|
|
file.CopyToAsync(stream).Wait(); |
|
|
|
|
await file.CopyToAsync(stream); |
|
|
|
|
} |
|
|
|
|
var __path = $"{_path}/{filename}"; |
|
|
|
|
// var __path = $"{_path}/{filename}"; |
|
|
|
|
var __path = Path.Combine(_path, filename); |
|
|
|
|
outParm.IsSucceed = true; |
|
|
|
|
outParm.result = new { hzname = hzname, url = __path, tile = Path.GetFileNameWithoutExtension(file.FileName), size, DataPath = path, filePath = dic }; |
|
|
|
|
outParm.result = new |
|
|
|
|
{ |
|
|
|
|
hzname = hzname, |
|
|
|
|
url = __path, |
|
|
|
|
tile = Path.GetFileNameWithoutExtension(file.FileName), |
|
|
|
|
size, |
|
|
|
|
DataPath = path, |
|
|
|
|
filePath = dic |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
catch (Exception e) |
|
|
|
|
{ |
|
|
|
|
|