From 4cc3be50d6129ea4d7ed39b7f5a78da71903884b Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 7 Mar 2023 16:40:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E7=90=86=E5=92=A8=E8=AF=A2=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=9B=9E=E5=A4=8D=E6=95=99=E5=B8=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/PsychologyInfo/Form.js | 18 +++- .../Views/PsychologyInfo/Index.js | 98 ++++++++++++++----- .../PsychologyInfo/PsychologyInfoEntity.cs | 12 +++ .../PsychologyInfo/PsychologyInfoService.cs | 43 +++++++- 4 files changed, 141 insertions(+), 30 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Form.js index 8c75ceec9..5c603c91d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Form.js @@ -6,6 +6,10 @@ */ var acceptClick; var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; var bootstrap = function ($, learun) { "use strict"; var selectedRow = learun.frameTab.currentIframe().selectedRow; @@ -18,11 +22,21 @@ var bootstrap = function ($, learun) { $('#Url').lrUploader(); }, initData: function () { - if (!!selectedRow) { - $('#form').lrSetFormData(selectedRow); + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + }); } } }; + // 设置表单数据 + setFormData = function (processId) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/PsychologyInfo/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + }); + } + } // 保存数据 acceptClick = function (callBack) { if (!$('#form').lrValidform()) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Index.js index d9d4e0728..1ed6086e1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/PsychologyInfo/Index.js @@ -125,50 +125,90 @@ var bootstrap = function ($, learun) { headData: [ { label: '学生学号', name: 'StuNo', width: 120, align: "left" }, { label: '咨询内容', name: 'Concent', width: 300, align: "left" }, - { label: '附件', name: 'Url', width: 300, align: "left" }, { - label: '状态', name: 'State', width: 100, align: "left", + label: '附件', name: 'Url', width: 300, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + $.ajax({ + url: '/LR_SystemModule/Annexes/GetAnnexesFileList', + data: { folderId: value }, + type: 'GET', + dataType: "json", + async: false, + cache: false, + success: function (res) { + var bb = ''; + //$.each(res.data, function (i, item) { + // bb += item.F_FileName.substring(0, item.F_FileName.indexOf(".")) + ',' + //}) + //bb + $.each(res.data, function (i, item) { + bb += '' + + item.F_FileName.substring(0, item.F_FileName.indexOf(".")) + + ',   '; + }) + callback(bb); + } + }); + } + }, + { + label: '状态', name: 'State', width: 80, align: "left", formatter: function (cellvalue, row) { - if (cellvalue == 1) { - return "已提交"; - } else if (cellvalue == 0) { + if (cellvalue == 0) { return "草稿"; + } else if (cellvalue == 7) { + return "已回复"; } else { - return "已回复"; - } + return "待回复"; + } } }, { - label: '提交日期', name: 'CreateTime', width: 160, align: "left", + label: '提交日期', name: 'CreateTime', width: 130, align: "left", formatter: function (cellvalue) { - return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss'); } }, { - label: '回复教师', name: 'ReplyUserId', width: 200, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', - key: value, - keyId: 'f_userid', - callback: function (_data) { - callback(_data['f_realname']); - } - }); - } + label: '回复教师', name: 'F_RealName', width: 100, align: "left", }, { label: '回复内容', name: 'ReplyContent', width: 300, align: "left" }, { - label: '回复时间', name: 'ReplyTime', width: 160, align: "left", + label: '回复时间', name: 'ReplyTime', width: 130, align: "left", formatter: function (cellvalue) { - return learun.formatDate(cellvalue, 'yyyy-MM-dd ss:mm'); + return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss'); + } + }, + { + label: '回复附件', name: 'Urls', width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + $.ajax({ + url: '/LR_SystemModule/Annexes/GetAnnexesFileList', + data: { folderId: value }, + type: 'GET', + dataType: "json", + async: false, + cache: false, + success: function (res) { + var bb = ''; + $.each(res.data, function (i, item) { + bb += '' + + item.F_FileName.substring(0, item.F_FileName.indexOf(".")) + + ',   '; + }) + callback(bb); + } + }); } }, - { label: '回复附件', name: 'Urls', width: 200, align: "left" }, ], mainId: 'Id', isPage: true, - sidx: 'CreateTime desc ', + sidx: 'State asc,CreateTime desc', }); page.search(); }, @@ -177,7 +217,6 @@ var bootstrap = function ($, learun) { param.StartTime = logbegin; param.EndTime = logend; param.StuNo = learun.clientdata.get(['userinfo']).account; - //param.StuNo = '202201030207'; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; @@ -186,3 +225,12 @@ var bootstrap = function ($, learun) { }; page.init(); } +function downLoad(fileId, fileTwo) { + if (fileTwo) { + + top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () { + + }); + } + top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' }); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoEntity.cs index d8b7c72f6..94126fff1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoEntity.cs @@ -72,6 +72,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration this.CreateTime = DateTime.Now; } #endregion + [NotMapped] + public string F_RealName { get; set; } + [NotMapped] + public string ReplyContent { get; set; } + [NotMapped] + public string Urls { get; set; } + [NotMapped] + public DateTime? ReplyTime { get; set; } + [NotMapped] + public string ReplyUser { get; set; } + + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoService.cs index a6454f7c8..bdb7378d6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/PsychologyInfo/PsychologyInfoService.cs @@ -66,11 +66,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { + var db = this.BaseRepository().getDbConnection().Database; var strSql = new StringBuilder(); - strSql.Append(" SELECT t.*,p.ReplyContent,p.Url as Urls,p.ReplyUser,p.ReplyTime,s.StuName,s.deptNo,s.majorno,s.classno,s.GenderNo,s.IdentityCardNo,s.IsSingle FROM PsychologyInfo t "); - strSql.Append(" left join PsychologyReplyInfo p on p.PsychologyInfoid = t.id "); + strSql.Append(" SELECT t.*,l.F_RealName,p.ReplyContent,p.Url as Urls,p.ReplyUser,p.ReplyTime,s.StuName,s.deptNo,s.majorno,s.classno,s.GenderNo,s.IdentityCardNo,s.IsSingle FROM PsychologyInfo t "); + strSql.Append(" left join PsychologyReplyInfo p on p.PsychologyInfoid = t.id AND p.State = t.State "); strSql.Append(" left join StuInfoBasic s on s.StuNo = t.StuNo "); - strSql.Append(" where 1=1"); + strSql.Append($" left join {db}.dbo.LR_Base_User l on l.F_account =p.ReplyUser "); + strSql.Append(" where 1=1 "); var queryParam = queryJson.ToJObject(); var dp = new DynamicParameters(new { }); if (!queryParam["StuNo"].IsEmpty()) @@ -78,6 +80,41 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); strSql.Append(" AND t.StuNo = @StuNo "); } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", queryParam["StuName"].ToString(), DbType.String); + strSql.Append(" AND s.StuName = @StuName "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND s.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND s.MajorNo = @MajorNo "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND s.ClassNo = @ClassNo "); + } + if (!queryParam["IdentityCardNo"].IsEmpty()) + { + dp.Add("IdentityCardNo", "%" + queryParam["IdentityCardNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.IdentityCardNo like @IdentityCardNo "); + } + if (!queryParam["ReplyContent"].IsEmpty()) + { + dp.Add("ReplyContent", "%" + queryParam["ReplyContent"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ReplyContent like @ReplyContent "); + } + if (!queryParam["RealName"].IsEmpty()) + { + dp.Add("RealName", "%" + queryParam["RealName"].ToString() + "%", DbType.String); + strSql.Append(" AND l.F_RealName like @RealName "); + } if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) { dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime);