Bläddra i källkod

床位管理

西昌缴费二期
zhangli 2 år sedan
förälder
incheckning
038940d06f
8 ändrade filer med 198 tillägg och 41 borttagningar
  1. +46
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs
  2. +1
    -17
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js
  3. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml
  4. +2
    -16
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js
  5. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  6. +51
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
  7. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
  8. +89
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 46
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs Visa fil

@@ -226,6 +226,24 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
{
return View();
}
/// <summary>
/// 床位管理
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexBed()
{
return View();
}
/// <summary>
/// 床位管理
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormBed()
{
return View();
}

#endregion
@@ -397,6 +415,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
return Success("删除成功!");
}
/// <summary>
/// 删除
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteBed(string keyValue,string ParentID)
{
accommodationIBLL.DeleteBed(keyValue, ParentID);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
@@ -410,7 +440,21 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
accommodationIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
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>
@@ -439,6 +483,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
accommodationIBLL.SaveRoom(RoomId, list);
return Success("保存成功!");
}
/// <summary>
/// 学生宿舍的单元、楼层、房间、床位添加
/// </summary>
@@ -450,11 +495,6 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers
[AjaxOnly]
public ActionResult DormitoryAdd(string keyValue, string strEntity)
{
//dynamic entity = JsonConvert.DeserializeObject(strEntity);
//var ElementNum = entity.ElementNum;
//var FloorNum = entity.FloorNum;
//var RoomNum = entity.RoomNUm;
//var BedNum = entity.BedNum;
JObject jsonEntity = JObject.Parse(strEntity);

var elementNum = int.Parse(jsonEntity["ElementNum"].ToString());


+ 1
- 17
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js Visa fil

@@ -17,23 +17,7 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
//$('.Student').lrselect({
// value: "stuid",
// text: "stuname",
// url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
// param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
// select: function (item) {
// if (item) {
// console.log(item);
// $.each(arr,
// function(index, value) {
// console.log('arr_index',value);
// console.log('arr_index',value);
// });
// }

// }
//});
},
initData: function () {
if (!!keyValue) {


+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.cshtml Visa fil

@@ -66,8 +66,9 @@
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
<a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;批量添加宿舍</a>
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;自动分配宿舍</a>
@*<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;同步宿舍信息</a>*@
<a id="lr_bedManage" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;床位管理</a>
@*<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;自动分配宿舍</a>
<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i>&nbsp;同步宿舍信息</a>*@
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增宿舍</a>


+ 2
- 16
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js Visa fil

@@ -247,7 +247,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({
@@ -261,24 +261,10 @@ var bootstrap = function ($, learun) {
}
});
}

});

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


+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Visa fil

@@ -1300,6 +1300,7 @@
<Content Include="Areas\EducationalAdministration\Views\TeachPlan\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\TeachSwitch\Index.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" />
@@ -1310,6 +1311,7 @@
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\Allocation.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\DormitoryAdd.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexDistribution.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexClassify.js" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.js" />
@@ -7584,6 +7586,8 @@
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormDept.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormClass.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormRoom.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\IndexBed.cshtml" />
<Content Include="Areas\LogisticsManagement\Views\Accommodation\FormBed.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 51
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs Visa fil

@@ -583,6 +583,31 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}

/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void DeleteBed(string keyValue, string ParentID)
{
try
{
accommodationService.DeleteBed(keyValue, ParentID);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
@@ -607,6 +632,32 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity)
{
try
{
accommodationService.SaveBedEntity(keyValue, ParentID, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}


/// <summary>
/// 分配系
/// </summary>


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs Visa fil

@@ -71,6 +71,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// <summary>
/// <returns></returns>
void DeleteEntity(string keyValue);
void DeleteBed(string keyValue, string ParentID);
string GetBuildType(string parentID);
string GetParentBuildType(string keyValue);

@@ -80,6 +81,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
/// <summary>
/// <returns></returns>
void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity);
void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity);
void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type);
void SaveRoom(string RoomId, List<Acc_DormitoryBuildEntity> list);



+ 89
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Visa fil

@@ -1021,6 +1021,27 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}


public void DeleteBed(string keyValue, string ParentID)
{
try
{
this.BaseRepository("CollegeMIS").Delete<Acc_RewardEntity>(t => t.ID == keyValue);
UpdateCheckInNum(ParentID);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public void DeleteAll(string parentid)
{
var list = this.BaseRepository("CollegeMIS").FindList<Acc_DormitoryBuildEntity>(a => a.ParentID == parentid).ToList();
@@ -1579,6 +1600,74 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}


/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void SaveBedEntity(string keyValue, string ParentID, Acc_DormitoryBuildEntity entity)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
db.Update(entity);
}
else
{
var parentEntity = db.FindEntity<Acc_DormitoryBuildEntity>(ParentID);
entity.Create();
entity.ApartmentId = parentEntity.ApartmentId;
entity.UnitId = parentEntity.UnitId;
entity.FloorId = parentEntity.FloorId;
entity.ParentID = ParentID;
entity.BuildType = "5";
db.Insert(entity);
}
db.Commit();
UpdateCheckInNum(ParentID);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

private void UpdateCheckInNum(string ParentID)
{
try
{
string sql = $@"update [dbo].[Acc_DormitoryBuild] set RoomType=(
select count(1) from [dbo].[Acc_DormitoryBuild] where ParentId='{ParentID}' and BuildType='5'
)
where ID='{ParentID}'
";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type)
{
try


Laddar…
Avbryt
Spara