@@ -344,8 +344,18 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||||
} | } | ||||
/// <summary> | |||||
/// 同步宿舍信息数据 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public ActionResult SyncData() | |||||
{ | |||||
accommodationIBLL.SyncData(); | |||||
return Success("同步成功"); | |||||
} | |||||
//public ActionResult DormitoryAdd(string a,string ) | //public ActionResult DormitoryAdd(string a,string ) | ||||
#endregion | #endregion | ||||
@@ -67,6 +67,7 @@ | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | <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> 批量添加宿舍</a> | <a id="lr_dormitoryAdd" class="btn btn-default"><i class="fa fa-pencil-square"></i> 批量添加宿舍</a> | ||||
<a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a> | <a id="lr_allocation" class="btn btn-default"><i class="fa fa-pencil-square"></i> 自动分配宿舍</a> | ||||
<a id="lr_syncdata" class="btn btn-default"><i class="fa fa-pencil-square"></i> 同步宿舍信息</a> | |||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a> | ||||
@@ -126,6 +126,19 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
}); | }); | ||||
// 同步宿舍信息 | |||||
$('#lr_syncdata').on('click', function () { | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认同步!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/LogisticsManagement/Accommodation/SyncData', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | }, | ||||
//初始化左侧树 | //初始化左侧树 | ||||
initTree: function () { | initTree: function () { | ||||
@@ -561,6 +561,26 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
} | } | ||||
} | } | ||||
public void SyncData() | |||||
{ | |||||
try | |||||
{ | |||||
accommodationService.SyncData(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
@@ -90,6 +90,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
void Automatic_allocation_accommodation(bool noNation, bool noPlace); | void Automatic_allocation_accommodation(bool noNation, bool noPlace); | ||||
void SyncData(); | |||||
object GetDormitoryList(); | object GetDormitoryList(); | ||||
object GetUnitList(string ParentID); | object GetUnitList(string ParentID); | ||||
object GetFloorList(string parentID); | object GetFloorList(string parentID); | ||||
@@ -1321,6 +1321,32 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 同步宿舍信息 | |||||
/// </summary> | |||||
public void SyncData() | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
string sql = "select 学号,姓名,性别,公寓,单元,楼层,宿舍号,床位号 from t1 where 学号 is not null order by 公寓,单元,楼层,宿舍号,床位号"; | |||||
DataTable dt = db.FindTable(sql); | |||||
//var list = db.FindList<Acc_DormitoryBuildEntity>(); | |||||
//select * from Acc_DormitoryBuild where parentid= (select ID from Acc_DormitoryBuild where parentid=( select ID from Acc_DormitoryBuild where name='一号学生公寓')); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion 提交数据 | #endregion 提交数据 | ||||
} | } |