Kaynağa Gözat

Merge branch '长阳分支中职' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 长阳分支中职

新疆警官学校中职
dyy 2 yıl önce
ebeveyn
işleme
bd20db1b34
5 değiştirilmiş dosya ile 529 ekleme ve 8 silme
  1. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs
  2. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermEntity.cs
  3. +62
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs
  4. +6
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  5. +453
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/IndexInStudent/list.vue

+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs Dosyayı Görüntüle

@@ -36,11 +36,14 @@ namespace Learun.Application.WebApi
Get["/form"] = GetForm;
Post["/delete"] = DeleteForm;
Post["/save"] = SaveForm;
//审核学生请假
Post["/savecheck"] = SaveCheckForm;

//判断是否可以审核
Get["/ischeck"] = IsCheck;
//学生请假--教师审核列表
Get["/checkpagelist"] = GetCheckPageList;
//审核学生请假
Post["/savecheck"] = SaveCheckForm;

}
#region 获取数据



+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermEntity.cs Dosyayı Görüntüle

@@ -157,6 +157,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[NotMapped] public string SyncType { get; set; }

[NotMapped] public string StuName { get; set; }
[NotMapped] public string Grade { get; set; }

#endregion

#region 扩展操作


+ 62
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs Dosyayı Görüntüle

@@ -39,12 +39,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var dp = new DynamicParameters(new { });
if (!queryParam["LeaveType"].IsEmpty())
{
dp.Add("LeaveType",queryParam["LeaveType"].ToString(), DbType.String);
dp.Add("LeaveType", queryParam["LeaveType"].ToString(), DbType.String);
strSql.Append(" AND t.LeaveType = @LeaveType ");
}
if (!queryParam["CheckStatus"].IsEmpty())
{
dp.Add("CheckStatus",queryParam["CheckStatus"].ToString(), DbType.String);
dp.Add("CheckStatus", queryParam["CheckStatus"].ToString(), DbType.String);
strSql.Append(" AND t.CheckStatus = @CheckStatus ");
}
if (!queryParam["StuNo"].IsEmpty())
@@ -90,7 +90,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
strSql.Append(" ) ");
}
}
return this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(strSql.ToString(),dp, pagination);
return this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
@@ -222,7 +222,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
this.BaseRepository("CollegeMIS").Delete<StuLeaveManagementEntity>(t=>t.Id == keyValue);
this.BaseRepository("CollegeMIS").Delete<StuLeaveManagementEntity>(t => t.Id == keyValue);
}
catch (Exception ex)
{
@@ -244,21 +244,77 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="entity">实体</param>
public void SaveEntity(string keyValue, StuLeaveManagementEntity entity)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
this.BaseRepository("CollegeMIS").Update(entity);
db.Update(entity);

if (entity.CheckStatus.Trim() == "1" && entity.StartTime != null)
{
//请假审核通过后,该学生的对应日期的课表改为请假
var model = db.FindList<StuLeaveManagementEntity>(
$"select * from StuLeaveManagement where Id='{keyValue}'").FirstOrDefault();
//请假开始时间和结束时间
var startTime = Convert.ToDateTime(model.StartTime?.ToString("yyyy-MM-dd") + " 00:00:00");
var endTime = Convert.ToDateTime(model.EndTime?.ToString("yyyy-MM-dd") + " 23:59:59");

//排课数据
var arrangeLessonTermList = db.FindList<ArrangeLessonTermEntity>($@"select a.*,b.StuName,b.Grade from [dbo].[ArrangeLessonTerm] a
join stuinfobasic b on a.teachclassno=b.classno
where b.stuno='{model.CreateUserNo}'
and a.lessondate between '{startTime}' and '{endTime}'");

var deptList = db.FindList<CdDeptEntity>();
var majorList = db.FindList<CdMajorEntity>();
var classInfoList = db.FindList<ClassInfoEntity>();
foreach (var arrangeLessonTerm in arrangeLessonTermList)
{
StuAttendanceLeaveEntity stuAttendanceLeave = new StuAttendanceLeaveEntity();
stuAttendanceLeave.Create();
stuAttendanceLeave.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
stuAttendanceLeave.Semester = arrangeLessonTerm.Semester;
stuAttendanceLeave.StuNo = model.CreateUserNo;
stuAttendanceLeave.StuName = arrangeLessonTerm.StuName;
stuAttendanceLeave.Grade = arrangeLessonTerm.Grade;
stuAttendanceLeave.DeptNo = arrangeLessonTerm.DeptNo;
stuAttendanceLeave.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
.FirstOrDefault()?.DeptName;
stuAttendanceLeave.MajorNo = arrangeLessonTerm.MajorNo;
stuAttendanceLeave.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo)
.FirstOrDefault()?.MajorName;
stuAttendanceLeave.ClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.ClassName = classInfoList
.Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
stuAttendanceLeave.LessonNo = arrangeLessonTerm.LessonNo;
stuAttendanceLeave.LessonName = arrangeLessonTerm.LessonName;
stuAttendanceLeave.TeachClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.LessonSortNo = arrangeLessonTerm.LessonSortNo;
//stuAttendanceLeave.LessonSortName = arrangeLessonTerm.LessonSortName;
stuAttendanceLeave.LessonDate = arrangeLessonTerm.LessonDate;
stuAttendanceLeave.LessonTime = arrangeLessonTerm.LessonTime;
stuAttendanceLeave.LeaveType = "1";
stuAttendanceLeave.EmpNo = arrangeLessonTerm.EmpNo;
stuAttendanceLeave.ClassRoomNo = arrangeLessonTerm.ClassroomNo;

db.Insert(stuAttendanceLeave);
}
}
}
else
{
entity.Create();
this.BaseRepository("CollegeMIS").Insert(entity);
db.Insert(entity);
}

db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;


+ 6
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json Dosyayı Görüntüle

@@ -585,6 +585,12 @@
"navigationBarTitleText": "审核"
}
},
{
"path": "pages/EducationalAdministration/StuAttendanceLeave/IndexInStudent/list",
"style": {
"navigationBarTitleText": "课表请假管理"
}
},
//疫情详细信息
{
"path": "pages/PersonnelManagement/ContactsDetails/list",


+ 453
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/StuAttendanceLeave/IndexInStudent/list.vue Dosyayı Görüntüle

@@ -0,0 +1,453 @@
<template>
<view class="page">
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
<l-customlist :tips="loadState" showTips>
<!-- 单条记录 -->
<view class="customlist-item" v-for="item of list" :key="item.Id">

<view class="customlist-item-field">
<text class="customlist-item-field-title">申请时间:</text>
{{ displayListItem(item, 'UpdateDate') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">审核状态:</text>
{{ LeaveCheckItem(displayListItem(item, 'IsCheck')) }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">审核备注:</text>
{{ displayListItem(item, 'TecRemark') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">请假类型:</text>
{{ LeaveTypeItem(displayListItem(item, 'LeaveType')) }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学年:</text>
{{ displayListItem(item, 'AcademicYearNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学期:</text>
{{ displayListItem(item, 'Semester') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">学号:</text>
{{ displayListItem(item, 'StuNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">姓名:</text>
{{ displayListItem(item, 'StuName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">年级:</text>
{{ displayListItem(item, 'Grade') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">系所码:</text>
{{ displayListItem(item, 'DeptNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">系名:</text>
{{ displayListItem(item, 'DeptName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">专业码:</text>
{{ displayListItem(item, 'MajorNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">专业名:</text>
{{ displayListItem(item, 'MajorName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">所在行政班号:</text>
{{ displayListItem(item, 'ClassNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">班级名称:</text>
{{ displayListItem(item, 'ClassName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">课程号:</text>
{{ displayListItem(item, 'LessonNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">课程名称:</text>
{{ displayListItem(item, 'LessonName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">课程类别码:</text>
{{ displayListItem(item, 'LessonSortNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">课程类别:</text>
{{ displayListItem(item, 'LessonSortName') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">原上课日期:</text>
{{ displayListItem(item, 'LessonDate') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">上课时间:</text>
{{ displayListItem(item, 'LessonTime') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">教师号:</text>
{{ displayListItem(item, 'EmpNo') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">备注:</text>
{{ displayListItem(item, 'Remark') }}
</view>
<!-- <l-customlist-action @view="action('view', item.ID)" /> -->
</view>
</l-customlist>
</l-scroll-list>
</view>
<!-- 关闭侧边抽屉按钮 -->
<view @click="sideOpen = false" :class="sideOpen ? 'show' : ''" class="sideclose">
<l-icon type="pullright" color="blue" />
</view>
<!-- 侧边栏,用于设置查询条件 -->
<scroll-view :class="sideOpen ? 'show' : ''" class="sidepage" scroll-y>
<view v-if="ready" class="padding">
<l-input
v-model="queryData.LessonName"
@change="searchChange"
title ="课程名称"
placeholder="按课程名称查询"
/>
<l-input
v-model="queryData.Grade"
@change="searchChange"
title ="年级"
placeholder="按年级查询"
/>
<l-input
v-model="queryData.StuName"
@change="searchChange"
title ="姓名"
placeholder="按姓名查询"
/>
<l-input
v-model="queryData.EmpNo"
@change="searchChange"
title ="教师号"
placeholder="按教师号查询"
/>
<!-- 重置查询条件按钮 -->
<view class="padding-tb">
<l-button @click="reset" line="orange" class="block" block>重置查询条件</l-button>
</view>
</view>
</scroll-view>
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> -->
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 15:22
* 描 述:aaa
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/EducationalAdministration/StuAttendanceLeave/list", "style": { "navigationBarTitleText": "表单列表页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import moment from 'moment'
import get from 'lodash/get'
import set from 'lodash/set'
import pickBy from 'lodash/pickBy'
import mapValues from 'lodash/mapValues'
export default {
data() {
return {
// 数据项的数据类型、结构
scheme: {
UpdateDate: { type: 'text' },
IsCheck: { type: 'text' },
TecRemark: { type: 'text' },
LeaveType: { type: 'text' },
AcademicYearNo: { type: 'text' },
Semester: { type: 'text' },
StuNo: { type: 'text' },
StuName: { type: 'text' },
Grade: { type: 'text' },
DeptNo: { type: 'text' },
DeptName: { type: 'text' },
MajorNo: { type: 'text' },
MajorName: { type: 'text' },
ClassNo: { type: 'text' },
ClassName: { type: 'text' },
LessonNo: { type: 'text' },
LessonName: { type: 'text' },
LessonSortNo: { type: 'text' },
LessonSortName: { type: 'text' },
LessonDate: { type: 'text' },
LessonTime: { type: 'text' },
EmpNo: { type: 'text' },
Remark: { type: 'text' },
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
StuNo: '',
StuName: '',
},
// 数据源
dataSource: {
},
// 页面相关参数
ready: false,
tips: '加载中...',
loadState: '向下翻以加载更多',
sideOpen: false,
// 列表与分页信息
page: 1,
total: 2,
list: [],
user: null,
}
},
async onLoad() {
await this.init()
},
onUnload() {
this.OFF('EducationalAdministrationStuAttendanceLeave-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('EducationalAdministrationStuAttendanceLeave-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
() => {}
])
// console.log(this.user)
await this.fetchList()
// 初始化查询条件
this.defaultQueryData = this.COPY(this.queryData)
this.ready = true
},
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
const result = await this.HTTP_GET(
'learun/adms/EducationalAdministration/StuAttendanceLeave/pagelist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'Id', sord: 'DESC' },
queryJson: JSON.stringify(Object.assign(this.searchData,{StuNo:this.user.account}) ),
},
'加载数据时出错'
)
if (!result) { return }
this.total = result.total
this.page = result.page + 1
this.list = this.list.concat(result.rows)
// console.log(this.list)
this.tips = `已加载 ${Math.min(result.page, result.total)} / ${result.total} 页,共 ${result.records} 项`
this.loadState = result.page >= result.total ? '已加载所有项目' : '向下翻以加载更多'
},
// 刷新清空列表
async refreshList() {
this.page = 1
this.total = 2
this.list = []
await this.fetchList()
},
// 列表下拉
pullDown() {
this.refreshList().then(() => {
this.$refs.list.stopPullDown()
})
},
// 设置搜索条件
async searchChange() {
const result = {}
// 将其他查询项添加到查询 JSON 中
const queryObj = pickBy(this.queryData, t => (Array.isArray(t) ? t.length > 0 : t))
Object.assign(result, mapValues(queryObj, t => (Array.isArray(t) ? t.join(',') : t)))
this.searchData = result
await this.refreshList()
},
// 点击「清空查询条件」按钮
reset() {
this.queryData = this.COPY(this.defaultQueryData)
this.searchChange()
},
// 点击「编辑」、「查看」、「添加」、「删除」按钮
async action(type, id = '') {
switch (type) {
case 'view':
this.NAV_TO(`./single?type=view&id=${id}`)
return
case 'add':
this.NAV_TO('./single?type=create')
return
case 'edit':
this.NAV_TO(`./single?type=edit&id=${id}`)
return
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) {
return
}
this.HTTP_POST('learun/adms/EducationalAdministration/StuAttendanceLeave/delete', id, '删除失败').then(success => {
if(!success) { return }
this.TOAST('删除成功', 'success')
this.refreshList()
})
return
default:
return
}
},
// 显示列表中的标题项
displayListItem(item, field) {
const fieldItem = this.scheme[field]
const value = item[field]
switch (fieldItem.type) {
case 'currentInfo':
case 'organize':
return fieldItem.dataType === 'time' ? value : get(this.GET_GLOBAL(fieldItem.dataType), `${value}.name`, '')
case 'radio':
case 'select':
const selectItem = this.dataSource[field].find(t => t.value === String(value))
return get(selectItem, 'text', '')
case 'checkbox':
if (!value || value.split(',').length <= 0) { return '' }
const checkboxItems = value.split(',')
return this.dataSource[field].filter(t => checkboxItems.includes(t.value)).map(t => t.text).join(',')
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
default: return value === null || value === undefined ? '' : value
}
},
// 请假审核
LeaveCheckItem(data){
return data==1 ? '同意' : '不同意'
},
// 请假类型审核
LeaveTypeItem(data){
switch(data){
case'1':
return '事假';
break;
case'2':
return '病假';
break;
case'3':
return '婚假';
break;
case'4':
return '探亲假';
break;
case'5':
return '产假';
break;
case'6':
return '丧假';
break;
case'7':
return '补休';
break;
case'8':
return '公假';
break;
case'9':
return '其它';
break;
}
}
},
created() {
this.user = this.GET_GLOBAL('loginUser');
}
}
</script>
<style lang="less" scoped>
@import '~@/common/css/sidepage.less';
@import '~@/common/css/customlist.less';
</style>

Yükleniyor…
İptal
Kaydet