From 549f4cc4e371f3b37badb1ea95f06102a60d0dc5 Mon Sep 17 00:00:00 2001 From: liujiaqiang <1448951783@qq.com> Date: Tue, 19 Dec 2023 19:24:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BE=8B=E5=B8=88=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=A2=84=E7=BA=A6=E7=8A=B6=E6=80=81=E5=8F=8A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Controllers/Common/CommonController.cs | 8 ++- .../Common/LawyerservicesController.cs | 63 ++++++++++++++++--- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/24Hour/Controllers/Common/CommonController.cs b/24Hour/Controllers/Common/CommonController.cs index 6482c0e..7f3d669 100644 --- a/24Hour/Controllers/Common/CommonController.cs +++ b/24Hour/Controllers/Common/CommonController.cs @@ -1150,7 +1150,7 @@ namespace _24Hour.Controllers.Common //获取律师服务预约记录 var Lawyerdata = await _db.Queryable() //.WhereIF(!string.IsNullOrEmpty(_userdata.department), x => /*x.receptionuser == _userdata.department &&*/ (x.operatorId == _userdata.Id || x.operatorId == null)) - .Where(q => q.IsDeleted == 0 && !string.IsNullOrEmpty(q.receptionuser) && q.state != 2 && q.state != 3 && q.unitCode == _userdata.unitCode).ToArrayAsync(); + .Where(q => q.IsDeleted == 0 && !string.IsNullOrEmpty(q.receptionuser) && q.state != 2 && q.state != 3 && q.state != 4 && q.unitCode == _userdata.unitCode).ToArrayAsync(); // .Where(q => q.IsDeleted == 0 && q.receptionuser == _userdata.department && q.state != 2 && q.state != 3).ToArrayAsync(); Lawyerdata.ToList().ForEach(q => { @@ -1487,6 +1487,12 @@ namespace _24Hour.Controllers.Common var Lawyerboldata = Lawyerbol.FirstOrDefault(); if (dto.Type == 1) { + if (Lawyerboldata.state ==4) + { + result.IsSucceed = false; + result.result = "预约已被取消"; + return result; + } if (Lawyerboldata.operatorId != null) { result.IsSucceed = false; diff --git a/24Hour/Controllers/Common/LawyerservicesController.cs b/24Hour/Controllers/Common/LawyerservicesController.cs index fbaddea..7d71e4e 100644 --- a/24Hour/Controllers/Common/LawyerservicesController.cs +++ b/24Hour/Controllers/Common/LawyerservicesController.cs @@ -257,6 +257,42 @@ namespace _24Hour.Controllers.Common _logs.WriteSysLogadd("律师服务", "删除律师服务预约", result, _db); return result; } + + /// + /// 取消律师服务预约 + /// + /// + /// + [HttpPost] + [Route("GetCancellationLawyer")] + public async Task GetCancellationLawyer(CurrencyDelete Currency) + { + try + { + _db.BeginTran(); + var Deletelist = await _db.Queryable().In(q => q.Id, Currency.id).ToListAsync(); + Deletelist.ForEach(q => + { + q.state = 4; + }); + var num = await _db.Updateable(Deletelist).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + 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 @@ -280,14 +316,22 @@ namespace _24Hour.Controllers.Common var Lawyerbol = await _db.Queryable().Where(q => q.Id == Id).ToListAsync(); if (Lawyerbol.Count() > 0) { - Lawyerbol.FirstOrDefault().receptionuser = transactors; - _db.BeginTran(); - var num = await _db.Updateable(Lawyerbol.FirstOrDefault()).UpdateColumns(it => new { it.receptionuser }).ExecuteCommandAsync(); - _db.CommitTran(); - if (num > 0) + if (Lawyerbol.FirstOrDefault().state == 4) { - result.IsSucceed = true; - result.result = "修改成功"; + result.IsSucceed = false; + result.result = "预约已被取消"; + } + else + { + Lawyerbol.FirstOrDefault().receptionuser = transactors; + _db.BeginTran(); + var num = await _db.Updateable(Lawyerbol.FirstOrDefault()).UpdateColumns(it => new { it.receptionuser }).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + result.result = "修改成功"; + } } } else @@ -327,8 +371,11 @@ namespace _24Hour.Controllers.Common var Lawyerboldata = Lawyerbol.FirstOrDefault(); if (Lawyerboldata.state != 0) { + if (Lawyerboldata.state==4) + result.result = "预约已被取消!"; + else + result.result = "数据已被其他人接收处理!"; result.IsSucceed = false; - result.result = "数据已被其他人接收处理!"; return result; } Lawyerboldata.receptiontime = starttime;