Sfoglia il codice sorgente

宿舍管理调整分类管理列表和新增功能

西昌缴费二期
zhangli 2 anni fa
parent
commit
71a032d16f
3 ha cambiato i file con 57 aggiunte e 13 eliminazioni
  1. +28
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
  2. +18
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
  3. +11
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 28
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs Vedi File

@@ -207,6 +207,8 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}


#endregion

#region 获取数据
@@ -244,6 +246,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
var data = accommodationIBLL.GetBedListByRoomId(RoomId).OrderBy(x => x.DNo);
return Success(data);
}
/// <summary>
/// 获取分类数据
/// <summary>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassifyList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = accommodationIBLL.GetClassifyList(paginationobj, queryJson).OrderBy(x => x.DNo);
//var jsonData = new
//{
// rows = data,
// total = paginationobj.total,
// page = paginationobj.page,
// records = paginationobj.records
//};
return Success(data);
}

/// <summary>
/// 获取宿舍楼数据
@@ -357,7 +379,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
var data = accommodationIBLL.GetClassifyTree();
return Success(data);
}

#endregion

@@ -382,7 +404,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteBed(string keyValue,string ParentID)
public ActionResult DeleteBed(string keyValue, string ParentID)
{
accommodationIBLL.DeleteBed(keyValue, ParentID);
return Success("删除成功!");
@@ -409,13 +431,13 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveBedForm(string keyValue,string ParentID, string strEntity)
public ActionResult SaveBedForm(string keyValue, string ParentID, string strEntity)
{
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>();
accommodationIBLL.SaveBedEntity(keyValue, ParentID, entity);
return Success("保存成功!");
}
/// <summary>
/// 寝室分配系
/// <param name="keyValue">主键</param>
@@ -424,7 +446,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveDeptClass(string keyValue, string strEntity,int type)
public ActionResult SaveDeptClass(string keyValue, string strEntity, int type)
{
Acc_DormitoryBuildEntity entity = strEntity.ToObject<Acc_DormitoryBuildEntity>();
accommodationIBLL.SaveDeptClass(keyValue, entity, type);
@@ -444,7 +466,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
accommodationIBLL.SaveRoom(RoomId, list);
return Success("保存成功!");
}
/// <summary>
/// 学生宿舍的单元、楼层、房间、床位添加
/// </summary>


+ 18
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js Vedi File

@@ -184,7 +184,8 @@ var bootstrap = function ($, learun) {
//批量添加宿舍
$("#lr_dormitoryAdd").on("click", function () {
var keyvalue1 = $("#gridtable").jfGridValue("ID");
if (selectedParent.ChildType == "2") {
//console.log(selectedParent.ChildType);
if (selectedParent.BuildType == "1") {
var keyValue = selectedParent.ID;
learun.layerForm({
id: 'form',
@@ -247,7 +248,7 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
if (keyValue.indexOf(',') != -1) {
learun.alert.warning("只能选择一条记录进行编辑!");
learun.alert.warning("只能选择一条记录!");
return false;
}
learun.layerForm({
@@ -264,7 +265,21 @@ var bootstrap = function ($, learun) {

});

//分类管理
$("#lr_Classify").on("click", function () {
learun.layerForm({
id: 'indexClassify',
title: '分类管理',
url: top.$.rootUrl + '/LogisticsManagement/Accommodation/IndexClassify',
width: 1200,
height: 780,
//btn:null,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
},
//初始化左侧树
initTree: function () {


+ 11
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Vedi File

@@ -298,7 +298,8 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Name Like @Name ");
}
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).ToList();
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp).ToList();
//return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(strSql.ToString(), dp, pagination).ToList();
}
catch (Exception ex)
{
@@ -719,7 +720,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
{
try
{
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(x => ( x.BuildType == "2" || x.BuildType == "1")).ToList();
return this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(x => (x.BuildType == "2" || x.BuildType == "1")).ToList();
}
catch (Exception ex)
{
@@ -1089,6 +1090,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
UpdateTime = DateTime.Now
};
elementEntity.Create();
elementEntity.UnitId = elementEntity.ID;
list.Add(elementEntity);

//添加楼层
@@ -1119,6 +1121,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
UpdateTime = DateTime.Now
};
floorEntity.Create();
floorEntity.FloorId = floorEntity.ID;
list.Add(floorEntity);

//添加房间
@@ -1514,9 +1517,11 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
else
{
entity.Create();
if (entity.BuildType == "1")
{
if (string.IsNullOrEmpty(entity.ParentID))
entity.ApartmentId = entity.ID;
if (string.IsNullOrEmpty(entity.ParentID) || entity.ParentID == "-1")
{
var rootNode = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().FirstOrDefault(a => a.ParentID == null);
if (rootNode == null)
@@ -1542,14 +1547,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
else
{
//上一级
var parentity = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>().FirstOrDefault(a => a.ID == entity.ParentID);
switch (parentity.BuildType)
{
case "1":
entity.ApartmentId = parentity.ID;
entity.UnitId = entity.ID;
break;
case "2":
{
entity.FloorId = entity.ID;
entity.UnitId = parentity.ID;
entity.ApartmentId = parentity.ApartmentId;
}
@@ -1564,7 +1572,6 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}

entity.Create();
entity.CreateBy = currentUser.realName;
entity.CreateTime = DateTime.Now;
entity.UpdateBy = currentUser.realName;


Caricamento…
Annulla
Salva