';
@@ -48,19 +57,17 @@ var bootstrap = function ($, learun) {
$('#content').append(html);
$('#' + data[i].ID).lrselect({
- value: "stuno",
+ value: "stuid",
text: "stuname",
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
- param: { code: "StuInfoBasic", strWhere: strWhere },
- // 是否允许搜索
- allowSearch: true,
+ param: { code: "StuInfoBasic", strWhere: "ClassNo='" + Class + "'" },
select: function (item) {
- // console.log(item);
+ // console.log(item);
var stuid = '';
if (item) {
- stuid = item.stuno;
+ stuid = item.stuid;
- }
+ }
var id = $(this).attr('id');
//console.log('id', id);
//console.log('item',item);
@@ -78,9 +85,9 @@ var bootstrap = function ($, learun) {
//arr.push({ ID: data[i].ID, StudentID: data[i].StudentID });
}
-
-
-
+
+
+
});
}
},
@@ -93,14 +100,8 @@ var bootstrap = function ($, learun) {
//var postData = {
// strEntity: JSON.stringify($('body').lrGetFormData())
//};
- //console.log('arr', arr);
- for (var i = 0; i < arr.length - 1; i++) {
- for (var j = i + 1; j < arr.length; j++) {
- if (!!arr[i].StudentID && arr[i].StudentID === arr[j].StudentID) {
- return learun.alert.warning('学生不可重复!');
- }
- }
- }
+ //console.log('arr',arr);
+
var postData = {
list: arr
};
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
index 71a969a6d..c926eb781 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/IndexDistribution.js
@@ -290,7 +290,6 @@ var bootstrap = function ($, learun) {
//分配宿舍
$("#lr_Bed").on("click", function () {
var keyValue = $('#gridtable').jfGridValue('ID');
- var Sex = $('#gridtable').jfGridValue('Sex');
var BuildType = $('#gridtable').jfGridValue('BuildType');
var Name = $('#gridtable').jfGridValue('Name');
var Class = $('#gridtable').jfGridValue('Class');
@@ -307,7 +306,7 @@ var bootstrap = function ($, learun) {
learun.layerForm({
id: 'formRoom',
title: '分配宿舍--' + Name,
- url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class + '&Sex=' + Sex,
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/FormRoom?keyValue=' + keyValue + '&Class=' + Class,
width: 600,
height: 400,
callBack: function (id) {
@@ -339,273 +338,261 @@ var bootstrap = function ($, learun) {
if (item.text.indexOf("室") > -1) {
selectedParent.ChildType = "5";
}
- var param = {};
-
- if (item.title == '1')
- param.ApartmentId = item.value;
- else if (item.title == '2')
- param.UnitId = item.value;
- else if (item.title == '3')
- param.FloorId = item.value;
-
- //page.initGird();
- //page.search({ ParentID: item.value });
- page.search(param);
+ page.initGird();
+ page.search({ ParentID: item.value });
}
});
},
// 初始化列表
initGird: function () {
- //宿舍数据
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
- headData: [
- { label: "名称", name: "Name", width: 100, align: "left" },
- {
- label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
- },
- {
- label: "单元", name: "UnitName", width: 100, align: "left"
- },
- {
- label: "楼层", name: "FloorName", width: 100, align: "left"
- },
- //{
- // label: "学生", name: "StudentID", width: 100, align: "left",
- // formatterAsync: function (callback, value, row, op, $cell) {
-
- // learun.clientdata.getAsync('custmerData', {
- // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
- // key: value,
- // keyId: 'stuid',
- // callback: function (_data) {
- // callback(_data['stuname']);
- // }
- // });
- // }
- //},
- { label: "位置", name: "Address", width: 100, align: "left" },
- {
- label: "校区", name: "Campus", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
-
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
- key: value,
- keyId: 'f_companyid',
- callback: function (_data) {
- callback(_data['f_fullname']);
- }
- });
- }
- },
- {
- label: "系", name: "Dept", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- key: value,
- keyId: 'deptno',
- callback: function (_data) {
- callback(_data['deptname']);
- }
- });
- }
- },
- {
- label: "专业", name: "Major", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
- key: value,
- keyId: 'majorno',
- callback: function (_data) {
- callback(_data['majorname']);
- }
- });
- }
- },
- {
- label: "班级", name: "Class", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
+ $("#gridtable").empty();
+ $("#gridtable")[0].dfop = undefined;
+ if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") {
+ //宿舍数据
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
+ headData: [
+ { label: "名称", name: "Name", width: 100, align: "left" },
+ {
+ label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
+ },
+ {
+ label: "单元", name: "UnitName", width: 100, align: "left"
+ },
+ {
+ label: "楼层", name: "FloorName", width: 100, align: "left"
+ },
+ //{
+ // label: "学生", name: "StudentID", width: 100, align: "left",
+ // formatterAsync: function (callback, value, row, op, $cell) {
+
+ // learun.clientdata.getAsync('custmerData', {
+ // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
+ // key: value,
+ // keyId: 'stuid',
+ // callback: function (_data) {
+ // callback(_data['stuname']);
+ // }
+ // });
+ // }
+ //},
+ { label: "位置", name: "Address", width: 100, align: "left" },
+ {
+ label: "校区", name: "Campus", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
+ key: value,
+ keyId: 'f_companyid',
+ callback: function (_data) {
+ callback(_data['f_fullname']);
+ }
+ });
+ }
+ },
+ {
+ label: "系", name: "Dept", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
+ key: value,
+ keyId: 'deptno',
+ callback: function (_data) {
+ callback(_data['deptname']);
+ }
+ });
+ }
+ },
+ {
+ label: "专业", name: "Major", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
+ key: value,
+ keyId: 'majorno',
+ callback: function (_data) {
+ callback(_data['majorname']);
+ }
+ });
+ }
+ },
+ {
+ label: "班级", name: "Class", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
+ key: value,
+ keyId: 'classno',
+ callback: function (_data) {
+ callback(_data['classname']);
+ }
+ });
+ }
+ },
+ {
+ label: "寝室类型", name: "RoomType", width: 100, align: "left",
+ formatter: function (value, row) {
+ if (value) {
+ return value + '人寝';
+ } else {
+ return '';
}
- });
- }
- },
- {
- label: "寝室类型", name: "RoomType", width: 100, align: "left",
- formatter: function (value, row) {
- if (value) {
- return value + '人寝';
- } else {
- return '';
}
- }
- },
- { label: "入住人数", name: "CheckInStu", width: 100, align: "left" },
- {
- label: "性别", name: "Sex", width: 100, align: "left",
- formatter: function (value, row) {
- if (value == '0')
- return '女';
- else if (value == '1')
- return '男';
- else
- return '';
- }
+ },
+ { label: "入住人数", name: "CheckInStu", width: 100, align: "left" },
+ {
+ label: "性别", name: "Sex", width: 100, align: "left",
+ formatter: function (callback, value, row, op, $cell) {
+ if (value == '0')
+ return '女';
+ else if (value == '1')
+ return '男';
+ else
+ return '';
+ }
+ },
+ { label: "负责人", name: "Functionary", width: 100, align: "left" },
+ { label: "负责人电话", name: "Phone", width: 100, align: "left" },
+ { label: "备注", name: "Remark", width: 100, align: "left" },
+ ],
+ mainId: 'ID',
+ isPage: true,
+ isMultiselect: true,
+ sidx: 'CheckInStu asc,ApartmentId asc,UnitId asc ,FloorId asc ',
+ //sord: 'ASC',
+ isSubGrid: true, // 是否有子表
+ subGridExpanded: function (subContentId, rowItem) {
+ $('#' + subContentId).jfGrid({
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID,
+ headData: [
+ { label: "名称", name: "Name", width: 100, align: "left" },
+ {
+ label: "学生", name: "StudentID", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
+ key: value,
+ keyId: 'stuid',
+ callback: function (_data) {
+ callback(_data['stuname']);
+ }
+ });
+ }
+ },
+ ],
+ mainId: 'ID',
+ isPage: false,
+ //sidx: 'DNo',
+ //sord: 'ASC',
+ });
+ //var param;
+ //param = param || {};
+ //param.ParentID = rowItem.Id;
+ $('#' + subContentId).jfGridSet('reload');
},
- { label: "负责人", name: "Functionary", width: 100, align: "left" },
- { label: "负责人电话", name: "Phone", width: 100, align: "left" },
- { label: "备注", name: "Remark", width: 100, align: "left" },
- ],
- mainId: 'ID',
- isPage: true,
- isMultiselect: true,
- sidx: 'CheckInStu asc,ApartmentId asc,UnitId asc ,FloorId asc ',
- //sord: 'ASC',
- isSubGrid: true, // 是否有子表
- subGridExpanded: function (subContentId, rowItem) {
- $('#' + subContentId).jfGrid({
- url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetBedListByRoomId?RoomId=' + rowItem.ID,
- headData: [
- { label: "名称", name: "Name", width: 100, align: "left" },
- {
- label: "学生", name: "StudentID", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
- key: value,
- keyId: 'stuno',
- callback: function (_data) {
- callback(_data['stuname']);
- }
- });
- }
- },
- ],
- mainId: 'ID',
- isPage: false,
- //sidx: 'DNo',
- //sord: 'ASC',
- });
- //var param;
- //param = param || {};
- //param.ParentID = rowItem.Id;
- $('#' + subContentId).jfGridSet('reload');
- },
- subGridHeight: 250,
- });
-
-
- //$("#gridtable").empty();
- //$("#gridtable")[0].dfop = undefined;
- //if (selectedParent.BuildType == undefined || selectedParent.BuildType === "3") {
-
- //} else {
- // //lrAuthorizeJfGridLei
- // $('#gridtable').jfGrid({
- // url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
- // headData: [
- // { label: "名称", name: "Name", width: 100, align: "left" },
- // {
- // label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
- // },
- // {
- // label: "单元", name: "UnitName", width: 100, align: "left"
- // },
- // {
- // label: "楼层", name: "FloorName", width: 100, align: "left"
- // },
- // //{
- // // label: "学生", name: "StudentID", width: 100, align: "left",
- // // formatterAsync: function (callback, value, row, op, $cell) {
-
- // // learun.clientdata.getAsync('custmerData', {
- // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
- // // key: value,
- // // keyId: 'stuid',
- // // callback: function (_data) {
- // // callback(_data['stuname']);
- // // }
- // // });
- // // }
- // //},
- // { label: "位置", name: "Address", width: 100, align: "left" },
- // {
- // label: "校区", name: "Campus", width: 100, align: "left",
- // formatterAsync: function (callback, value, row, op, $cell) {
-
- // learun.clientdata.getAsync('custmerData', {
- // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
- // key: value,
- // keyId: 'f_companyid',
- // callback: function (_data) {
- // callback(_data['f_fullname']);
- // }
- // });
- // }
- // },
- // //{
- // // label: "系", name: "Dept", width: 100, align: "left",
- // // formatterAsync: function (callback, value, row, op, $cell) {
- // // learun.clientdata.getAsync('custmerData', {
- // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- // // key: value,
- // // keyId: 'deptno',
- // // callback: function (_data) {
- // // callback(_data['deptname']);
- // // }
- // // });
- // // }
- // //},
- // //{
- // // label: "专业", name: "Major", width: 100, align: "left",
- // // formatterAsync: function (callback, value, row, op, $cell) {
- // // learun.clientdata.getAsync('custmerData', {
- // // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
- // // key: value,
- // // keyId: 'id',
- // // callback: function (_data) {
- // // callback(_data['majorname']);
- // // }
- // // });
- // // }
- // //},
- // //{ label: "班级", name: "Class", width: 100, align: "left" },
- // //{
- // // label: "性别", name: "Sex", width: 100, align: "left",
- // // formatterAsync: function (callback, value, row, op, $cell) {
- // // learun.clientdata.getAsync('dataItem', {
- // // key: value,
- // // code: 'usersex',
- // // callback: function (_data) {
- // // callback(_data.text);
- // // }
- // // });
- // // }
- // //},
- // { label: "负责人", name: "Functionary", width: 100, align: "left" },
- // { label: "负责人电话", name: "Phone", width: 100, align: "left" },
- // { label: "备注", name: "Remark", width: 100, align: "left" },
- // ],
- // mainId: 'ID',
- // isPage: true,
- // //isMultiselect: true
- // //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ',
- // //sord: 'ASC',
- // });
- //}
-
+ subGridHeight: 250,
+ });
+ } else {
+ //lrAuthorizeJfGridLei
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList',
+ headData: [
+ { label: "名称", name: "Name", width: 100, align: "left" },
+ {
+ label: "宿舍楼", name: "ApartmentName", width: 100, align: "left"
+ },
+ {
+ label: "单元", name: "UnitName", width: 100, align: "left"
+ },
+ {
+ label: "楼层", name: "FloorName", width: 100, align: "left"
+ },
+ //{
+ // label: "学生", name: "StudentID", width: 100, align: "left",
+ // formatterAsync: function (callback, value, row, op, $cell) {
+
+ // learun.clientdata.getAsync('custmerData', {
+ // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
+ // key: value,
+ // keyId: 'stuid',
+ // callback: function (_data) {
+ // callback(_data['stuname']);
+ // }
+ // });
+ // }
+ //},
+ { label: "位置", name: "Address", width: 100, align: "left" },
+ {
+ label: "校区", name: "Campus", width: 100, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
+ key: value,
+ keyId: 'f_companyid',
+ callback: function (_data) {
+ callback(_data['f_fullname']);
+ }
+ });
+ }
+ },
+ //{
+ // label: "系", name: "Dept", width: 100, align: "left",
+ // formatterAsync: function (callback, value, row, op, $cell) {
+ // learun.clientdata.getAsync('custmerData', {
+ // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
+ // key: value,
+ // keyId: 'deptno',
+ // callback: function (_data) {
+ // callback(_data['deptname']);
+ // }
+ // });
+ // }
+ //},
+ //{
+ // label: "专业", name: "Major", width: 100, align: "left",
+ // formatterAsync: function (callback, value, row, op, $cell) {
+ // learun.clientdata.getAsync('custmerData', {
+ // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
+ // key: value,
+ // keyId: 'id',
+ // callback: function (_data) {
+ // callback(_data['majorname']);
+ // }
+ // });
+ // }
+ //},
+ //{ label: "班级", name: "Class", width: 100, align: "left" },
+ //{
+ // label: "性别", name: "Sex", width: 100, align: "left",
+ // formatterAsync: function (callback, value, row, op, $cell) {
+ // learun.clientdata.getAsync('dataItem', {
+ // key: value,
+ // code: 'usersex',
+ // callback: function (_data) {
+ // callback(_data.text);
+ // }
+ // });
+ // }
+ //},
+ { label: "负责人", name: "Functionary", width: 100, align: "left" },
+ { label: "负责人电话", name: "Phone", width: 100, align: "left" },
+ { label: "备注", name: "Remark", width: 100, align: "left" },
+ ],
+ mainId: 'ID',
+ isPage: true,
+ //isMultiselect: true
+ //sidx: 'ApartmentId asc,UnitId asc ,FloorId asc ',
+ //sord: 'ASC',
+ });
+ }
+ //page.search();
},
search: function (param) {
+ //console.log(param);
+
param = param || {};
- param.SqlParameter = " AND t.BuildType ='4' ";
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
index a65e09108..ea1a3d8ec 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs
@@ -85,7 +85,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
{
try
{
- return accommodationService.GetClassifyList(paginationobj, queryJson);
+ return accommodationService.GetClassifyList(paginationobj,queryJson);
}
catch (Exception ex)
{
@@ -311,61 +311,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
- public List
GetDept()
- {
- try
- {
- return accommodationService.GetSelectData("").Select(x => new Acc_DormitoryBuildEntity { Dept = x.Dept, DeptName = x.DeptName }).Distinct().ToList();
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- public List GetMajor(string strWhere)
- {
- try
- {
- return accommodationService.GetSelectData(strWhere).Select(x => new Acc_DormitoryBuildEntity { Major = x.Major, MajorName = x.MajorName }).Distinct().ToList();
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
- public List GetClass(string strWhere)
- {
- try
- {
- return accommodationService.GetSelectData(strWhere).Select(x => new Acc_DormitoryBuildEntity { Class = x.Class, ClassName = x.ClassName }).Distinct().ToList();
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowBusinessException(ex);
- }
- }
- }
-
///
/// 获取左侧树形数据
///
@@ -386,7 +331,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
showcheck = false,
checkstate = 0,
isexpand = true,
- parentId = item.ParentID == null ? "" : item.ParentID
+ parentId = item.ParentID == null ? "" : item.ParentID,
+ title = item.BuildType
};
@@ -454,6 +400,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
}
+
+
public List GetClassifyTree()
{
try
@@ -471,7 +419,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
checkstate = 0,
isexpand = false,
parentId = item.ParentID == null ? "" : item.ParentID,
- title = string.IsNullOrEmpty(item.BuildType) ? "" : (Convert.ToInt32(item.BuildType) + 1).ToString(),
+ title =string.IsNullOrEmpty(item.BuildType)?"":(Convert.ToInt32(item.BuildType)+1).ToString() ,
};
@@ -541,7 +489,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
- ///
+ ///
/// 根据父id 获取树形数据
///
///
@@ -586,11 +534,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
- public bool MatchDormitoryInfo(string stuNo, string dormitory, string unit, string floor, string room, string bed, List data)
+ public bool MatchDormitoryInfo(string stuNo,string dormitory,string unit,string floor,string room,string bed ,List data)
{
try
{
- return accommodationService.MatchDormitoryInfo(stuNo, dormitory, unit, floor, room, bed, data);
+ return accommodationService.MatchDormitoryInfo(stuNo,dormitory,unit,floor,room,bed,data);
}
catch (Exception ex)
@@ -636,31 +584,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
-
- ///
- /// 删除实体数据
- /// 主键
- ///
- ///
- 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);
- }
- }
- }
-
///
/// 保存实体数据(新增、修改)
/// 主键
@@ -685,38 +608,12 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
- ///
- /// 保存实体数据(新增、修改)
- /// 主键
- ///
- ///
- 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);
- }
- }
- }
-
-
-
///
/// 分配系
///
///
///
- public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type)
+ public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type)
{
try
{
@@ -735,11 +632,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
}
}
- public string SaveRoom(string RoomId, List list)
+ public void SaveRoom(string RoomId, List list)
{
try
{
- return accommodationService.SaveRoom(RoomId, list);
+ accommodationService.SaveRoom(RoomId, list);
}
catch (Exception ex)
{
@@ -809,26 +706,7 @@ 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
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
index 2050f1292..84cee539c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs
@@ -44,9 +44,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
List GetList();
- List GetDept();
- List GetMajor(string strWhere);
- List GetClass(string strWhere);
///
/// 获取左侧树形数据
///
@@ -74,7 +71,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
void DeleteEntity(string keyValue);
- void DeleteBed(string keyValue, string ParentID);
string GetBuildType(string parentID);
string GetParentBuildType(string keyValue);
@@ -84,9 +80,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
///
///
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);
- string SaveRoom(string RoomId, List list);
+ void SaveRoom(string RoomId, List list);
///
/// 批量添加单元、楼层、房间、床位
@@ -100,7 +95,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement
void Automatic_allocation_accommodation(bool noNation, bool noPlace);
- void SyncData();
object GetDormitoryList();
object GetUnitList(string ParentID);
object GetFloorList(string parentID);
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
index 9d80f8280..cc25a058c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs
@@ -68,10 +68,10 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
dp.Add("ParentID", queryParam["ParentID"].ToString(), DbType.String);
strSql.Append(" AND t.ParentID =@ParentID ");
}
- //else
- //{
- // strSql.Append(" AND t.BuildType ='4' ");
- //}
+ else
+ {
+ strSql.Append(" AND t.BuildType ='4' ");
+ }
if (!queryParam["ApartmentId"].IsEmpty())
{
@@ -101,17 +101,17 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
if (!queryParam["Dept"].IsEmpty())
{
- dp.Add("Dept", queryParam["Dept"].ToString(), DbType.String);
+ dp.Add("Dept", "%" + queryParam["Dept"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Dept=@Dept ");
}
if (!queryParam["Class"].IsEmpty())
{
- dp.Add("Class", queryParam["Class"].ToString(), DbType.String);
+ dp.Add("Class", "%" + queryParam["Class"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Class=@Class ");
}
if (!queryParam["Major"].IsEmpty())
{
- dp.Add("Major", queryParam["Major"].ToString(), DbType.String);
+ dp.Add("Major", "%" + queryParam["Major"].ToString() + "%", DbType.String);
strSql.Append(" AND t.Major=@Major ");
}
if (!queryParam["Sex"].IsEmpty())
@@ -170,12 +170,6 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
strSql.Append(" AND t.CheckInStu>0 ");
}
}
-
- if (!queryParam["SqlParameter"].IsEmpty())
- {
- strSql.Append(queryParam["SqlParameter"].ToString());
- }
-
return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).OrderBy(a => a.Name).ThenBy(a => a.Name).ToList();
}
catch (Exception ex)
@@ -298,8 +292,7 @@ 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(strSql.ToString(), dp).ToList();
- //return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).ToList();
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination).ToList();
}
catch (Exception ex)
{
@@ -318,7 +311,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
{
try
{
- var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.ParentID == parentID);
+ var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.ID == parentID);
if (null != entity)
{
return entity.BuildType;
@@ -624,7 +617,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
floorInfo.dormitory = bed;
if (!string.IsNullOrEmpty(bed.StudentID))
{
- floorInfo.stuInfo = this.BaseRepository("CollegeMIS").FindEntity(a => a.StuNo == bed.StudentID);
+ floorInfo.stuInfo = this.BaseRepository("CollegeMIS").FindEntity(a => a.StuId == bed.StudentID);
}
list.Add(floorInfo);
}
@@ -720,7 +713,7 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
{
try
{
- return this.BaseRepository("CollegeMIS").FindList(x => (x.BuildType == "2" || x.BuildType == "1")).ToList();
+ return this.BaseRepository("CollegeMIS").FindList(x => ( x.BuildType == "2" || x.BuildType == "1")).ToList();
}
catch (Exception ex)
{
@@ -823,78 +816,6 @@ a.name as ApartmentName,b.name as UnitName,c.Name as FloorName
}
}
- ///
- /// 获取非空床的系部专业 班级
- ///
- ///
- public List GetSelectData(string strWhere)
- {
- try
- {
- string sql =
- @"select distinct dept,d.DeptName,major,m.MajorName,class,c.ClassName from [dbo].[Acc_DormitoryBuild] t
-join CdDept d on t.dept=d.deptno
-join CdMajor m on t.major=m.majorno
-join ClassInfo c on t.class=c.classno
-where t.ID in (
-select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (studentid is not null and len(studentid)>0)
-)";
- if (!string.IsNullOrEmpty(strWhere))
- {
- sql += " and " + strWhere;
- }
-
- return this.BaseRepository("CollegeMIS").FindList(sql).ToList();
-
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowServiceException(ex);
- }
- }
- }
-
- ///
- /// 获取树形数据(学生归宿)
- ///
- ///
- public List GetSqlTreeForReturn()
- {
- try
- {
- List list = new List();
- var roomSql = @"select * from [dbo].[Acc_DormitoryBuild] where ID in (
-select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (studentid is not null and len(studentid)>0)
-)";
- List roomList = this.BaseRepository("CollegeMIS")
- .FindList(roomSql).ToList();
- list = roomList.Union(list).ToList();
- var apartIds = roomList.Select(x => x.ApartmentId).Distinct().ToList();
- var unitIds = roomList.Select(x => x.UnitId).Distinct().ToList();
- var floorIds = roomList.Select(x => x.FloorId).Distinct().ToList();
- var otherList = this.BaseRepository("CollegeMIS").FindList(x =>
- apartIds.Contains(x.ID) || unitIds.Contains(x.ID) || floorIds.Contains(x.ID)).ToList();
- list = list.Union(otherList).ToList();
- return list.OrderBy(x => x.DNo).OrderBy(x => x.Name).ToList();
- }
- catch (Exception ex)
- {
- if (ex is ExceptionEx)
- {
- throw;
- }
- else
- {
- throw ExceptionEx.ThrowServiceException(ex);
- }
- }
- }
///
/// 根据父id获取数据
///
@@ -1100,27 +1021,6 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
}
}
-
- public void DeleteBed(string keyValue, string ParentID)
- {
- try
- {
- this.BaseRepository("CollegeMIS").Delete(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(a => a.ParentID == parentid).ToList();
@@ -1183,7 +1083,6 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
UpdateTime = DateTime.Now
};
elementEntity.Create();
- elementEntity.UnitId = elementEntity.ID;
list.Add(elementEntity);
//添加楼层
@@ -1214,7 +1113,6 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
UpdateTime = DateTime.Now
};
floorEntity.Create();
- floorEntity.FloorId = floorEntity.ID;
list.Add(floorEntity);
//添加房间
@@ -1259,9 +1157,6 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
var bedEntity = new Acc_DormitoryBuildEntity
{
ParentID = roomEntity.ID,
- ApartmentId = keyValue,
- UnitId = elementEntity.ID,
- FloorId = floorEntity.ID,
Name = m.ToString() + "床",
DNo = m.ToString(),
BuildType = "5",
@@ -1613,11 +1508,9 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
}
else
{
- entity.Create();
if (entity.BuildType == "1")
{
- entity.ApartmentId = entity.ID;
- if (string.IsNullOrEmpty(entity.ParentID) || entity.ParentID == "-1")
+ if (string.IsNullOrEmpty(entity.ParentID))
{
var rootNode = this.BaseRepository("CollegeMIS").FindList().FirstOrDefault(a => a.ParentID == null);
if (rootNode == null)
@@ -1643,17 +1536,14 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
}
else
{
- //上一级
var parentity = this.BaseRepository("CollegeMIS").FindList().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;
}
@@ -1668,6 +1558,7 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
}
}
+ entity.Create();
entity.CreateBy = currentUser.realName;
entity.CreateTime = DateTime.Now;
entity.UpdateBy = currentUser.realName;
@@ -1688,74 +1579,6 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
}
}
-
- ///
- /// 保存实体数据(新增、修改)
- /// 主键
- ///
- ///
- 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(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
@@ -1796,25 +1619,13 @@ where ID='{ParentID}'
///
///
///
- public string SaveRoom(string RoomId, List list)
+ public void SaveRoom(string RoomId, List list)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
foreach (var entity in list)
{
- //判断该学生是否已分配
- if (!string.IsNullOrEmpty(entity.StudentID))
- {
- var count = db.FindList().Count(x => x.StudentID == entity.StudentID && x.ID != entity.ID);
- if (count > 0)
- {
- var stuname = db.FindEntity(x => x.StuNo == entity.StudentID)?.StuName;
- return "学生" + stuname + "已分配床位,不可重复分配!";
- }
- }
-
- //分配床位
string sql = $"update Acc_DormitoryBuild set StudentID='{entity.StudentID}' where ID='{entity.ID}'";
db.ExecuteBySql(sql);
}
@@ -1824,7 +1635,6 @@ where ID='{ParentID}'
db.ExecuteBySql(checkInSql);
db.Commit();
- return "";
}
catch (Exception ex)
{