From c5563200097fec197680b17a0f0f13691d2979ad Mon Sep 17 00:00:00 2001 From: liujiaqiang <1448951783@qq.com> Date: Wed, 28 Jun 2023 13:38:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E7=BD=AA=E8=AE=A4=E7=BD=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=A1=A8=E5=8F=8A=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E6=88=91=E7=9A=84=E5=BE=85=E5=8A=9E=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E4=B8=BB=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 24Hour/Controllers/Common/CommonController.cs | 251 ++++++++++++++++-- .../Common/ConfessionController.cs | 247 +++++++++++++++++ .../Controllers/Common/DocumentController.cs | 5 + 24Hour/Controllers/Common/VideoController.cs | 1 + 24Hour/Controllers/LoginController.cs | 25 +- .../system/SystemControllerController.cs | 45 +++- .../logs/Logs/ExceptionLog/20230628/10.log | 36 +++ .../AppMode/App_CloudCabinetModel.cs | 2 +- Elight.Entity/AppMode/App_ConfessionModel.cs | 102 +++++++ .../SystemModel/App_Sys_DepartModel.cs | 2 +- .../SystemModel/App_Sys_RoleMenuModel.cs | 4 +- Elight.Logic/Job/WsJob.cs | 2 + Elight.Logic/Job/YgJob.cs | 32 +-- Elight.Logic/Model/App_ConfessionInput.cs | 68 +++++ Elight.Logic/SystemModel/App_Sys_MenuTree.cs | 79 ++++++ .../SystemModel/App_Sys_RoleMenuAdd.cs | 26 ++ 16 files changed, 874 insertions(+), 53 deletions(-) create mode 100644 24Hour/Controllers/Common/ConfessionController.cs create mode 100644 24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230628/10.log create mode 100644 Elight.Entity/AppMode/App_ConfessionModel.cs create mode 100644 Elight.Logic/Model/App_ConfessionInput.cs create mode 100644 Elight.Logic/SystemModel/App_Sys_MenuTree.cs create mode 100644 Elight.Logic/SystemModel/App_Sys_RoleMenuAdd.cs diff --git a/24Hour/Controllers/Common/CommonController.cs b/24Hour/Controllers/Common/CommonController.cs index 2651338..4678489 100644 --- a/24Hour/Controllers/Common/CommonController.cs +++ b/24Hour/Controllers/Common/CommonController.cs @@ -134,6 +134,31 @@ namespace _24Hour.Controllers.Common handleuser = q.meetwitname }); }); + + //获取认罪认罚预约记录 + var Confessiondata = await _db.Queryable() + .WhereIF(Commondata.state != null, x => x.state == Commondata.state) + .Where(q => q.IsDeleted == 0 && q.unitCode == _userdata.unitCode).ToArrayAsync(); + Confessiondata.ToList().ForEach(q => + { + var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault(); + list.Add(new + { + type = 6, + Id = q.Id, + title = da?.title, + color = da?.color, + icon = da?.icon, + matter = q.matter, + sttime = q.sttime, + ettime = "", + state = q.state, + creationtime = q.creationtime, + username = q.createusername, + handleId = q.meetwitId, + handleuser = q.meetwitname + }); + }); //获取听证预约记录 var Hearingdata = await _db.Queryable() .WhereIF(Commondata.state != null, x => x.state == Commondata.state) @@ -198,26 +223,56 @@ namespace _24Hour.Controllers.Common //获取律师服务预约记录 var list = await _db.Queryable() .Where(q => q.IsDeleted == 0 && q.Id == Id).ToListAsync(); + var unitdal = _Unitdata.Where(q => q.unitCode == list.FirstOrDefault().unitCode).FirstOrDefault(); + list.FirstOrDefault().unitCode = unitdal.unitname; result.result = list.FirstOrDefault(); break; case 1: //获取远程会见预约记录 var Remotedata = await _db.Queryable() .Where(q => q.IsDeleted == 0 && q.Id == Id).ToListAsync(); + var unitdatote = _Unitdata.Where(q => q.unitCode == Remotedata.FirstOrDefault().unitCode).FirstOrDefault(); + Remotedata.FirstOrDefault().unitCode = unitdatote.unitname; result.result = Remotedata.FirstOrDefault(); break; case 2: //获取远程接待预约记录 var Receptiondata = await _db.Queryable() .Where(q => q.IsDeleted == 0 && q.Id == Id).ToListAsync(); + var unitdatR = _Unitdata.Where(q => q.unitCode == Receptiondata.FirstOrDefault().unitCode).FirstOrDefault(); + Receptiondata.FirstOrDefault().unitCode = unitdatR.unitname; result.result = Receptiondata.FirstOrDefault(); break; case 3: //获取听证预约记录 var Hearingdata = await _db.Queryable() .Where(q => q.IsDeleted == 0 && q.Id == Id).ToListAsync(); + var unitdata = _Unitdata.Where(q => q.unitCode == Hearingdata.FirstOrDefault().unitCode).FirstOrDefault(); + Hearingdata.FirstOrDefault().unitCode = unitdata.unitname; result.result = Hearingdata.FirstOrDefault(); break; + case 4: + //获取文书签收记录 + var Documentdata = await _db.Queryable() + .Where(q => q.Id == Id).ToListAsync(); + var unitda= _Unitdata.Where(q => q.unitCode == Documentdata.FirstOrDefault().dwbm).FirstOrDefault(); + Documentdata.FirstOrDefault().dwbm = unitda.unitname; + result.result = Documentdata.FirstOrDefault(); + break; + case 5: + //获取云柜记录 + var CloudCabinetdata = await _db.Queryable() + .Where(q => q.Id == Id).ToListAsync(); + var unitdat = _Unitdata.Where(q => q.unitCode == CloudCabinetdata.FirstOrDefault().dwbm).FirstOrDefault(); + CloudCabinetdata.FirstOrDefault().dwbm = unitdat.unitname; + result.result = CloudCabinetdata.FirstOrDefault(); + break; + case 6: + //获取认罪认罚预约记录 + var Confessiondata = await _db.Queryable() + .Where(q => q.IsDeleted == 0 && q.Id == Id).ToListAsync(); + result.result = Confessiondata.FirstOrDefault(); + break; } result.IsSucceed = true; @@ -364,6 +419,46 @@ namespace _24Hour.Controllers.Common appurl = "" }); }); + //获取认罪认罚预约记录 + var Confessiondata = await _db.Queryable() + .WhereIF(Commondata.state != null, x => x.state == Commondata.state) + .Where(q => q.IsDeleted == 0 && q.createuserId == _userdata.Id).ToArrayAsync(); + Confessiondata.ToList().ForEach(q => + { + var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault(); + var Unitdata = _Unitdata.Where(x => x.unitCode == q.unitCode).FirstOrDefault(); + list.Add(new + { + type = 6, + Id = q.Id, + daId = da?.Id, + title = da?.title, + color = da?.color, + icon = da?.icon, + Unitname = Unitdata?.unitname, + name = "", + phone = q.phone, + matter = q.matter,//事由 + objectstr = "",//访问对象(案件名称) + Code = "", + + lawyerunit = "", + location = "", + courtname = "", + casetype = "", + + state = q.state,//状态 + reason = q.reason,//原因 + sttime = q.sttime, + ettime = "", + creationtime = q.creationtime, + receptionuser = q.meetwitId, + username = q.meetwitname, + receive = q.meetwitId, + notes = q.notes, + appurl = "" + }); + }); //获取听证预约记录 var Hearingdata = await _db.Queryable() .WhereIF(Commondata.state != null, x => x.state == Commondata.state) @@ -467,6 +562,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.receptionuser, receive = q.createuserId, username = userda?.name, + yyname = q.createusername,//预约人名称 notes = q.notes }); }); @@ -504,6 +600,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.meetwitId, username = q.meetwitname, receive = q.createuserId, + yyname = q.createusername,//预约人名称 notes = q.notes, appurl = q.appurl }); @@ -542,6 +639,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.meetwitId, receive = q.createuserId, username = q.meetwitname, + yyname = q.createusername,//预约人名称 notes = q.notes, appurl = "" }); @@ -581,6 +679,7 @@ namespace _24Hour.Controllers.Common username = userda?.name,//办理人名称 receive = q.receptionuser,//办接收人 notes = q.notes, + yyname = q.createusername,//预约人名称 appurl = "" }); }); @@ -599,25 +698,26 @@ namespace _24Hour.Controllers.Common title = da?.title, color = da?.color, icon = da?.icon, - name = q.wsmc,//律师律师名称 + name = q.wsmc,//文书名称 - lawyerunit = "",//律师事务所 + lawyerunit = Unitdata?.unitname,//单位 location = "",//预约地点 phone = "",//联系方式 - matter = q.ajmc,//事由 + matter = q.ajmc,//案件名称 objectstr = "",//访问对象(案件名称) Code = "", state = q.zt,//状态 reason = "",//原因 - sttime = unixStartTime.AddMilliseconds(long.Parse(q.zhxgsj)),//预约时间 + sttime = unixStartTime.AddMilliseconds(long.Parse(q.zhxgsj)),//时间 ettime = "", - creationtime = unixStartTime.AddMilliseconds(long.Parse(q.zhxgsj)),//预约时间 + creationtime = unixStartTime.AddMilliseconds(long.Parse(q.zhxgsj)),//最新时间 receptionuser ="",//办理人Id username = "",//办理人名称 receive = "",//办接收人 notes = "", - appurl = "" + appurl = "", + yyname = "" }); }); //获取云柜记录 @@ -635,14 +735,14 @@ namespace _24Hour.Controllers.Common title = da?.title, color = da?.color, icon = da?.icon, - name = q.clsj,//材料件数 + name = q.cljs,//材料件数 lawyerunit = Unitdata?.unitname,// location = "",// phone = q.lxhm,//联系方式 - matter = q.wbkqmm,//取件码 - objectstr = q.gjkqmm,//干警取件码 + matter = !string.IsNullOrEmpty(q.gjkqmm) ? q.gjkqmm : q.wbkqmm,//取件码 + objectstr = "",//干警取件码 Code = "", state = q.zt,//状态 reason = "", @@ -653,6 +753,46 @@ namespace _24Hour.Controllers.Common username = "", receive = "", notes = "", + appurl = "", + yyname = "" + }); + }); + //获取认罪认罚预约记录 + var Confessiondata = await _db.Queryable() + .WhereIF(Commondata.state != null && Commondata.state != 0, x => x.state == Commondata.state) + .WhereIF(Commondata.state != null && Commondata.state == 0, x => x.state == Commondata.state || x.state == 1) + .Where(q => q.IsDeleted == 0 && q.meetwitId == _userdata.Id).ToArrayAsync(); + Confessiondata.ToList().ForEach(q => + { + var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault(); + list.Add(new + { + type = 6, + Id = q.Id, + title = da?.title, + color = da?.color, + icon = da?.icon, + name = "", + phone = q.phone, + matter = q.matter,//事由 + objectstr = "",//访问对象(案件名称) + + lawyerunit = "", + location = "", + courtname = "", + casetype = "", + + Code = "", + state = q.state,//状态 + reason = q.reason,//原因 + sttime = q.sttime, + ettime = "", + creationtime = q.creationtime, + receptionuser = q.meetwitId, + receive = q.createuserId, + username = q.meetwitname, + notes = q.notes, + yyname = q.createusername,//预约人名称 appurl = "" }); }); @@ -719,6 +859,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.receptionuser, receive = q.createuserId, username = userda?.name, + yyname = q.createusername,//预约人名称 notes = q.notes }); }); @@ -754,6 +895,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.meetwitId, username = q.meetwitname, receive = q.createuserId, + yyname = q.createusername,//预约人名称 notes = q.notes, appurl = q.appurl }); @@ -790,6 +932,44 @@ namespace _24Hour.Controllers.Common receptionuser = q.meetwitId, receive = q.createuserId, username = q.meetwitname, + yyname = q.createusername,//预约人名称 + notes = q.notes, + appurl = "" + }); + }); + //获取认罪认罚预约记录 + var Confessiondata = await _db.Queryable() + .Where(q => q.IsDeleted == 0 && q.meetwitId == _userdata.Id && q.state != 2 && q.state != 3).ToArrayAsync(); + Confessiondata.ToList().ForEach(q => + { + var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault(); + list.Add(new + { + type = 6, + Id = q.Id, + title = da?.title, + color = da?.color, + icon = da?.icon, + name = "", + phone = q.phone, + matter = q.matter,//事由 + objectstr = "",//访问对象(案件名称) + + lawyerunit = "", + location = "", + courtname = "", + casetype = "", + + Code = "", + state = q.state,//状态 + reason = q.reason,//原因 + sttime = q.sttime, + ettime = "", + creationtime = q.creationtime, + receptionuser = q.meetwitId, + receive = q.createuserId, + username = q.meetwitname, + yyname = q.createusername,//预约人名称 notes = q.notes, appurl = "" }); @@ -826,6 +1006,7 @@ namespace _24Hour.Controllers.Common receptionuser = q.receptionuser,//办理人Id username = userda?.name,//办理人名称 receive = q.receptionuser,//办接收人 + yyname = q.createusername,//预约人名称 notes = q.notes, appurl = "" }); @@ -863,7 +1044,8 @@ namespace _24Hour.Controllers.Common username = "",//办理人名称 receive = "",//办接收人 notes = "", - appurl = "" + appurl = "" , + yyname ="" }); }); @@ -882,14 +1064,14 @@ namespace _24Hour.Controllers.Common title = da?.title, color = da?.color, icon = da?.icon, - name = q.clsj,//材料件数 + name = q.cljs,//材料件数 lawyerunit = Unitdata?.unitname,// location = "",// phone =q.lxhm,//联系方式 - matter = q.wbkqmm,//取件码 - objectstr = q.gjkqmm,//干警取件码 + matter = !string.IsNullOrEmpty(q.gjkqmm) ? q.gjkqmm : q.wbkqmm,//取件码 + objectstr = "", Code = "", state = q.zt,//状态 reason = "", @@ -900,7 +1082,8 @@ namespace _24Hour.Controllers.Common username = "", receive = "", notes = "", - appurl = "" + appurl = "", + yyname = "" }); }); list = list.OrderByDescending(q => q.creationtime).ToList(); @@ -1102,6 +1285,34 @@ namespace _24Hour.Controllers.Common creationtime = q.creationtime }); }); + + //获取认罪认罚预约记录--判断单位,查询不同数据信息 + var Confessiondata = await _db.Queryable() + .WhereIF(Commondata.state != null, x => x.state == Commondata.state) + .WhereIF(!Commondata.unitId.NotNull(), x => x.createuserId == _userdata.Id) + .WhereIF(Commondata.unitId.NotNull(), x => x.meetwitId == _userdata.Id) + .Where(q => q.IsDeleted == 0).ToArrayAsync(); + Confessiondata.ToList().ForEach(q => + { + var da = Stagingdata.Where(x => x.Id == q.reservationId).FirstOrDefault(); + var Unitdata = _Unitdata.Where(x => x.unitCode == q.unitCode).FirstOrDefault(); + list.Add(new + { + type = 6, + Id = q.Id, + Unitname = Unitdata?.unitname, + title = da?.title, + path = da?.path, + color = da?.color, + icon = da?.icon, + matter = q.matter, + objectstr = "", + sttime = q.sttime, + ettime = "", + state = q.state, + creationtime = q.creationtime + }); + }); //获取听证预约记录 var Hearingdata = await _db.Queryable() .WhereIF(Commondata.state != null, x => x.state == Commondata.state) @@ -1149,7 +1360,8 @@ namespace _24Hour.Controllers.Common objectstr = q.ajmc, sttime = "", ettime = "", - state = q.zt + state = q.zt, + creationtime= unixStartTime.AddMilliseconds(long.Parse(q.zhxgsj)),//最新时间 }); }); @@ -1169,11 +1381,12 @@ namespace _24Hour.Controllers.Common path = da?.path, color = da?.color, icon = da?.icon, - matter = q.wbkqmm, - objectstr = q.gjkqmm, + matter = !string.IsNullOrEmpty(q.gjkqmm) ? q.gjkqmm : q.wbkqmm,//取件码 + objectstr = "", sttime = "", ettime = "", - state = q.zt + state = q.zt, + creationtime = unixStartTime.AddMilliseconds(long.Parse(q.cjsj)),//创建时间 }); }); //查询 @@ -1358,7 +1571,7 @@ namespace _24Hour.Controllers.Common IFormFile file = Request.Form.Files.FirstOrDefault(); var fname = $@"{file.FileName}"; var hzname = $"{Path.GetExtension(fname)}"; - var _path = "/CaseFile/video"; + var _path = $"/CaseFile/video/{DateTime.Now.ToString("yyyy-MM-dd")}"; var dic = Path.Combine(Environment.CurrentDirectory, "wwwroot"); if (!string.IsNullOrEmpty(_path)) dic += _path; diff --git a/24Hour/Controllers/Common/ConfessionController.cs b/24Hour/Controllers/Common/ConfessionController.cs new file mode 100644 index 0000000..c1a2bb5 --- /dev/null +++ b/24Hour/Controllers/Common/ConfessionController.cs @@ -0,0 +1,247 @@ +using Elight.Entity; +using Elight.Logic; +using Elight.Utility; +using Elight.Utility.Code; +using Elight.Utility.Extensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; + +namespace _24Hour.Controllers.Common +{ + /// + /// 认罪认罚 + /// + [Authorize] + [ApiController] + [Route("api/reception")] + public class ConfessionController : Controller + { + #region Identity + private readonly SqlSugarClient _db;//数据库 + private readonly WriteSysLog _logs;//操作日志 + App_Sys_UserModel _userdata = new App_Sys_UserModel();//当前用户 + private readonly ILogger _logger;//日志 + Result result = new Result(); + public ConfessionController(ILogger logger, SqlSugarClient db, WriteSysLog logs, User user) + { + _logger = logger; + _db = db; + _logs = logs; + _userdata = user.Userdata(); + } + + #endregion + + + #region 认罪认罚管理 + /// + /// app---认罪认罚分页查询 + /// + /// + /// + [HttpPost] + [Route("QueryConfessionapp")] + public async Task QueryConfessionapp(App_ConfessionInput Confession) + { + RefAsync totalNumber = 0;//总数据 + var Confessionlist = new List(); + //获取工作台信息 + var app_staging = await _db.Queryable().Where(w => w.IsDelete == 0).ToListAsync(); + //查询认罪认罚记录 + var list = await _db.Queryable() + .WhereIF(!string.IsNullOrEmpty(Confession.matter), q => q.matter.Contains(Confession.matter)) + .WhereIF(!string.IsNullOrEmpty(Confession.meetwitname), q => q.meetwitname.Contains(Confession.meetwitname)) + .WhereIF(Confession.state != null, q => q.state == Confession.state) + .Where(q => q.IsDeleted == 0 && q.createuserId == _userdata.Id).ToPageListAsync(Confession.PageIndex, Confession.PageSize, totalNumber); + Confession.RowsCount = totalNumber; + list.ForEach(q => + { + var data = app_staging.Where(a => a.Id == q.reservationId).FirstOrDefault(); + if (data != null) + { + q.reservationId = data.title; + Confessionlist.Add(q); + } + }); + var data = new QueryResult(Confession, Confessionlist.OrderByDescending(q => q.creationtime).ToList()); + result.IsSucceed = true; + result.result = data; + return result; + } + + + /// + /// 认罪认罚分页查询 + /// + /// + /// + [HttpPost] + [Route("QueryConfession")] + public async Task QueryConfession(App_ConfessionInput Confession) + { + RefAsync totalNumber = 0;//总数据 + var Confessionlist = new List(); + //获取工作台信息 + var app_staging = await _db.Queryable().Where(w => w.IsDelete == 0).ToListAsync(); + //查询认罪认罚记录 + var list = await _db.Queryable() + .WhereIF(!string.IsNullOrEmpty(Confession.matter), q => q.matter.Contains(Confession.matter)) + .WhereIF(!string.IsNullOrEmpty(Confession.meetwitname), q => q.meetwitname.Contains(Confession.meetwitname)) + .WhereIF(!string.IsNullOrEmpty(Confession.phone), q => q.phone.Contains(Confession.phone)) + .WhereIF(Confession.state != null, q => q.state == Confession.state) + .WhereIF(Confession.StartTime != null && Confession.EndTime != null, q => q.sttime >= Confession.StartTime && q.sttime < Confession.EndTime.Value.AddDays(1)) + .Where(q => q.IsDeleted == 0 && q.unitCode == _userdata.unitCode).ToPageListAsync(Confession.PageIndex, Confession.PageSize, totalNumber); + Confession.RowsCount = totalNumber; + list.ForEach(q => + { + var data = app_staging.Where(a => a.Id == q.reservationId).FirstOrDefault(); + if (data != null) + { + q.reservationId = data.title; + Confessionlist.Add(q); + } + }); + var data = new QueryResult(Confession, Confessionlist.OrderByDescending(q => q.creationtime).ToList()); + result.IsSucceed = true; + result.result = data; + return result; + } + /// + /// 添加认罪认罚 + /// + /// + /// + [HttpPost] + [Route("AddConfession")] + public async Task AddConfession(App_ConfessionModel Confession) + { + try + { + _db.BeginTran(); + Confession.Id = Guid.NewGuid().ToString(); + Confession.createuserId = _userdata.Id.ToString(); + Confession.createusername = _userdata.name; + var num = await _db.Insertable(Confession).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + result.result = "添加成功"; + } + } + catch (System.Exception ex) + { + _db.RollbackTran(); + result.IsSucceed = false; + result.Message = ex.Message; + } + _logs.WriteSysLogadd("认罪认罚", "添加认罪认罚信息", result, _db); + return result; + } + + /// + /// 修改认罪认罚 + /// + /// + /// + [HttpPost] + [Route("UpdateConfession")] + public async Task UpdateConfession(App_ConfessionModel Confession) + { + try + { + _db.BeginTran(); + var num = await _db.Updateable(Confession).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + result.result = "修改成功"; + } + } + catch (System.Exception ex) + { + _db.RollbackTran(); + result.IsSucceed = false; + result.Message = ex.Message; + } + _logs.WriteSysLogadd("认罪认罚", "修改认罪认罚", result, _db); + return result; + } + + /// + /// 删除认罪认罚 + /// + /// + /// + [HttpPost] + [Route("DeleteConfession")] + public async Task DeleteConfession(CurrencyDelete Currency) + { + try + { + _db.BeginTran(); + var Receptionlist = await _db.Queryable().In(q => q.Id, Currency.id).ToListAsync(); + Receptionlist.ForEach(q => + { + q.IsDeleted = 1; + }); + var num = await _db.Updateable(Receptionlist).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + result.result = "删除成功"; + } + } + catch (System.Exception ex) + { + _db.RollbackTran(); + result.IsSucceed = false; + result.Message = ex.Message; + } + _logs.WriteSysLogadd("认罪认罚", "删除认罪认罚预约", result, _db); + return result; + } + + + /// + /// 办理预约认罪认罚 + /// + /// + /// + [HttpPost] + [Route("UpdateConfession_state")] + public async Task UpdateConfession_state(Commonpage Commonpagedata) + { + try + { + var Receptionlist = await _db.Queryable().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; + }); + _db.BeginTran(); + var num = await _db.Updateable(Receptionlist).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + result.IsSucceed = true; + result.result = "办理成功"; + } + } + catch (System.Exception ex) + { + _db.RollbackTran(); + result.IsSucceed = false; + result.Message = ex.Message; + } + _logs.WriteSysLogadd("认罪认罚", "办理认罪认罚预约", result, _db); + return result; + } + #endregion + } +} diff --git a/24Hour/Controllers/Common/DocumentController.cs b/24Hour/Controllers/Common/DocumentController.cs index 819736e..011660d 100644 --- a/24Hour/Controllers/Common/DocumentController.cs +++ b/24Hour/Controllers/Common/DocumentController.cs @@ -85,6 +85,11 @@ namespace _24Hour.Controllers.Common .WhereIF(Documentdata.StartTime != null && Documentdata.EndTime != null, q => unixStartTime.AddMilliseconds(long.Parse(q.sdsj)) >= Documentdata.StartTime && unixStartTime.AddMilliseconds(long.Parse(q.sdsj)) < Documentdata.EndTime.Value.AddDays(1)) .ToPageListAsync(Documentdata.PageIndex, Documentdata.PageSize, totalNumber); Documentdata.RowsCount = totalNumber; + list.ForEach(q => { + q.djsj = unixStartTime.AddMilliseconds(long.Parse(q.djsj)).ToString("yyyy-MM-dd HH:mm"); + q.sdsj = unixStartTime.AddMilliseconds(long.Parse(q.sdsj)).ToString("yyyy-MM-dd HH:mm"); + + }); var data = new QueryResult(Documentdata, list.OrderByDescending(q => q.sdsj).ToList()); result.IsSucceed = true; result.result = data; diff --git a/24Hour/Controllers/Common/VideoController.cs b/24Hour/Controllers/Common/VideoController.cs index 69c8475..e9b3833 100644 --- a/24Hour/Controllers/Common/VideoController.cs +++ b/24Hour/Controllers/Common/VideoController.cs @@ -64,6 +64,7 @@ namespace _24Hour.Controllers.Common creationtime = q.creationtime, state = q.state, notes = q.notes, + annexurl = JsonConvert.DeserializeObject(q.annexurl), contact = q.anonymous == 0 ? "" : q.contact }); }); diff --git a/24Hour/Controllers/LoginController.cs b/24Hour/Controllers/LoginController.cs index 0ef418d..27dec79 100644 --- a/24Hour/Controllers/LoginController.cs +++ b/24Hour/Controllers/LoginController.cs @@ -1,3 +1,4 @@ +using com.sun.xml.@internal.ws.api.model; using Elight.Entity; using Elight.Logic; using Elight.Logic.SystemModel; @@ -51,7 +52,7 @@ namespace _24Hour.Controllers try { var Passmd5 = Md5.Encrypt32(login.Password).ToLower(); - var date = await _db.Queryable().Where(q => q.IsDeleted == 0&&q.usertype==0 && q.isdeactivate == 0 && q.phone == login.phone).FirstAsync(); + var date = await _db.Queryable().Where(q => q.IsDeleted == 0&&q.usertype==0 && q.isdeactivate == 0 && q.phone == login.phone&&q.Password== Passmd5).FirstAsync(); if (date != null) { if (Passmd5 != date.Password) @@ -141,7 +142,7 @@ namespace _24Hour.Controllers try { var Passmd5 = Md5.Encrypt32(login.Password).ToLower(); - var date = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.isdeactivate == 0 && q.phone == login.phone).FirstAsync(); + var date = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.isdeactivate == 0 && q.phone == login.phone && q.Password == Passmd5).FirstAsync(); if (date != null) { if (Passmd5 != date.Password) @@ -370,7 +371,7 @@ namespace _24Hour.Controllers [HttpGet] [Route("cardIdLogin")] - public async Task cardIdLogin(string cardId) + public async Task cardIdLogin(string cardId,string name) { var date = await _db.Queryable().Where(q => q.IsDeleted == 0 && q.isdeactivate == 0 && q.cardId == cardId).FirstAsync(); if (date != null) @@ -432,8 +433,22 @@ namespace _24Hour.Controllers } else { - ret.IsSucceed = false; - ret.Message = "ûδעᣡ"; + var UserModel = new App_Sys_UserModel(); + _db.BeginTran(); + UserModel.Id = Guid.NewGuid().ToString(); + UserModel.cardId = cardId; + UserModel.name = name; + UserModel.usertype = 1; + string cardIdpwa = UserModel.cardId.Substring(UserModel.cardId.Length - 6); + //Ĭ֤λ + UserModel.Password = Elight.Utility.Encrypt.Md5.Encrypt32($"{cardIdpwa}").ToLower(); + var num = await _db.Insertable(UserModel).ExecuteCommandAsync(); + _db.CommitTran(); + if (num > 0) + { + ret.IsSucceed = true; + ret.result = "ӳɹ"; + } } return ret; } diff --git a/24Hour/Controllers/system/SystemControllerController.cs b/24Hour/Controllers/system/SystemControllerController.cs index ede3975..4f58339 100644 --- a/24Hour/Controllers/system/SystemControllerController.cs +++ b/24Hour/Controllers/system/SystemControllerController.cs @@ -83,12 +83,12 @@ namespace _24Hour.Controllers.system .WhereIF(!UserModel.phone.IsNull(), q => q.phone.Contains(UserModel.phone)) .WhereIF(!UserModel.duties.IsNull(), q => q.duties.Contains(UserModel.duties)) .WhereIF(!UserModel.cardId.IsNull(), q => q.cardId.Contains(UserModel.cardId)) - .Where(q => q.IsDeleted == 0 && q.usertype == 0) + .Where(q => q.IsDeleted == 0 && q.usertype == 0&&q.unitCode==_userdata.unitCode&&q.phone!="admin") .ToPageListAsync(UserModel.PageIndex, UserModel.PageSize, totalNumber); UserModel.RowsCount = totalNumber; list.ForEach(q => { - var Unitdata = Unitlist.Where(x => x.Id == q.unitCode)?.FirstOrDefault(); + var Unitdata = Unitlist.Where(x => x.unitCode == q.unitCode)?.FirstOrDefault(); var Departdata = Departlist.Where(x => x.Id == q.department)?.FirstOrDefault(); userlist.Add(new { @@ -542,18 +542,24 @@ namespace _24Hour.Controllers.system /// [HttpPost] [Route("AddRoleMenu")] - public async Task AddRoleMenu(List RoleMenulist) + public async Task AddRoleMenu(App_Sys_RoleMenuAdd RoleMenudata) { try { + //查询角色下的菜单 + var list=await _db.Queryable().Where(q => q.roleId== RoleMenudata.Id).ToListAsync(); _db.BeginTran(); - RoleMenulist.ForEach(RoleMenudata => + //删除角色下的菜单 + await _db.Deleteable(list).ExecuteCommandAsync(); + //添加角色菜单 + RoleMenudata.RoleMenulist.ForEach(data => { - RoleMenudata.Id = Guid.NewGuid().ToString(); - RoleMenudata.userId = _userdata.Id.ToString(); - RoleMenudata.username = _userdata.name; + data.Id = Guid.NewGuid().ToString(); + data.roleId = RoleMenudata.Id; + data.userId = _userdata.Id.ToString(); + data.username = _userdata.name; }); - var num = await _db.Insertable(RoleMenulist).ExecuteCommandAsync(); + var num = await _db.Insertable(RoleMenudata.RoleMenulist).ExecuteCommandAsync(); _db.CommitTran(); if (num > 0) { @@ -878,7 +884,7 @@ namespace _24Hour.Controllers.system { var totalCount = 0; var list = await _db.Queryable() - .WhereIF(!unitId.IsNull(), q => q.unitId.Contains(unitId)) + .WhereIF(!unitId.IsNull(), q => q.unitCode.Contains(unitId)) .Where(q => q.IsDelete == 0).ToListAsync(); result.IsSucceed = true; result.result = list; @@ -898,7 +904,7 @@ namespace _24Hour.Controllers.system .WhereIF(!Departdata.departCode.IsNull(), q => q.departCode.Contains(Departdata.departCode)) .WhereIF(!Departdata.departjc.IsNull(), q => q.departjc.Contains(Departdata.departjc)) .WhereIF(!Departdata.departname.IsNull(), q => q.departname.Contains(Departdata.departname)) - .WhereIF(!Departdata.unitId.IsNull(), q => q.unitId.Contains(Departdata.unitId)) + .WhereIF(!Departdata.unitId.IsNull(), q => q.unitCode.Contains(Departdata.unitId)) .WhereIF(Departdata.StartTime != null && Departdata.EndTime != null, q => q.createtime >= Departdata.StartTime && q.createtime < Departdata.EndTime.Value.AddDays(1)) .Where(q => q.IsDelete == 0).ToPageListAsync(Departdata.PageIndex, Departdata.PageSize, totalNumber); Departdata.RowsCount = totalNumber; @@ -1041,6 +1047,25 @@ namespace _24Hour.Controllers.system result.result = list; return result; } + + /// + /// 单位树型查询 + /// + /// + /// + [HttpPost] + [Route("QueryMenuTree")] + public async Task QueryMenuTree(App_Sys_MenuInput Menudata) + { + var treelist = await _db.Queryable() + .WhereIF(!Menudata.name.IsNull(), q => q.name.Contains(Menudata.name)) + .WhereIF(!Menudata.title.IsNull(), q => q.title.Contains(Menudata.title)) + .Where(q => q.IsDelete == 0).OrderBy(q=>q.sortnum,OrderByType.Desc).ToTreeAsync(it => it.children, it => it.pid, null); + result.IsSucceed = true; + result.result = treelist; + return result; + } + /// /// 菜单分页查询 /// diff --git a/24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230628/10.log b/24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230628/10.log new file mode 100644 index 0000000..6b28e2d --- /dev/null +++ b/24Hour/wwwroot/CaseFile/logs/Logs/ExceptionLog/20230628/10.log @@ -0,0 +1,36 @@ +日志时间:2023-06-28 10:39:10 +************************Exception Start******************************** +Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常 +Exception Date:2023/6/28 10:39:10 +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-28 10:40:29 +************************Exception Start******************************** +Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常 +Exception Date:2023/6/28 10:40:29 +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-28 10:44:51 +************************Exception Start******************************** +Exception Remark:添加数据库日志信息_WriteSysLog_1 发生异常 +Exception Date:2023/6/28 10:44:51 +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************************************ + diff --git a/Elight.Entity/AppMode/App_CloudCabinetModel.cs b/Elight.Entity/AppMode/App_CloudCabinetModel.cs index b6ed910..3b0e57d 100644 --- a/Elight.Entity/AppMode/App_CloudCabinetModel.cs +++ b/Elight.Entity/AppMode/App_CloudCabinetModel.cs @@ -64,7 +64,7 @@ namespace Elight.Entity /// 材料件数 /// [DataMember] - public string? clsj { get; set; } + public string? cljs { get; set; } /// /// 备注 diff --git a/Elight.Entity/AppMode/App_ConfessionModel.cs b/Elight.Entity/AppMode/App_ConfessionModel.cs new file mode 100644 index 0000000..7b717dd --- /dev/null +++ b/Elight.Entity/AppMode/App_ConfessionModel.cs @@ -0,0 +1,102 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Elight.Entity +{ + /// + /// 认罪认罚 + /// + [Serializable] + [DataContract] + [SugarTable("app_confession")] + public class App_ConfessionModel + { + [DataMember] + [SugarColumn(IsPrimaryKey = true)] + public string? Id { get; set; } + /// + /// 单位编码 + /// + [DataMember] + public string? unitCode { get; set; } + /// + /// 预约手机号 + /// + [DataMember] + public string? phone { get; set; } + + /// + /// 预约事由 + /// + [DataMember] + public string? matter { get; set; } + + [DataMember] + public string? reason { get; set; } + + /// + /// 预约时间 + /// + [DataMember] + public DateTime? sttime { get; set; } + + /// + /// 同意受理时间 + /// + [DataMember] + public DateTime? acceptancetime { get; set; } + + /// + /// 会见人Id + /// + [DataMember] + public string? meetwitId { get; set; } + + /// + /// 会见人 + /// + [DataMember] + public string? meetwitname { get; set; } + + /// + /// 预约类型 + /// + [DataMember] + public string? reservationId { get; set; } + + /// + /// 备注 + /// + [DataMember] + public string? notes { get; set; } + + /// + /// 状态 0:待办理,1:同意,2:拒绝,3:结束 + /// + [DataMember] + public int state { get; set; } + + [DataMember] + public string? createusername { get; set; } + + [DataMember] + public string? createuserId { get; set; } + + /// + /// 创建日期 + /// + [DataMember] + public DateTime? creationtime { get; set; } = DateTime.Now; + + /// + /// 是否删除:0:未删除、1:删除 + /// + [DataMember] + public int? IsDeleted { get; set; } = 0; + } +} diff --git a/Elight.Entity/SystemModel/App_Sys_DepartModel.cs b/Elight.Entity/SystemModel/App_Sys_DepartModel.cs index ebd3e9f..10f40bf 100644 --- a/Elight.Entity/SystemModel/App_Sys_DepartModel.cs +++ b/Elight.Entity/SystemModel/App_Sys_DepartModel.cs @@ -22,7 +22,7 @@ namespace Elight.Entity /// 单位Id /// [DataMember] - public string? unitId { get; set; } + public string? unitCode { get; set; } /// /// 部门编码 diff --git a/Elight.Entity/SystemModel/App_Sys_RoleMenuModel.cs b/Elight.Entity/SystemModel/App_Sys_RoleMenuModel.cs index 3112768..15289ac 100644 --- a/Elight.Entity/SystemModel/App_Sys_RoleMenuModel.cs +++ b/Elight.Entity/SystemModel/App_Sys_RoleMenuModel.cs @@ -33,13 +33,13 @@ namespace Elight.Entity public string? menuId { get; set; } /// - /// 用户Id + /// 创建人Id /// [DataMember] public string? userId { get; set; } /// - /// 用户名称 + /// 创建人名称 /// [DataMember] public string? username { get; set; } diff --git a/Elight.Logic/Job/WsJob.cs b/Elight.Logic/Job/WsJob.cs index 82034a3..ee0457e 100644 --- a/Elight.Logic/Job/WsJob.cs +++ b/Elight.Logic/Job/WsJob.cs @@ -94,11 +94,13 @@ namespace Elight.Logic.Job { var data = Documentlist.Where(x => x.wsslbh == q.wsslbh).FirstOrDefault(); q.Id = data.Id; + q.reservationId = "0e231845-0439-11ee-ab29-0242ac110004"; }); //循环生成唯一Id nobhwslist.ForEach(q => { q.Id = Guid.NewGuid().ToString(); + q.reservationId = "0e231845-0439-11ee-ab29-0242ac110004"; }); _db.BeginTran(); await _db.Insertable(nobhwslist).ExecuteCommandAsync(); diff --git a/Elight.Logic/Job/YgJob.cs b/Elight.Logic/Job/YgJob.cs index bcabf1d..864a462 100644 --- a/Elight.Logic/Job/YgJob.cs +++ b/Elight.Logic/Job/YgJob.cs @@ -41,21 +41,21 @@ namespace Elight.Logic.Job { Console.WriteLine("定时任务执行中..."); Console.WriteLine("定时任务执行中..."); - JobDataMap datas = context.JobDetail.JobDataMap; - // 定时任务执行的代码 - Console.WriteLine("定时任务执行中..."); - var daa = new { data = "{\"token\":\"www.archives.net.cn\",\"dwbm\":\"\",\"zt\":\"\",\"sfzh\":\"\",\"xm\":\"\",\"lxhm\":\"\",\"account\":\"\",\"gjlxhm\":\"\"}" }; - var msg = ""; - var data = HttpHelper.Post("http://jhg.ahjiguang.cn:80/jhg/api/user/command/jhgwbsclapi/getjhgywlist", daa, out msg); - var Results = JsonConvert.DeserializeObject(data); - var CloudCabinetlist = JsonConvert.DeserializeObject>(Results.data); - if (CloudCabinetlist.Count() > 0) - { - await AddDocument(CloudCabinetlist); - _db.Dispose(); - } - if (!string.IsNullOrEmpty(msg)) - Console.WriteLine($"云柜错误...{msg}"); + //JobDataMap datas = context.JobDetail.JobDataMap; + //// 定时任务执行的代码 + //Console.WriteLine("定时任务执行中..."); + //var daa = new { data = "{\"token\":\"www.archives.net.cn\",\"dwbm\":\"\",\"zt\":\"\",\"sfzh\":\"\",\"xm\":\"\",\"lxhm\":\"\",\"account\":\"\",\"gjlxhm\":\"\"}" }; + //var msg = ""; + //var data = HttpHelper.Post("http://jhg.ahjiguang.cn:80/jhg/api/user/command/jhgwbsclapi/getjhgywlist", daa, out msg); + //var Results = JsonConvert.DeserializeObject(data); + //var CloudCabinetlist = JsonConvert.DeserializeObject>(Results.data); + //if (CloudCabinetlist.Count() > 0) + //{ + // await AddDocument(CloudCabinetlist); + // _db.Dispose(); + //} + //if (!string.IsNullOrEmpty(msg)) + // Console.WriteLine($"云柜错误...{msg}"); //LogService.WriteLog(msg, "文书签收"); } @@ -92,11 +92,13 @@ namespace Elight.Logic.Job { var data = CloudCabinetdatalist.Where(x => x.bh == q.bh).FirstOrDefault(); q.Id = data.Id; + q.reservationId = "0e23db19-0439-11ee-ab29-0242ac110004"; }); //循环生成唯一Id nobhyglist.ForEach(q => { q.Id = Guid.NewGuid().ToString(); + q.reservationId = "0e23db19-0439-11ee-ab29-0242ac110004"; }); _db.BeginTran(); await _db.Insertable(nobhyglist).ExecuteCommandAsync(); diff --git a/Elight.Logic/Model/App_ConfessionInput.cs b/Elight.Logic/Model/App_ConfessionInput.cs new file mode 100644 index 0000000..2bc5cde --- /dev/null +++ b/Elight.Logic/Model/App_ConfessionInput.cs @@ -0,0 +1,68 @@ +using Elight.Utility.Code; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; + +namespace Elight.Logic +{ + /// + /// 认罪认罚--分页 + /// + [DataContract] + public class App_ConfessionInput : Paging + { + [DataMember] + public string? Id { get; set; } + + /// + /// 单位Id + /// + [DataMember] + public string? unitId { get; set; } + + /// + /// 会见人手机号 + /// + [DataMember] + public string? phone { get; set; } + + /// + /// 预约事由 + /// + [DataMember] + public string? matter { get; set; } + + /// + /// 预约时间 + /// + [DataMember] + public DateTime? sttime { get; set; } + + /// + /// 会见人Id + /// + [DataMember] + public string? meetwitId { get; set; } + + /// + /// 会见人 + /// + [DataMember] + public string? meetwitname { get; set; } + + /// + /// 备注 + /// + [DataMember] + public string? notes { get; set; } + + /// + /// 状态 0:待办理,1:同意,2:拒绝,3:结束 + /// + [DataMember] + public int? state { get; set; } + } +} diff --git a/Elight.Logic/SystemModel/App_Sys_MenuTree.cs b/Elight.Logic/SystemModel/App_Sys_MenuTree.cs new file mode 100644 index 0000000..4fb301b --- /dev/null +++ b/Elight.Logic/SystemModel/App_Sys_MenuTree.cs @@ -0,0 +1,79 @@ +using Elight.Utility.Code; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace Elight.Logic.SystemModel +{ + /// + /// 菜单信息--树型查询 + /// + [DataContract] + [SugarTable("app_sys_menu")] + public class App_Sys_MenuTree + { + /// + /// 表里用户唯一标识符,自增长Id + /// + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + [DataMember] + public string? Id { get; set; } + /// + /// 父级 + /// + [DataMember] + public string? pid { get; set; } + + + /// + /// 路径 + /// + [DataMember] + public string? path { get; set; } + /// + /// 菜单名称 + /// + [DataMember] + public string? name { get; set; } + + /// + /// 页面组件路径 + /// + [DataMember] + public string? component { get; set; } + + /// + /// 直接跳转路径 + /// + [DataMember] + public string? redirect { get; set; } + + /// + /// 页面标题 + /// + [DataMember] + public string? title { get; set; } + + /// + /// 图标 + /// + [DataMember] + public string? icon { get; set; } + /// + /// 排序 + /// + [DataMember] + public int? sortnum { get; set; } + + /// + /// 是否删除 0否,1是 + /// + [DataMember] + public int? IsDelete { get; set; } + + [SqlSugar.SugarColumn(IsIgnore = true)] + public List? children { get; set; } + } +} + diff --git a/Elight.Logic/SystemModel/App_Sys_RoleMenuAdd.cs b/Elight.Logic/SystemModel/App_Sys_RoleMenuAdd.cs new file mode 100644 index 0000000..ef17308 --- /dev/null +++ b/Elight.Logic/SystemModel/App_Sys_RoleMenuAdd.cs @@ -0,0 +1,26 @@ +using Elight.Entity; +using Elight.Utility.Code; +using SqlSugar; +using System; +using System.Runtime.Serialization; + +namespace Elight.Logic.SystemModel +{ + /// + /// 角色菜单表 + /// + [Serializable] + [DataContract] + public class App_Sys_RoleMenuAdd + { + [DataMember] + public string? Id { get; set; } + + /// + /// 角色菜单集合 + /// + [DataMember] + public List? RoleMenulist { get; set; } + } +} +