From 2a59a1ce0cec2850ea8e5dfd68cc48b30a8ae937 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 6 Apr 2023 11:21:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E7=90=86=E5=92=A8=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MessageRindController.cs | 21 +- .../PsychologyReplyInfoController.cs | 31 ++ .../Views/MessageRind/UnreadIndex.cshtml | 2 +- .../PsychologyReplyInfo/IndexReply.cshtml | 70 +++++ .../Views/PsychologyReplyInfo/IndexReply.js | 264 ++++++++++++++++++ .../Learun.Application.Web.csproj | 6 + .../PsychologyReplyInfoBLL.cs | 26 ++ .../PsychologyReplyInfoIBLL.cs | 1 + .../PsychologyReplyInfoService.cs | 131 +++++++-- 9 files changed, 521 insertions(+), 31 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs index e1fea6c7c..05e26372a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/MessageRindController.cs @@ -5,6 +5,7 @@ using System.Web.Mvc; using System.Collections.Generic; using System.Collections; using System; +using System.Linq; namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { @@ -102,12 +103,12 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { var data = messageRindIBLL.GetListForUnread(); //心理咨询数据 - var PsychologyReplyData = psychologyReplyInfoIBLL.GetListForUnread(); + var PsychologyReplyData = psychologyReplyInfoIBLL.GetListForUnread().OrderBy(x => x.IsReply).OrderBy(x => x.CreateTime); List list = new List(); foreach (var item in PsychologyReplyData) { var url = "/LR_Desktop/PsychologyReplyInfo/Index"; - + var title = "心理咨询"; //跳转地址 if (item.Description == "学生") { @@ -115,29 +116,41 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers } else { + if (item.State == 2) + { + title = "心理回复-辅导员"; + } if (item.State == 3) { + title = "心理回复-分院"; url = "/LR_Desktop/PsychologyReplyInfo/Index3"; } else if (item.State == 4) { + title = "心理回复-学工"; url = "/LR_Desktop/PsychologyReplyInfo/Index4"; } else if (item.State == 5) { + title = "心理回复-总站"; url = "/LR_Desktop/PsychologyReplyInfo/IndexFive"; } else if (item.State == 6) { + title = "心理回复-老师"; url = "/LR_Desktop/PsychologyReplyInfo/IndexSix"; } + if (item.IsReply == 0) + url = "/LR_Desktop/PsychologyReplyInfo/IndexReply"; + else + title = "心理咨询"; } Hashtable ht = new Hashtable(); ht["MessageId"] = item.Id; ht["SenderName"] = ""; - ht["TheTitle"] = "心理咨询"; + ht["TheTitle"] = title; ht["TheContent"] = item.Concent; - ht["ConnectionUrl"] = url + "?keyvalue="; + ht["ConnectionUrl"] = url + "?type=" + item.State + "&keyvalue="; ht["InstanceId"] = item.Id; ht["isReply"] = item.IsReply; list.Add(ht); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/PsychologyReplyInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/PsychologyReplyInfoController.cs index e6fa23810..9728aee3d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/PsychologyReplyInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/PsychologyReplyInfoController.cs @@ -136,6 +136,15 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { return View(); } + /// + /// 回复列表 + /// + /// + [HttpGet] + public ActionResult IndexReply() + { + return View(); + } #endregion @@ -204,6 +213,28 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForReply(string pagination, string queryJson, int type) + { + Pagination paginationobj = pagination.ToObject(); + var data = psychologyReplyInfoIBLL.GetPageListForReply(paginationobj, queryJson, type); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } /// /// 获取表单数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml index 3cbd2a486..8482a76c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/UnreadIndex.cshtml @@ -77,7 +77,7 @@ } var param = data[i]["TheTitle"] + "、" + data[i]["InstanceId"] + "、" + data[i]["MessageId"] + "、" + data[i]["ConnectionUrl"]; content += "
  • "; - if (data[i]["TheTitle"].indexOf('心理咨询') != -1) { + if (data[i]["TheTitle"].indexOf('心理咨询') != -1 || data[i]["TheTitle"].indexOf('心理回复') != -1) { if (data[i]["isReply"] == 1) { //已回复绿色显示 content += ""; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.cshtml new file mode 100644 index 000000000..187b61b68 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.cshtml @@ -0,0 +1,70 @@ +@{ + ViewBag.Title = "心理咨询回复(班级辅导员)"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    学号
    + +
    +
    +
    姓名
    + +
    +
    +
    系部
    +
    +
    +
    +
    专业
    +
    +
    +
    +
    班级
    +
    +
    +
    +
    身份证号
    + +
    +
    +
    回复人
    +
    +
    +
    +
    回复内容
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +@Html.AppendJsFile("/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.js new file mode 100644 index 000000000..eea2beb9c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/PsychologyReplyInfo/IndexReply.js @@ -0,0 +1,264 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-03-06 12:21 + * 描 述:心理咨询回复(班级辅导员) + */ +var refreshGirdData; +var type = request('type'); +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + $('#ReplyUser').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_account', text: 'f_realname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/Form', + width: 800, + height: 750, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 查看 + $('#lr_view').on('click', function () { + var PsychologyInfoId = $('#gridtable').jfGridValue('PsychologyInfoId'); + var url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormView?PsychologyInfoId=' + PsychologyInfoId + '&type=' + type; + if (type == 5) + url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormFiveView?PsychologyInfoId=' + PsychologyInfoId + '&type=' + type; + + if (learun.checkrow(PsychologyInfoId)) { + learun.layerForm({ + id: 'formview_PsychologyInfo', + title: '查看', + url: url, + width: 800, + height: 750, + btn: null, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + //主表Id + var PsychologyInfoId = $('#gridtable').jfGridValue('PsychologyInfoId'); + var State = $('#gridtable').jfGridValue('State'); + + if (State == 7) { + learun.alert.warning('该记录已归档!'); + return false; + } + if (State != type) { + learun.alert.warning('当前由其他老师审核!'); + return false; + } + var url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/Form?keyValue=' + keyValue + '&type=' + State; + if (type == 5) + url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormFive?keyValue=' + keyValue + '&type=' + State; + if (type == 6) + url = top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/FormSix?keyValue=' + keyValue + '&type=' + State; + + if (learun.checkrow(PsychologyInfoId)) { + learun.layerForm({ + id: 'form', + title: '回复', + url: url , + width: 800, + height: 700, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + + + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LR_Desktop/PsychologyReplyInfo/GetPageListForReply', + headData: [ + { + label: "状态", name: "State", width: 100, align: "left", + formatter: function (cellvalue) { + if (cellvalue == type) { + return "待回复"; + } else if (cellvalue == 7) { + return "已归档"; + //return "未发布"; + } else { + return "其他老师审核"; + } + } + }, + { label: "咨询内容", name: "Concent", width: 100, align: "left" }, + { label: "学号", name: "StuNo", width: 100, align: "left" }, + { label: "学生姓名", name: "StuName", width: 100, align: "left" }, + { label: "提交日期", name: "SubmitTime", width: 150, align: "left" }, + { + label: "系", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" }, + { + label: "是否单亲", name: "IsSingle", width: 100, align: "left", + formatter: function (value, row) { + if (value == true) { + return '是'; + } + else if (value == false) { + return '否'; + } + } + }, + { + label: "最终回复人", name: "ReplyUser", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + + { label: "回复内容", name: "ReplyContent", width: 100, align: "left" }, + { + label: "回复日期", name: "ReplyTime", width: 150, align: "left", + formatter: function (cellvalue) { + if (cellvalue != '1900-01-01 00:00:00') { + return cellvalue; + } + } + }, + ], + mainId: 'Id', + isPage: true, + sidx: 'SubmitTime', + sord: 'ASC' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + if (type == 2) { + param.SqlParameter = " and ClassTutorNo='" + learun.clientdata.get(['userinfo']).account + "'"; + } + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param), type: type }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index d542eca60..d85172df2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1520,6 +1520,7 @@ + @@ -8122,6 +8123,7 @@ + @@ -8253,7 +8255,11 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoBLL.cs index 1d8a862da..35bbab5ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoBLL.cs @@ -68,6 +68,32 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageListForReply(Pagination pagination, string queryJson, int type) + { + try + { + return psychologyReplyInfoService.GetPageListForReply(pagination, queryJson, type); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public List GetListForUnread() { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoIBLL.cs index 999b25da7..879188edf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoIBLL.cs @@ -23,6 +23,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// IEnumerable GetPageList(Pagination pagination, string queryJson, int type); IEnumerable GetPageList2(Pagination pagination, string queryJson, int type); + IEnumerable GetPageListForReply(Pagination pagination, string queryJson, int type); List GetListForUnread(); /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoService.cs index 0357c813d..cb6638d1a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/PsychologyReplyInfo/PsychologyReplyInfoService.cs @@ -118,41 +118,120 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { + //当前登陆人 + var account = LoginUserInfo.Get().account; var strSql = new StringBuilder(); - //已归档 union 流程走到此步的数据 union 此步已上报但未归档的 - strSql.Append($@" SELECT distinct -StuNo,StuName, SubmitTime,DeptNo,MajorNo,ClassNo,IdentityCardNo,IsSingle,Concent,Id,Appointor -,ReplyUser,ReplyContent,ReplyTime,[state], PsychologyInfoId -from ( -SELECT distinct -s.StuNo,s.StuName,info.createtime as SubmitTime,s.DeptNo,s.MajorNo,s.ClassNo,s.IdentityCardNo,s.IsSingle,info.Concent,'' as Id, -'' as Appointor + strSql.Append("SELECT distinct StuNo,StuName, SubmitTime,DeptNo,MajorNo,ClassNo,IdentityCardNo,IsSingle,Concent,Id,Appointor,ReplyUser,ReplyContent,ReplyTime,[state], PsychologyInfoId from ("); + strSql.Append($@" SELECT distinct +s.StuNo,s.StuName,info.createtime as SubmitTime,s.DeptNo,s.MajorNo,s.ClassNo,s.IdentityCardNo,s.IsSingle,info.Concent,a.Id,case when len(a.Appointor)>0 then a.Appointor else t.Appointor end as Appointor ,t.ReplyUser,t.ReplyContent,t.ReplyTime,info.[state],info.id as PsychologyInfoId FROM PsychologyInfo info join StuInfoBasic s on info.StuNo=s.StuNo - join (select * from PsychologyReplyInfo where ReplyType=2 )t on t.PsychologyInfoid=info.id -union -SELECT distinct -s.StuNo,s.StuName,info.createtime as SubmitTime,s.DeptNo,s.MajorNo,s.ClassNo,s.IdentityCardNo,s.IsSingle,info.Concent,a.Id,a.Appointor -,'' as ReplyUser,'' as ReplyContent,NULL as ReplyTime,info.[state],info.id as PsychologyInfoId FROM PsychologyInfo info + left join (select * from PsychologyReplyInfo where [state]={type} and PsychologyInfoId in (select PsychologyInfoId from PsychologyReplyInfo group by PsychologyInfoId having MAX([state])={type})) a on a.PsychologyInfoid=info.id + left join (select * from PsychologyReplyInfo where ReplyType=2 )t on t.PsychologyInfoid=info.id + WHERE 1=1 and info.[state]>=2 and info.id in (select distinct PsychologyInfoId from PsychologyReplyInfo a where a.[state]>={type} and a.[state]<7 ) +"); + strSql.Append(") t where 1=1"); + if (type == 6) + { + //最后一步心理老师审核,只查看需要自己回复的 + strSql.Append($" and t.Appointor='{account}'"); + } + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuNo like @StuNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassNo = @ClassNo "); + } + if (!queryParam["IdentityCardNo"].IsEmpty()) + { + dp.Add("IdentityCardNo", "%" + queryParam["IdentityCardNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.IdentityCardNo Like @IdentityCardNo "); + } + if (!queryParam["ReplyUser"].IsEmpty()) + { + dp.Add("ReplyUser", queryParam["ReplyUser"].ToString(), DbType.String); + strSql.Append(" AND t.ReplyUser = @ReplyUser "); + } + if (!queryParam["ReplyContent"].IsEmpty()) + { + dp.Add("ReplyContent", "%" + queryParam["ReplyContent"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ReplyContent Like @ReplyContent "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + strSql.Append($" AND t.SubmitTime>='{queryParam["StartTime"].ToString()}' and t.SubmitTime<='{queryParam["EndTime"].ToString()}' "); + } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + if (type == 3) + { + //分院辅导站负责人 + var deptno = this.BaseRepository("CollegeMIS").FindEntity(x => x.EmpNo == account)?.DeptNo; + strSql.Append($" and t.deptno='{deptno}'"); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetPageListForReply(Pagination pagination, string queryJson, int type) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT distinct ClassTutorNo,StuNo,StuName, SubmitTime,DeptNo,MajorNo,ClassNo,IdentityCardNo,IsSingle,Concent,Id,Appointor,ReplyUser,ReplyContent,ReplyTime,[state], PsychologyInfoId from ("); + strSql.Append($@" SELECT distinct class.ClassTutorNo, +s.StuNo,s.StuName,info.createtime as SubmitTime,s.DeptNo,s.MajorNo,s.ClassNo,s.IdentityCardNo,s.IsSingle,info.Concent,a.Id,case when len(a.Appointor)>0 then a.Appointor else null end as Appointor +,'' as ReplyUser,'' as ReplyContent,a.ReplyTime,info.[state],info.id as PsychologyInfoId FROM PsychologyInfo info join StuInfoBasic s on info.StuNo=s.StuNo - join (select * from PsychologyReplyInfo where [state]={type} and PsychologyInfoId in (select PsychologyInfoId from PsychologyReplyInfo group by PsychologyInfoId having MAX([state])={type})) a on a.PsychologyInfoid=info.id - WHERE 1=1 and info.[state]>=2 and info.[state]<7 - "); + left join classinfo class on class.classno=s.classno + left join (select * from PsychologyReplyInfo where [state]={type} and PsychologyInfoId in (select PsychologyInfoId from PsychologyReplyInfo group by PsychologyInfoId having MAX([state])={type})) a on a.PsychologyInfoid=info.id + -- left join (select * from PsychologyReplyInfo where ReplyType=2 )t on t.PsychologyInfoid=info.id + WHERE 1=1 and info.[state]={type} and info.id in (select distinct PsychologyInfoId from PsychologyReplyInfo a where a.[state]>={type} and a.[state]<7 ) +"); + strSql.Append(") t where 1=1"); if (type == 6) { //当前登陆人 var account = LoginUserInfo.Get().account; //最后一步心理老师审核,只查看需要自己回复的 - strSql.Append($" and a.Appointor='{account}'"); + strSql.Append($" and t.Appointor='{account}'"); } - strSql.Append($@"union - SELECT distinct -s.StuNo,s.StuName,info.createtime as SubmitTime,s.DeptNo,s.MajorNo,s.ClassNo,s.IdentityCardNo,s.IsSingle,info.Concent,'' as Id,case when len(a.Appointor)>0 then a.Appointor else null end as Appointor -,'' as ReplyUser,'' as ReplyContent,'' as ReplyTime,info.[state],info.id as PsychologyInfoId FROM PsychologyInfo info - join StuInfoBasic s on info.StuNo=s.StuNo - join PsychologyReplyInfo a on a.PsychologyInfoid=info.id and a.[state]>{type} - WHERE 1=1 and info.[state]>=2 and info.[state]<7 - ) t where 1=1 "); + var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -713,7 +792,7 @@ join empinfo a on u.f_account=a.empno ,'{userInfo.account}')"); } - } + } if (psychologyInfo.State >= 5) { //学工处心理老师