From 8ec55699d53a7004c1a013c66f9ab2e56d7ebaa1 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Fri, 25 Jun 2021 18:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=8B=A4?= =?UTF-8?q?=E5=B7=A5=E4=BF=AD=E5=AD=A6=E7=AE=A1=E7=90=86-=E5=B2=97?= =?UTF-8?q?=E4=BD=8D=E7=AE=A1=E7=90=86=EF=BC=9A=E5=AE=8C=E5=96=84=E8=A1=A8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=81=E5=88=97=E3=80=81=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E3=80=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WorkStudyPositionController.cs | 27 ++++-- .../Views/WorkStudyPosition/Form.cshtml | 30 +++++-- .../Views/WorkStudyPosition/Form.js | 1 + .../Views/WorkStudyPosition/Index.cshtml | 10 ++- .../Views/WorkStudyPosition/Index.js | 90 ++++++++++++++++--- .../Learun.Application.Web.csproj | 2 + .../DBModel/资产系统.PDM | 8 +- .../WorkStudyPosition/WorkStudyPositionBLL.cs | 24 +++++ .../WorkStudyPositionEntity.cs | 85 ++++++++++++++---- .../WorkStudyPositionIBLL.cs | 7 ++ .../WorkStudyPositionService.cs | 37 +++++--- 11 files changed, 262 insertions(+), 59 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WorkStudyPositionController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WorkStudyPositionController.cs index c5573715d..f490ac713 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WorkStudyPositionController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WorkStudyPositionController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.PersonnelManagement; using System.Web.Mvc; using System.Collections.Generic; +using System; namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { @@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -69,8 +70,9 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var WorkStudyPositionData = workStudyPositionIBLL.GetWorkStudyPositionEntity( keyValue ); - var jsonData = new { + var WorkStudyPositionData = workStudyPositionIBLL.GetWorkStudyPositionEntity(keyValue); + var jsonData = new + { WorkStudyPosition = WorkStudyPositionData, }; return Success(jsonData); @@ -102,9 +104,24 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { WorkStudyPositionEntity entity = strEntity.ToObject(); - workStudyPositionIBLL.SaveEntity(keyValue,entity); + entity.CreateUserId = LoginUserInfo.Get().userId; + entity.CreateTime = DateTime.Now; + workStudyPositionIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 发布实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoPublish(string keyValue, string status) + { + workStudyPositionIBLL.DoPublish(keyValue, status); + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.cshtml index 3b79df80f..1a5adb4c1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.cshtml @@ -3,21 +3,37 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+
岗位名称*
-
+
+
需要人数*
+ +
+
+
学期
+ +
+
+
薪资(元/月)*
+ +
+
+
是否面试*
+
+
+
岗位内容*
- +
-
+
岗位要求
- +
-
+
备注
- +
@Html.AppendJsFile("/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.js index 8c68cc18c..3f00ce42d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Form.js @@ -15,6 +15,7 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { + $('#IsInterview').lrDataItemSelect({ code: 'YesOrNoBit' }); }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.cshtml index 25b0f0f8a..341c94b92 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "岗位管理"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -23,10 +23,14 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.js index c04a5d466..0e2c1092b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WorkStudyPosition/Index.js @@ -22,12 +22,12 @@ var bootstrap = function ($, learun) { }); // 新增 $('#lr_add').on('click', function () { - learun.layerForm({ + learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/Form', - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -37,12 +37,17 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status == 1) { + learun.alert.warning("当前项已发布!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 800, + height: 600, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -53,9 +58,50 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认删除该项!', function (res) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status == 1) { + learun.alert.warning("当前项已发布!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 发布 + $('#lr_publish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status == 1) { + learun.alert.warning("当前项已发布!"); + return false; + } + learun.layerConfirm('是否确认发布该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/DoPublish', { keyValue: keyValue, status: "1" }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 取消发布 + $('#lr_cancelPublish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 1) { + learun.alert.warning("当前项未发布!"); + return false; + } + learun.layerConfirm('是否确认取消发布该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/DeleteForm', { keyValue: keyValue}, function () { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/DoPublish', { keyValue: keyValue, status: "0" }, function () { refreshGirdData(); }); } @@ -68,19 +114,35 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/WorkStudyPosition/GetPageList', headData: [ - { label: "岗位名称", name: "Name", width: 100, align: "left"}, - { label: "岗位内容", name: "Content", width: 100, align: "left"}, - { label: "岗位要求", name: "Require", width: 100, align: "left"}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { label: '岗位名称', name: 'Name', width: 100, align: "left" }, + { label: '岗位内容', name: 'Content', width: 200, align: "left" }, + { label: '岗位要求', name: 'Require', width: 200, align: "left" }, + { label: '需要人数', name: 'NeedNum', width: 100, align: "left" }, + { label: '已录用人数', name: 'EmployNum', width: 100, align: "left" }, + { label: '学期', name: 'Semester', width: 100, align: "left" }, + { label: '薪资(元/月)', name: 'Salary', width: 100, align: "left" }, + { + label: '是否面试', name: 'IsInterview', width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, + { + label: '发布状态', name: 'Status', width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == 1 ? "已发布" : "未发布"; + } + }, ], - mainId:'Id', - isPage: true + mainId: 'Id', + isPage: true, + sidx: 'CreateTime desc' }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { 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 d281c119e..055fe13b5 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 @@ -1394,6 +1394,7 @@ + @@ -7220,6 +7221,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM index beca43965..b4275b3ef 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM @@ -1,5 +1,5 @@ - + @@ -35804,11 +35804,11 @@ B9AF Salary 1624611298 edz -1624611584 +1624615891 edz 薪资(元/月) -decimal(5,2) -5 +decimal(10,2) +10 2 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionBLL.cs index 4ae810421..a8a6f302d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionBLL.cs @@ -118,6 +118,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 发布实体数据 + /// 主键 + /// + /// + public void DoPublish(string keyValue, string status) + { + try + { + workStudyPositionService.DoPublish(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionEntity.cs index f3c8335a5..ea9d63e92 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionEntity.cs @@ -13,32 +13,85 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// public class WorkStudyPositionEntity { - #region 实体成员 - /// - /// 主键 - /// + #region 实体成员 + /// + /// 主键 + /// + /// [Column("ID")] public string Id { get; set; } - /// - /// 岗位名称 - /// + /// + /// 岗位名称 + /// + /// [Column("NAME")] public string Name { get; set; } - /// - /// 岗位内容 - /// + /// + /// 岗位内容 + /// + /// [Column("CONTENT")] public string Content { get; set; } - /// - /// 岗位要求 - /// + /// + /// 岗位要求 + /// + /// [Column("REQUIRE")] public string Require { get; set; } - /// - /// 备注 - /// + /// + /// 备注 + /// + /// [Column("REMARK")] public string Remark { get; set; } + /// + /// 需要人数 + /// + /// + [Column("NEEDNUM")] + public int? NeedNum { get; set; } + /// + /// 已录用人数 + /// + /// + [Column("EMPLOYNUM")] + public int? EmployNum { get; set; } + /// + /// 学期 + /// + /// + [Column("SEMESTER")] + public string Semester { get; set; } + /// + /// 薪资(元/月) + /// + /// + [Column("SALARY")] + public decimal? Salary { get; set; } + /// + /// 是否面试 + /// + /// + [Column("ISINTERVIEW")] + public bool? IsInterview { get; set; } + /// + /// 发布状态 + /// + /// + [Column("STATUS")] + public string Status { get; set; } + /// + /// 创建用户 + /// + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + /// 创建时间 + /// + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionIBLL.cs index d679d0b30..87af13f69 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionIBLL.cs @@ -43,6 +43,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// void SaveEntity(string keyValue, WorkStudyPositionEntity entity); + + /// + /// 发布实体数据 + /// 主键 + /// + /// + void DoPublish(string keyValue, string status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionService.cs index 74a3f35e0..01e41b77b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WorkStudyPosition/WorkStudyPositionService.cs @@ -29,14 +29,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.Id, - t.Name, - t.Content, - t.Require, - t.Remark - "); + strSql.Append("SELECT t.*"); strSql.Append(" FROM WorkStudyPosition t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -47,7 +40,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); strSql.Append(" AND t.Name Like @Name "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -99,7 +92,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -147,6 +140,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 发布实体数据 + /// 主键 + /// + /// + public void DoPublish(string keyValue, string status) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update WorkStudyPosition set Status='" + status + "' where Id='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion }