浏览代码

【修改】课时费统计:增加时间段排除功能;

黑龙江艺术高中职
dyy 5 个月前
父节点
当前提交
769fe0cbca
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. +14
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs

+ 14
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs 查看文件

@@ -2274,15 +2274,26 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les
var status = (queryParam["status"] == null ? "0" : queryParam["status"].ToString()).ToInt();
string starttime = queryParam["StartTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["StartTime"].ToString();
string endtime = queryParam["EndTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["EndTime"].ToString();
var notimeSql = string.Empty;
var notimeSql2 = string.Empty;
if (!queryParam["noTime"].IsEmpty())
{
foreach (var item in queryParam["noTime"].ToString().Split('&'))
{
notimeSql += $" and lessondate not between '{item.Split(',')[0]}' and '{item.Split(',')[1]}'";
notimeSql2 += $" and clocktime not between '{item.Split(',')[0]}' and '{item.Split(',')[1]}'";
}
}

strSql.Append("select a.*,b.jobrank as zhiwu,b.ProfessionalTitle as zhicheng,b.F_DepartmentId as dept,b.feestandard,b.Weekcourses,ta.actcourses as monthactcourses,ta.actcourses-(" + weeks + "*b.Weekcourses) as zhesuan_monthactcourses, ");
strSql.Append(" case when ta.actcourses is null then 0 when b.jobrank in(5,6) then (ta.actcourses-" + weeks + "*b.Weekcourses)*b.feestandard ");
strSql.Append(" when b.jobrank in(1,2,3,4) then (case when ta.actcourses<=(" + weeks + "*b.weekcourses)/2 then ta.actcourses*b.feestandard else " + weeks + "*b.weekcourses*b.feestandard/2 end) ");
strSql.Append(" else 0 end as actfeestandard ");
strSql.Append("from ");
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' group by a.empno,a.empname ) a ");
strSql.Append("left join (select count(*) as actcourses,EmpNo from (select ff.EmpNo,ff.LessonDate,ff.LessonTime from (select aall.* from (select EmpNo,ALTId from Teach_attendance where LessonSortNo='1' and clocktime between '" + starttime + "' and '" + endtime + "' group by EmpNo,ALTId) ee left join ArrangeLessonTerm aall on aall.ALTId=ee.ALTId) ff group by ff.EmpNo,ff.LessonDate,ff.LessonTime) gg group by gg.EmpNo ) ta on ta.empno=a.empno ");
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' " + notimeSql + " group by a.empno,a.empname ) a ");
strSql.Append("left join (select count(*) as actcourses,EmpNo from (select ff.EmpNo,ff.LessonDate,ff.LessonTime from (select aall.* from (select EmpNo,ALTId from Teach_attendance where LessonSortNo='1' and clocktime between '" + starttime + "' and '" + endtime + "' " + notimeSql2 + " group by EmpNo,ALTId) ee left join ArrangeLessonTerm aall on aall.ALTId=ee.ALTId) ff group by ff.EmpNo,ff.LessonDate,ff.LessonTime) gg group by gg.EmpNo ) ta on ta.empno=a.empno ");
strSql.Append("left join empinfo b on a.empno=b.empno ");
strSql.Append("where a.empno is not null and (b.IsInActiveStatus="+status+" or (0="+status+ " and b.IsInActiveStatus!=2)) ");
strSql.Append("where a.empno is not null and (b.IsInActiveStatus=" + status + " or (0=" + status + " and b.IsInActiveStatus!=2)) ");
if (!string.IsNullOrEmpty(deptNo))
{
strSql.Append("and b.F_DepartmentId='" + deptNo + "' ");


正在加载...
取消
保存