├── src ├── main │ ├── webapp │ │ ├── front-end@author王顺锋 │ │ ├── dist │ │ │ ├── b1.png │ │ │ ├── b2.png │ │ │ ├── login.jpg │ │ │ ├── services.js │ │ │ ├── shiftcfg-ctrl.js │ │ │ ├── stat-ctrl.js │ │ │ ├── search-ctrl.js │ │ │ ├── app.js │ │ │ ├── dept-ctrl.js │ │ │ ├── paiban.css │ │ │ ├── shift-ctrl.js │ │ │ └── lib │ │ │ │ ├── angular-resource.min.js │ │ │ │ ├── angular-route.min.js │ │ │ │ └── angular-sanitize.min.js │ │ ├── partials │ │ │ ├── search.html │ │ │ ├── stat.html │ │ │ ├── shiftcfg.html │ │ │ ├── shift.html │ │ │ ├── help.html │ │ │ └── department.htm │ │ ├── WEB-INF │ │ │ └── web.xml │ │ ├── error.html │ │ ├── index.html │ │ ├── page │ │ │ ├── login.jsp │ │ │ └── home.jsp │ │ └── sheetjs │ │ │ ├── Export2Excel.js │ │ │ └── Blob.js │ ├── resources │ │ ├── jdbc.properties │ │ ├── mapper │ │ │ ├── log.xml │ │ │ ├── user.xml │ │ │ ├── m_schedule.xml │ │ │ ├── dept.xml │ │ │ ├── clazz.xml │ │ │ ├── statistics.xml │ │ │ ├── schedule.xml │ │ │ └── emp.xml │ │ ├── spring-mybatis.xml │ │ └── spring-servlet.xml │ └── java │ │ └── com │ │ └── alibaba │ │ └── monitor │ │ └── mavenWeb │ │ ├── dao │ │ ├── ILogDao.java │ │ ├── IUserDao.java │ │ ├── IM_ScheduleDao.java │ │ ├── IDeptDao.java │ │ ├── IClassDao.java │ │ ├── IStatisticsDao.java │ │ ├── IEmpDao.java │ │ └── IScheduleDao.java │ │ ├── service │ │ ├── ILogService.java │ │ ├── IUserService.java │ │ ├── IM_ScheduleService.java │ │ ├── IDeptService.java │ │ ├── IClassService.java │ │ ├── impl │ │ │ ├── LogServiceImpl.java │ │ │ ├── UserServiceImpl.java │ │ │ ├── M_ScheduleServiceImpl.java │ │ │ ├── ArrayClassServiceImpl.java │ │ │ ├── DeptServiceImpl.java │ │ │ ├── ClassServiceImpl.java │ │ │ ├── StatisticsServiceImpl.java │ │ │ ├── EmpServiceImpl.java │ │ │ └── ScheduleServiceImpl.java │ │ ├── IEmpService.java │ │ ├── IStatisticsService.java │ │ ├── IArrayClassService.java │ │ └── IScheduleService.java │ │ ├── controller │ │ ├── HomeController.java │ │ ├── LogoutController.java │ │ ├── DedtController.java │ │ ├── ScheduleAPIController.java │ │ ├── LoginController.java │ │ ├── Test2Controller.java │ │ ├── EmpController.java │ │ ├── chaxunSchedule.java │ │ ├── ShiftcfgController.java │ │ └── StatisticsController.java │ │ ├── pojos │ │ ├── EmpClazz.java │ │ ├── EmpSearch.java │ │ ├── EmpArrayed.java │ │ ├── Dept.java │ │ ├── User.java │ │ ├── Clazz.java │ │ ├── ScheduleSearch.java │ │ ├── Schedule.java │ │ ├── M_Schedule.java │ │ ├── Log.java │ │ ├── Emp.java │ │ └── Statistics.java │ │ ├── contral │ │ ├── MD5Util.java │ │ ├── ArrayClassModeFourAction.java │ │ ├── DateAction.java │ │ └── ArrayClassModeOneAction.java │ │ └── interceptor │ │ └── CommonInterceptor.java ├── 测试用例.xlsx └── 排班网需求设计文档.docx ├── target ├── classes │ ├── .gitignore │ ├── jdbc.properties │ ├── com │ │ └── alibaba │ │ │ └── monitor │ │ │ └── mavenWeb │ │ │ ├── pojos │ │ │ ├── Dept.class │ │ │ ├── Emp.class │ │ │ ├── Log.class │ │ │ ├── User.class │ │ │ ├── Clazz.class │ │ │ ├── EmpClazz.class │ │ │ ├── EmpSearch.class │ │ │ ├── Schedule.class │ │ │ ├── EmpArrayed.class │ │ │ ├── M_Schedule.class │ │ │ ├── Statistics.class │ │ │ └── ScheduleSearch.class │ │ │ ├── dao │ │ │ ├── IDeptDao.class │ │ │ ├── IEmpDao.class │ │ │ ├── ILogDao.class │ │ │ ├── IUserDao.class │ │ │ ├── IClassDao.class │ │ │ ├── IScheduleDao.class │ │ │ ├── IM_ScheduleDao.class │ │ │ └── IStatisticsDao.class │ │ │ ├── contral │ │ │ ├── MD5Util.class │ │ │ ├── DateAction.class │ │ │ ├── ArrayClassModeFourAction.class │ │ │ ├── ArrayClassModeOneAction.class │ │ │ ├── ArrayClassModeTwoAction.class │ │ │ └── ArrayClassModeThreeAction.class │ │ │ ├── service │ │ │ ├── IDeptService.class │ │ │ ├── IEmpService.class │ │ │ ├── ILogService.class │ │ │ ├── IUserService.class │ │ │ ├── IClassService.class │ │ │ ├── IScheduleService.class │ │ │ ├── IArrayClassService.class │ │ │ ├── IM_ScheduleService.class │ │ │ ├── IStatisticsService.class │ │ │ └── impl │ │ │ │ ├── EmpServiceImpl.class │ │ │ │ ├── LogServiceImpl.class │ │ │ │ ├── ClassServiceImpl.class │ │ │ │ ├── DeptServiceImpl.class │ │ │ │ ├── UserServiceImpl.class │ │ │ │ ├── ScheduleServiceImpl.class │ │ │ │ ├── ArrayClassServiceImpl.class │ │ │ │ ├── M_ScheduleServiceImpl.class │ │ │ │ └── StatisticsServiceImpl.class │ │ │ ├── controller │ │ │ ├── DedtController.class │ │ │ ├── EmpController.class │ │ │ ├── HomeController.class │ │ │ ├── chaxunSchedule.class │ │ │ ├── LoginController.class │ │ │ ├── LogoutController.class │ │ │ ├── Test2Controller.class │ │ │ ├── ShiftcfgController.class │ │ │ ├── ScheduleAPIController.class │ │ │ ├── StatisticsController.class │ │ │ ├── chaxunSchedule$SimpleBean.class │ │ │ └── ShiftcfgController$SimpleBean.class │ │ │ └── interceptor │ │ │ └── CommonInterceptor.class │ ├── mapper │ │ ├── log.xml │ │ ├── user.xml │ │ ├── m_schedule.xml │ │ ├── dept.xml │ │ ├── clazz.xml │ │ ├── statistics.xml │ │ ├── schedule.xml │ │ └── emp.xml │ ├── spring-mybatis.xml │ └── spring-servlet.xml └── m2e-wtp │ └── web-resources │ ├── .gitignore │ └── META-INF │ ├── MANIFEST.MF │ └── maven │ └── numberone │ └── paiban │ ├── pom.properties │ └── pom.xml ├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.validation.prefs ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.core.resources.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.jdt.core.prefs ├── .jsdtscope └── org.eclipse.wst.common.component ├── 开发环境搭建.docx ├── .gitattributes ├── .gitignore ├── .project ├── .classpath └── pom.xml /src/main/webapp/front-end@author王顺锋: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /target/classes/.gitignore: -------------------------------------------------------------------------------- 1 | /com/ 2 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/.gitignore: -------------------------------------------------------------------------------- 1 | /META-INF/ 2 | -------------------------------------------------------------------------------- /开发环境搭建.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/开发环境搭建.docx -------------------------------------------------------------------------------- /src/测试用例.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/src/测试用例.xlsx -------------------------------------------------------------------------------- /src/排班网需求设计文档.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/src/排班网需求设计文档.docx -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /src/main/webapp/dist/b1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/src/main/webapp/dist/b1.png -------------------------------------------------------------------------------- /src/main/webapp/dist/b2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/src/main/webapp/dist/b2.png -------------------------------------------------------------------------------- /src/main/webapp/dist/login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/src/main/webapp/dist/login.jpg -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/webapp/index.html=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /target/classes/jdbc.properties: -------------------------------------------------------------------------------- 1 | app.url=jdbc:mysql:///shift?useUnicode=true&characterEncoding=utf8 2 | app.username=root 3 | app.password=root -------------------------------------------------------------------------------- /src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | app.url=jdbc:mysql:///shift?useUnicode=true&characterEncoding=utf8 2 | app.username=root 3 | app.password=root -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: zhd 3 | Build-Jdk: 1.8.0_45 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Dept.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Dept.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Emp.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Emp.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Log.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Log.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/User.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IDeptDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IDeptDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IEmpDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IEmpDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/ILogDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/ILogDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IUserDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IUserDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Clazz.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Clazz.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/MD5Util.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/MD5Util.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IClassDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IClassDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpClazz.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpClazz.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpSearch.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpSearch.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Schedule.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Schedule.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IScheduleDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IScheduleDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpArrayed.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/EmpArrayed.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/M_Schedule.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/M_Schedule.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/Statistics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/Statistics.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/DateAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/DateAction.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IM_ScheduleDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IM_ScheduleDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/dao/IStatisticsDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/dao/IStatisticsDao.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/pojos/ScheduleSearch.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/pojos/ScheduleSearch.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IDeptService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IDeptService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IEmpService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IEmpService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/ILogService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/ILogService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IUserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IUserService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IClassService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IClassService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/DedtController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/DedtController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/EmpController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/EmpController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/HomeController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/chaxunSchedule.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/chaxunSchedule.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IScheduleService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IScheduleService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/LoginController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/LoginController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/LogoutController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/LogoutController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/Test2Controller.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/Test2Controller.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IArrayClassService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IArrayClassService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IM_ScheduleService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IM_ScheduleService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/IStatisticsService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/IStatisticsService.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/EmpServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/EmpServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/LogServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/LogServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/ShiftcfgController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/ShiftcfgController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/interceptor/CommonInterceptor.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/interceptor/CommonInterceptor.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/ClassServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/ClassServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/DeptServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/DeptServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/UserServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/UserServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeFourAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeFourAction.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeOneAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeOneAction.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeTwoAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeTwoAction.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/ScheduleAPIController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/ScheduleAPIController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/StatisticsController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/StatisticsController.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/ScheduleServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/ScheduleServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeThreeAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeThreeAction.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/ArrayClassServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/ArrayClassServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/M_ScheduleServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/M_ScheduleServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/service/impl/StatisticsServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/service/impl/StatisticsServiceImpl.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/chaxunSchedule$SimpleBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/chaxunSchedule$SimpleBean.class -------------------------------------------------------------------------------- /target/classes/com/alibaba/monitor/mavenWeb/controller/ShiftcfgController$SimpleBean.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenfeilove/paiban/HEAD/target/classes/com/alibaba/monitor/mavenWeb/controller/ShiftcfgController$SimpleBean.class -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/maven/numberone/paiban/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed Jul 15 13:41:30 CST 2015 3 | version=0.0.1-SNAPSHOT 4 | groupId=numberone 5 | m2e.projectName=paiban 6 | m2e.projectLocation=E\:\\GithubWorkspace\\paiban 7 | artifactId=paiban 8 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/ILogDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import com.alibaba.monitor.mavenWeb.pojos.Log; 6 | /** 7 | * @author zhuohaidi 8 | */ 9 | @Repository 10 | public interface ILogDao{ 11 | public void AddLog(Log log); 12 | } -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/ILogService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import org.springframework.stereotype.Repository; 4 | import com.alibaba.monitor.mavenWeb.pojos.Log; 5 | /** 6 | * @author zhuohaidi 7 | */ 8 | @Repository 9 | public interface ILogService { 10 | public void addLog(Log log); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IUserDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.List; 4 | import org.springframework.stereotype.Repository; 5 | import com.alibaba.monitor.mavenWeb.pojos.User; 6 | /** 7 | * @author zhuohaidi 8 | */ 9 | @Repository 10 | public interface IUserDao { 11 | public User LoadUser(User user); 12 | public void AddMulitUser(List userlist); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.User; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Service 12 | public interface IUserService { 13 | public User getUser(User user); 14 | public void AddMulitUser(List userlist); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IM_ScheduleDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import org.springframework.stereotype.Repository; 4 | 5 | import com.alibaba.monitor.mavenWeb.pojos.M_Schedule; 6 | /** 7 | * @author zhuohaidi 8 | */ 9 | @Repository 10 | public interface IM_ScheduleDao { 11 | public M_Schedule LoadMScheduleByEmpno(M_Schedule mschedule); 12 | public void AddMSchedule(M_Schedule mschedule); 13 | } 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.8 9 | -------------------------------------------------------------------------------- /target/classes/mapper/log.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | insert into log(empno,dates,tablename,operate,bfupdate,updated) 9 | values(#{empno},#{dates},#{tablename},#{operate},#{bfupdate},#{updated}); 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestMethod; 6 | /** 7 | * @author zhuohaidi 8 | */ 9 | @Controller 10 | @RequestMapping("/home") 11 | public class HomeController { 12 | 13 | @RequestMapping(method = RequestMethod.GET) 14 | public String home() { 15 | return "home"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IDeptDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Dept; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IDeptDao { 13 | public Dept LoadDept(Dept dept); 14 | public List LoadAllDept(Dept dept); 15 | public void AddDept(Dept dept); 16 | public void ModifyDept(Dept dept); 17 | public void DeleteDept(Dept dept); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/mapper/log.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | insert into log(empno,dates,tablename,operate,bfupdate,updated) 9 | values(#{empno},#{dates},#{tablename},#{operate},#{bfupdate},#{updated}); 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IM_ScheduleService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.M_Schedule; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IM_ScheduleService { 13 | public M_Schedule getMScheduleByEmpno(M_Schedule mschedule); 14 | public void AddMSchedule(M_Schedule mschedule); 15 | public void AddMulitMSchedule(List mschedulelist); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IClassDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Clazz; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IClassDao { 13 | public Clazz LoadClass(Clazz clazz); 14 | public List LoadAllClass(Clazz clazz); 15 | public void AddClass(Clazz clazz); 16 | public void ModifyClass(Clazz clazz); 17 | public void DeleteClass(Clazz clazz); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IDeptService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Dept; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IDeptService { 13 | public Dept getDept(Dept dept); 14 | public List getAllDept(Dept dept); 15 | public void AddDept(Dept dept); 16 | public void AddmultiDept(List deptlist); 17 | public void ModifyDept(Dept dept); 18 | public void DeleteDept(Dept dept); 19 | } 20 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/EmpClazz.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | 3 | import java.util.Arrays; 4 | /** 5 | * @author yangjiadi 6 | */ 7 | public class EmpClazz { 8 | private Emp emp; 9 | private int a[]; 10 | public Emp getEmp() { 11 | return emp; 12 | } 13 | public void setEmp(Emp emp) { 14 | this.emp = emp; 15 | } 16 | public int[] getA() { 17 | return a; 18 | } 19 | public void setA(int[] a) { 20 | this.a = a; 21 | } 22 | @Override 23 | public String toString() { 24 | return "EmpClazz [emp=" + emp + ", a=" + Arrays.toString(a) + "]"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/dist/services.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* Services */ 4 | 5 | var paibanServices = angular.module('paibanServices', ['ngResource']); 6 | /* 7 | 8 | paibanServices.factory('UserFac', [ '$resource', function($resource) { 9 | return $resource('user', {}, { 10 | query : { 11 | method : 'GET', 12 | params : {}, 13 | isArray : false 14 | } 15 | }); 16 | } ]); 17 | 18 | */ 19 | 20 | paibanServices.factory('EmplFac', ['$resource', function ($resource) { 21 | return $resource('employee.html', //'/rssChannel/:channelId/items?sort=publishedDate,desc&size=12&page=:page', 22 | {}, {}); 23 | }]); 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IClassService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Clazz; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IClassService { 13 | public Clazz getClazz(Clazz clazz); 14 | public List getAllClass(Clazz clazz); 15 | public void AddClass(Clazz clazz); 16 | public void AddmultiClass(List clazzlist); 17 | public void ModifyClass(Clazz clazz); 18 | public void DeleteClass(Clazz clazz); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/EmpSearch.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class EmpSearch { 6 | private String keyword; 7 | private int deptno; 8 | public String getKeyword() { 9 | return keyword; 10 | } 11 | public void setKeyword(String keyword) { 12 | this.keyword = keyword; 13 | } 14 | public int getDeptno() { 15 | return deptno; 16 | } 17 | public void setDeptno(int deptno) { 18 | this.deptno = deptno; 19 | } 20 | @Override 21 | public String toString() { 22 | return "EmpSearch [keyword=" + keyword + ", deptno=" + deptno + "]"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/LogServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 7 | import com.alibaba.monitor.mavenWeb.pojos.Log; 8 | import com.alibaba.monitor.mavenWeb.service.ILogService; 9 | @Service 10 | public class LogServiceImpl implements ILogService { 11 | 12 | @Autowired 13 | ILogDao logdao; 14 | @Override 15 | public void addLog(Log log) { 16 | // TODO Auto-generated method stub 17 | logdao.AddLog(log); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/LogoutController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RequestMethod; 8 | 9 | /** 10 | * @author zhuohaidi 11 | */ 12 | @Controller 13 | public class LogoutController { 14 | 15 | @RequestMapping(value = "/logout.html",method=RequestMethod.GET) 16 | public String logout (HttpServletRequest request){ 17 | request.getSession().invalidate(); 18 | return "redirect:home"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/EmpArrayed.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class EmpArrayed { 6 | private String keyword; 7 | private int deptno; 8 | private boolean arrayed; 9 | public String getKeyword() { 10 | return keyword; 11 | } 12 | public void setKeyword(String keyword) { 13 | this.keyword = keyword; 14 | } 15 | 16 | public int getDeptno() { 17 | return deptno; 18 | } 19 | public void setDeptno(int deptno) { 20 | this.deptno = deptno; 21 | } 22 | public boolean isArrayed() { 23 | return arrayed; 24 | } 25 | public void setArrayed(boolean arrayed) { 26 | this.arrayed = arrayed; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IStatisticsDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Statistics; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IStatisticsDao { 13 | public Statistics LoadStatistics(Statistics statistics); 14 | public List LoadAllStatistics(Statistics statistics); 15 | public Statistics loadStatisticsByEmpnoTime(Statistics statistics); 16 | public void AddStatistics(Statistics statistics); 17 | public void ModifyStatistics(Statistics statistics); 18 | public void DeleteStatistics(Statistics statistics); 19 | } 20 | -------------------------------------------------------------------------------- /target/classes/mapper/user.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | INSERT INTO users (username,passwd) 14 | VALUES 15 | 16 | (#{item.username},#{item.passwd}) 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | *.jar 45 | -------------------------------------------------------------------------------- /src/main/resources/mapper/user.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | INSERT INTO users (username,passwd) 14 | VALUES 15 | 16 | (#{item.username},#{item.passwd}) 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IEmpService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 8 | import com.alibaba.monitor.mavenWeb.pojos.EmpArrayed; 9 | /** 10 | * @author zhuohaidi 11 | */ 12 | @Repository 13 | public interface IEmpService { 14 | public Emp getEmp(Emp emp); 15 | public Emp getEmpByEmail(Emp emp); 16 | public List getAllEmp(Emp emp); 17 | public List getEmpByKey(String keyword,int deptno); 18 | public void AddEmp(Emp emp); 19 | public void AddMulitEmp(List emplist); 20 | public void ModifyEmp(Emp emp); 21 | public void ModifyMulitEmp(EmpArrayed emparrayed); 22 | public void DeleteEmp(Emp emp); 23 | } 24 | -------------------------------------------------------------------------------- /target/classes/mapper/m_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 11 | INSERT INTO m_schedule (empno,years,months,flag) 12 | VALUES(#{empno},#{years},#{months},#{flag}); 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.alibaba.monitor.mavenWeb.dao.IUserDao; 9 | import com.alibaba.monitor.mavenWeb.pojos.User; 10 | import com.alibaba.monitor.mavenWeb.service.IUserService; 11 | 12 | @Service 13 | public class UserServiceImpl implements IUserService{ 14 | @Autowired 15 | IUserDao userDao; 16 | public User getUser(User user) { 17 | return userDao.LoadUser(user); 18 | } 19 | @Override 20 | public void AddMulitUser(List userlist) { 21 | // TODO Auto-generated method stub 22 | userDao.AddMulitUser(userlist); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/mapper/m_schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 11 | INSERT INTO m_schedule (empno,years,months,flag) 12 | VALUES(#{empno},#{years},#{months},#{flag}); 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IStatisticsService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Statistics; 8 | /** 9 | * @author zhuohaidi 10 | */ 11 | @Repository 12 | public interface IStatisticsService { 13 | public Statistics getStatistics(Statistics statistics); 14 | public List getAllStatistics(Statistics statistics); 15 | public Statistics getStatisticsByEmpnoTime(Statistics statistics); 16 | public void AddStatistics(Statistics statistics); 17 | public void AddMulitStatistics(List statisticslist); 18 | public void ModifyStatistics(Statistics statistics); 19 | public void DeleteStatistics(Statistics statistics); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IArrayClassService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.List; 4 | import org.springframework.stereotype.Repository; 5 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 6 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 7 | /** 8 | * @author zhuohaidi 9 | */ 10 | @Repository 11 | public interface IArrayClassService { 12 | public List ModeZero(List emplist,int year,int month,int day); 13 | public List ModeOne(List emplist,int year,int month,int day); 14 | public List ModeTow(List emplist,int year,int month,int day); 15 | public List ModeThree(List emplist,int year,int month,int day); 16 | public List ModeFour(List emplist,int year,int month,int day); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Dept.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class Dept { 6 | private int deptno; 7 | private String dname; 8 | private String describes=""; 9 | public int getDeptno() { 10 | return deptno; 11 | } 12 | public void setDeptno(int deptno) { 13 | this.deptno = deptno; 14 | } 15 | public String getDname() { 16 | return dname; 17 | } 18 | public void setDname(String dname) { 19 | this.dname = dname; 20 | } 21 | public String getDescribes() { 22 | return describes; 23 | } 24 | public void setDescribes(String describes) { 25 | this.describes = describes; 26 | } 27 | @Override 28 | public String toString() { 29 | return "Dept [deptno=" + deptno + ", dname=" + dname + ", describes=" 30 | + describes + "]"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/User.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class User { 6 | private String userid; 7 | private String username; 8 | private String passwd; 9 | 10 | public String getUserid() { 11 | return userid; 12 | } 13 | public void setUserid(String userid) { 14 | this.userid = userid; 15 | } 16 | public String getUsername() { 17 | return username; 18 | } 19 | public void setUsername(String username) { 20 | this.username = username; 21 | } 22 | public String getPasswd() { 23 | return passwd; 24 | } 25 | public void setPasswd(String passwd) { 26 | this.passwd = passwd; 27 | } 28 | @Override 29 | public String toString() { 30 | return "User [userid=" + userid + ", username=" + username 31 | + ", passwd=" + passwd + "]"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Clazz.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class Clazz { 6 | private int classid; 7 | private String classtype; 8 | private int intervals; 9 | public int getClassid() { 10 | return classid; 11 | } 12 | public void setClassid(int classid) { 13 | this.classid = classid; 14 | } 15 | public String getClasstype() { 16 | return classtype; 17 | } 18 | public void setClasstype(String classtype) { 19 | this.classtype = classtype; 20 | } 21 | public int getIntervals() { 22 | return intervals; 23 | } 24 | public void setIntervals(int intervals) { 25 | this.intervals = intervals; 26 | } 27 | @Override 28 | public String toString() { 29 | return "Clazz [classid=" + classid + ", classtype=" + classtype 30 | + ", intervals=" + intervals + "]"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/ScheduleSearch.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | 3 | import java.util.Date; 4 | /** 5 | * @author yangjiadi 6 | */ 7 | public class ScheduleSearch { 8 | private int empno; 9 | private Date leftdate; 10 | private Date rightdate; 11 | public int getEmpno() { 12 | return empno; 13 | } 14 | public void setEmpno(int empno) { 15 | this.empno = empno; 16 | } 17 | public Date getLeftdate() { 18 | return leftdate; 19 | } 20 | public void setLeftdate(Date leftdate) { 21 | this.leftdate = leftdate; 22 | } 23 | public Date getRightdate() { 24 | return rightdate; 25 | } 26 | public void setRightdate(Date rightdate) { 27 | this.rightdate = rightdate; 28 | } 29 | @Override 30 | public String toString() { 31 | return "ScheduleSearch [empno=" + empno + ", leftdate=" + leftdate 32 | + ", rightdate=" + rightdate + "]"; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IEmpDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 8 | import com.alibaba.monitor.mavenWeb.pojos.EmpArrayed; 9 | import com.alibaba.monitor.mavenWeb.pojos.EmpSearch; 10 | /** 11 | * @author zhuohaidi 12 | */ 13 | @Repository 14 | public interface IEmpDao{ 15 | public Emp LoadEmp(Emp emp); 16 | public Emp LoadEmpByEmail(Emp emp); 17 | public List LoadAllEmp(Emp emp); 18 | public List LoadEmpByKey(String keyword); 19 | public List loadEmpByEmpsearch(EmpSearch empsearch); 20 | public void AddEmp(Emp emp); 21 | public void AddMulitEmp(List emplist); 22 | public void ModifyEmp(Emp emp); 23 | public void ModifyMulitEmp(EmpArrayed emparrayed); 24 | public void ModifyMulitEmp2(EmpArrayed emparrayed); 25 | public void DeleteEmp(Emp emp); 26 | } -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Schedule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | 3 | import java.util.Date; 4 | /** 5 | * @author yangjiadi 6 | */ 7 | public class Schedule { 8 | private int schno; 9 | private int empno; 10 | private int classid; 11 | private Date Dates; 12 | 13 | public int getSchno() { 14 | return schno; 15 | } 16 | public void setSchno(int schno) { 17 | this.schno = schno; 18 | } 19 | public int getEmpno() { 20 | return empno; 21 | } 22 | public void setEmpno(int empno) { 23 | this.empno = empno; 24 | } 25 | public int getClassid() { 26 | return classid; 27 | } 28 | public void setClassid(int classid) { 29 | this.classid = classid; 30 | } 31 | public Date getDates() { 32 | return Dates; 33 | } 34 | public void setDates(Date dates) { 35 | Dates = dates; 36 | } 37 | @Override 38 | public String toString() { 39 | return "Schedule [schno=" + schno + ", empno=" + empno + ", classid=" 40 | + classid + ", Dates=" + Dates + "]"; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/dist/shiftcfg-ctrl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | paibanControllers.controller('ShiftcfgCtrl', [ '$scope', '$routeParams', 4 | '$http', '$route', function($scope, $routeParams, $http, $route) { 5 | $('#navLink>li').removeClass(); 6 | $('#navLink>li:nth-child(3)').addClass('active'); 7 | 8 | $('#datepicker').datepicker({ 9 | format: 'yyyy-mm', 10 | orientation: "top left" 11 | }) 12 | 13 | 14 | $scope.mode = 1; 15 | // $scope.year = new Date().getFullYear(); 16 | // $scope.month = new Date().getMonth() - (-1); 17 | $scope.message = ''; 18 | $scope.submit = function() { 19 | $http.post("shiftcfg", { 20 | year : $scope.searchDate.substr(0,4), 21 | month : $scope.searchDate.substr(5,2), 22 | mode : $scope.mode 23 | }).success(function(data) { 24 | alert(data.ok); 25 | $scope.message = data.ok; 26 | }).error(function() { 27 | alert("error occured"); 28 | $scope.message = "error occured!!" 29 | }); 30 | } 31 | 32 | } ]); 33 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/dao/IScheduleDao.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.dao; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 9 | import com.alibaba.monitor.mavenWeb.pojos.ScheduleSearch; 10 | /** 11 | * @author zhuohaidi 12 | */ 13 | @Repository 14 | public interface IScheduleDao{ 15 | public Schedule LoadSchedule(Schedule schedule); 16 | public List LoadAllSchedule(Schedule schedule); 17 | public List LoadScheduleByEmpno(int empno); 18 | public Schedule LoadScheduleByEmpTime(Schedule schedule); 19 | public List LoadScheduleBySsearch(ScheduleSearch sdsh); 20 | public List LoadScheduleByDate(Date date); 21 | public void AddSchedule(Schedule schedule); 22 | public void AddMulitSchedule(List schedulelist); 23 | public void ModifySchedule(Schedule schedule); 24 | public void ModifyScheduleByEmpno(Schedule schedule); 25 | public void DeleteSchedule(Schedule schedule); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/IScheduleService.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 9 | import com.alibaba.monitor.mavenWeb.pojos.ScheduleSearch; 10 | /** 11 | * @author zhuohaidi 12 | */ 13 | @Repository 14 | public interface IScheduleService { 15 | public Schedule getSchedule(Schedule schedule); 16 | public Schedule getScheduleByEmpTime(Schedule schedule); 17 | public List getAllSchedule(Schedule schedule); 18 | public List getScheduleByEmpno(int empno); 19 | public List getScheduleBySsearch(ScheduleSearch sdsh); 20 | public List getScheduleByDate(Date date); 21 | public void AddSchedule(Schedule schedule); 22 | public void AddMulitSchedule(List schedulelist); 23 | public void ModifyScheduleByEmpno(Schedule schedule); 24 | public void ModifySchedule(Schedule schedule); 25 | public void DeleteSchedule(Schedule schedule); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/webapp/partials/search.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 | 6 |
7 | 8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 |
16 | 21 |
22 | 23 |
24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
#namedeptname
{{row.empno}}{{row.ename}}{{row.deptName}}
40 |
-------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/M_Schedule.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class M_Schedule { 6 | private int id; 7 | private int empno; 8 | private int years; 9 | private int months; 10 | private boolean flag; 11 | public int getId() { 12 | return id; 13 | } 14 | public void setId(int id) { 15 | this.id = id; 16 | } 17 | public int getEmpno() { 18 | return empno; 19 | } 20 | public void setEmpno(int empno) { 21 | this.empno = empno; 22 | } 23 | public int getYears() { 24 | return years; 25 | } 26 | public void setYears(int years) { 27 | this.years = years; 28 | } 29 | public int getMonths() { 30 | return months; 31 | } 32 | public void setMonths(int months) { 33 | this.months = months; 34 | } 35 | public boolean isFlag() { 36 | return flag; 37 | } 38 | public void setFlag(boolean flag) { 39 | this.flag = flag; 40 | } 41 | @Override 42 | public String toString() { 43 | return "M_Schedule [id=" + id + ", empno=" + empno + ", years=" + years 44 | + ", months=" + months + ", flag=" + flag + "]"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/webapp/dist/stat-ctrl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | paibanControllers.controller('StatCtrl', [ '$scope', '$routeParams', '$http', 4 | '$route', function($scope, $routeParams, $http, $route) { 5 | $('#navLink>li').removeClass(); 6 | $('#navLink>li:nth-child(5)').addClass('active'); 7 | 8 | $http.get("department").success(function (data) { 9 | 10 | 11 | 12 | $scope.allDepartment = data; 13 | }); 14 | 15 | 16 | 17 | $scope.m = $routeParams.m - 0; 18 | 19 | 20 | $scope.d=new Date(); 21 | $scope.d.setMonth($scope.d.getMonth()+$scope.m); 22 | 23 | 24 | 25 | $http.get("statistics?m=" + $routeParams.m).success(function(data) { 26 | data.forEach(function (empl) { 27 | for (var i in $scope.allDepartment) { 28 | if ($scope.allDepartment[i].deptno == empl.deptno) { 29 | empl.deptName = $scope.allDepartment[i].dname; 30 | break; 31 | } 32 | } 33 | }); 34 | $scope.rows = data; 35 | }); 36 | 37 | } ]); 38 | -------------------------------------------------------------------------------- /target/classes/mapper/dept.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 14 | 15 | INSERT INTO dept (dname,describes) 16 | VALUES(#{dname},#{describes}); 17 | 18 | 19 | update dept set dname=#{dname},describes=#{describes} where deptno=#{deptno} 20 | 21 | 22 | delete from dept where deptno=#{deptno}; 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/mapper/dept.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 14 | 15 | INSERT INTO dept (dname,describes) 16 | VALUES(#{dname},#{describes}); 17 | 18 | 19 | update dept set dname=#{dname},describes=#{describes} where deptno=#{deptno} 20 | 21 | 22 | delete from dept where deptno=#{deptno}; 23 | 24 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 11 | 12 | 13 | contextConfigLocation 14 | /WEB-INF/classes/spring-mybatis.xml 15 | 16 | 17 | org.springframework.web.context.ContextLoaderListener 18 | 19 | 20 | 21 | spring 22 | org.springframework.web.servlet.DispatcherServlet 23 | 24 | contextConfigLocation 25 | classpath:spring-servlet.xml 26 | 27 | 1 28 | 29 | 30 | 31 | spring 32 | / 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /target/classes/mapper/clazz.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 13 | 14 | INSERT INTO class (classtype,intervals) 15 | VALUES(#{classtype},#{intervals}); 16 | 17 | 18 | update class set classtype=#{classtype},intervals=#{intervals} where classid=#{classid} 19 | 20 | 21 | delete from class where classid=#{classid}; 22 | 23 | -------------------------------------------------------------------------------- /src/main/resources/mapper/clazz.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 13 | 14 | INSERT INTO class (classtype,intervals) 15 | VALUES(#{classtype},#{intervals}); 16 | 17 | 18 | update class set classtype=#{classtype},intervals=#{intervals} where classid=#{classid} 19 | 20 | 21 | delete from class where classid=#{classid}; 22 | 23 | -------------------------------------------------------------------------------- /src/main/webapp/dist/search-ctrl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | paibanControllers.controller('SearchCtrl', [ 4 | '$scope', 5 | '$routeParams', 6 | '$http', 7 | '$route', 8 | function($scope, $routeParams, $http, $route) { 9 | $('#navLink>li').removeClass(); 10 | $('#navLink>li:nth-child(6)').addClass('active'); 11 | 12 | 13 | 14 | 15 | 16 | $http.get("department").success(function (data) { 17 | $scope.allDepartment = data; 18 | }); 19 | 20 | 21 | $('#datepicker').datepicker({ 22 | format: 'yyyy-mm-dd', 23 | orientation: "top left" 24 | }) 25 | 26 | $scope.search = function() { 27 | var d = $scope.searchDate; 28 | $http.get( 29 | "api?date=" + d) 30 | .success(function(data) { 31 | data.forEach(function (empl) { 32 | for (var i in $scope.allDepartment) { 33 | if ($scope.allDepartment[i].deptno == empl.deptno) { 34 | empl.deptName = $scope.allDepartment[i].dname; 35 | break; 36 | } 37 | } 38 | }); 39 | $scope.rows = data; 40 | }); 41 | } 42 | 43 | } ]); 44 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | paiban 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.m2e.core.maven2Builder 25 | 26 | 27 | 28 | 29 | org.eclipse.wst.validation.validationbuilder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.m2e.core.maven2Nature 39 | org.eclipse.wst.common.project.facet.core.nature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/DedtController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.RequestBody; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RequestMethod; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import com.alibaba.monitor.mavenWeb.pojos.Dept; 12 | import com.alibaba.monitor.mavenWeb.service.IDeptService; 13 | /** 14 | * @author zhuohaidi 15 | */ 16 | @RestController 17 | @RequestMapping("/department") 18 | public class DedtController{ 19 | 20 | @Autowired 21 | IDeptService deptservice; 22 | @RequestMapping(method = RequestMethod.GET) 23 | public List getAllDept (){ 24 | return deptservice.getAllDept(null); 25 | } 26 | 27 | @RequestMapping(value = "/edit", method = RequestMethod.POST) 28 | public String edit(@RequestBody Dept dept) { 29 | deptservice.ModifyDept(dept); 30 | return "{\"ok\":true}"; 31 | } 32 | 33 | @RequestMapping(value = "/add", method = RequestMethod.POST) 34 | public String add(@RequestBody Dept dept) { 35 | deptservice.AddDept(dept); 36 | return "{\"ok\":true}"; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/webapp/dist/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* App Module */ 4 | 5 | var paibanApp = angular.module('paibanApp', 6 | ['ngRoute', 'ngSanitize', 'ngAnimate', 'paibanControllers', 7 | 'paibanServices'/*, 'readerAnimations','readerFilters' */]); 8 | 9 | paibanApp.config(['$routeProvider', function ($routeProvider) { 10 | $routeProvider.when('/employee/:page', { 11 | templateUrl: 'partials/employee.htm', 12 | controller: 'EmployeeCtrl' 13 | }).when('/employee/', { 14 | redirectTo: '/employee/0' 15 | }).when('/department', { 16 | templateUrl: 'partials/department.htm', 17 | controller: 'DepartmentCtrl' 18 | }).when('/shift/:week/:deptno', { 19 | templateUrl: 'partials/shift.html', 20 | controller: 'ShiftCtrl' 21 | }).when('/shiftcfg', { 22 | templateUrl: 'partials/shiftcfg.html', 23 | controller: 'ShiftcfgCtrl' 24 | }).when('/stat/:m', { 25 | templateUrl: 'partials/stat.html', 26 | controller: 'StatCtrl' 27 | }).when('/search', { 28 | templateUrl: 'partials/search.html', 29 | controller: 'SearchCtrl' 30 | }).when('/about', { 31 | templateUrl: 'partials/help.html', 32 | }).otherwise({ 33 | redirectTo: '/employee/0' 34 | }); 35 | }]); 36 | 37 | 38 | var paibanControllers = angular.module('paibanControllers', []); 39 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/contral/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.contral; 2 | 3 | import java.security.MessageDigest; 4 | /** 5 | * @author zhuohaidi 6 | */ 7 | public class MD5Util { 8 | public final static String MD5(String s) { 9 | char hexDigits[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; 10 | 11 | try { 12 | byte[] btInput = s.getBytes(); 13 | // 获得MD5摘要算法的 MessageDigest 对象 14 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); 15 | // 使用指定的字节更新摘要 16 | mdInst.update(btInput); 17 | // 获得密文 18 | byte[] md = mdInst.digest(); 19 | // 把密文转换成十六进制的字符串形式 20 | int j = md.length; 21 | char str[] = new char[j * 2]; 22 | int k = 0; 23 | for (int i = 0; i < j; i++) { 24 | byte byte0 = md[i]; 25 | str[k++] = hexDigits[byte0 >>> 4 & 0xf]; 26 | str[k++] = hexDigits[byte0 & 0xf]; 27 | } 28 | return new String(str); 29 | } catch (Exception e) { 30 | e.printStackTrace(); 31 | return null; 32 | } 33 | } 34 | 35 | public static void main(String[] args) { 36 | System.out.println(MD5Util.MD5("admin")); 37 | System.out.println(MD5Util.MD5("加密")); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/webapp/dist/dept-ctrl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | paibanControllers.controller('DepartmentCtrl', ['$scope', '$routeParams', 4 | '$http', '$route', function ($scope, $routeParams, $http, $route) { 5 | $('#navLink>li').removeClass(); 6 | $('#navLink>li:nth-child(2)').addClass('active'); 7 | 8 | 9 | $http.get("department").success(function (data) { 10 | $scope.allDepartment = data; 11 | }); 12 | $scope.add = function () { 13 | $scope.selectedDept = null; 14 | $('#deptModal').modal('show'); 15 | } 16 | 17 | $scope.edit = function (dept) { 18 | $scope.selectedDept = JSON.parse(JSON.stringify(dept)); 19 | $('#deptModal').modal('show'); 20 | } 21 | 22 | $('#deptModal').modal('hide'); 23 | 24 | $scope.save = function () { 25 | var dept = $scope.selectedDept; 26 | if (dept) { 27 | console.log(dept); 28 | var url = 'department/'+(dept.deptno?'edit':'add'); 29 | $http.post(url, dept).success(function () { 30 | $('#deptModal').modal('hide'); 31 | $('#deptModal').on('hidden.bs.modal', function (e) { 32 | $route.reload(); 33 | }) 34 | 35 | }).error(); 36 | } 37 | } 38 | 39 | 40 | }]); 41 | -------------------------------------------------------------------------------- /src/main/webapp/partials/stat.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 |
7 | 12 |
13 | 14 |
15 |
16 |
17 |

{{d.getFullYear()}}-{{d.getMonth()+1}}

18 |
19 | 20 |
21 | 22 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
#姓名部门总工时白班夜班正常班休假
{{row.empno}}{{row.ename}}{{row.deptName}}{{row.totalhours}}{{row.dayshift}}{{row.nightshift}}{{row.normalshift}}{{row.holidayshift}}
54 | 55 |
-------------------------------------------------------------------------------- /src/main/webapp/partials/shiftcfg.html: -------------------------------------------------------------------------------- 1 |
2 |
5 |
8 |
11 |
14 | 15 | 16 | 17 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 |
29 |
    30 |
  • 31 |

    周期性排班(正常班)

    32 | 33 |

    工作日(工作日上班,周六周日放假) 34 |

    35 |
  • 36 | 37 |
  • 38 |

    模式一(正常班)

    39 | 40 |

    自然天(轮休制:每天都有人上班) 41 | 规则:在保证员工一周上班小时数不超过40的情况下,只排正常班。 42 |

    43 |
  • 44 |
  • 45 |

    模式二(白班、夜班)

    46 | 47 |

    自然天(轮休制:每天都有人上班) 48 | 规则:在保证员工一周上班小时数不超过40的情况下,只排白、夜班。 49 |

    50 | 51 | 52 |
  • 53 |
  • 54 |

    模式三(白班、夜班、正常班)

    55 | 56 |

    自然天(轮休制:每天都有人上班) 57 | 规则:在保证员工一周上班小时数不超过40且每种班每天都有人值班的情况下,轮流排白、夜、正常班。 58 |

    59 | 60 |
  • 61 |
62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/M_ScheduleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 10 | import com.alibaba.monitor.mavenWeb.dao.IM_ScheduleDao; 11 | import com.alibaba.monitor.mavenWeb.pojos.Log; 12 | import com.alibaba.monitor.mavenWeb.pojos.M_Schedule; 13 | import com.alibaba.monitor.mavenWeb.service.IM_ScheduleService; 14 | @Service 15 | public class M_ScheduleServiceImpl implements IM_ScheduleService{ 16 | 17 | @Autowired 18 | IM_ScheduleDao mscheduledao; 19 | @Autowired 20 | ILogDao logdao; 21 | @Override 22 | public M_Schedule getMScheduleByEmpno(M_Schedule mschedule) { 23 | // TODO Auto-generated method stub 24 | return mscheduledao.LoadMScheduleByEmpno(mschedule); 25 | } 26 | 27 | @Override 28 | public void AddMSchedule(M_Schedule mschedule) { 29 | // TODO Auto-generated method stub 30 | Log log=new Log(); 31 | log.setEmpno(1); 32 | log.setDates(new Date()); 33 | log.setTablename("m_schedule"); 34 | log.setOperate("add"); 35 | log.setBfupdate(""); 36 | log.setUpdated(mschedule.toString()); 37 | logdao.AddLog(log); 38 | mscheduledao.AddMSchedule(mschedule); 39 | } 40 | 41 | @Override 42 | public void AddMulitMSchedule(List mschedulelist) { 43 | // TODO Auto-generated method stub 44 | for(int i=0;i getArrayger(List emplist, int year, int month,int day){ 20 | this.n = emplist.size(); 21 | this.year=year; 22 | this.month=month; 23 | this.daysOfmonth = DateAction.daysOfmonth(year, month); 24 | method(); 25 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 26 | List schlist = new ArrayList(); 27 | for (int i = 0; i < n; i++) { 28 | for (int j = day; j <= daysOfmonth; j++){ 29 | Schedule sch = new Schedule(); 30 | sch.setEmpno(emplist.get(i).getEmpno()); 31 | sch.setClassid(shift[j]); 32 | try { 33 | sch.setDates(sdf.parse(year + "-" + month + "-" + j)); 34 | } catch (ParseException e) {} 35 | //System.out.println(sch.toString()); 36 | schlist.add(sch); 37 | } 38 | } 39 | return schlist; 40 | } 41 | private void method() 42 | { 43 | shift=new int[daysOfmonth+1]; 44 | for(int i=1;i<=daysOfmonth;i++) 45 | { 46 | int day=DateAction.DayOfWeekWhithInt(year+"-"+month+"-"+i); 47 | if(day==6||day==0) shift[i]=4; 48 | else shift[i]=3; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Log.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | 3 | import java.util.Date; 4 | /** 5 | * @author yangjiadi 6 | */ 7 | public class Log { 8 | private int logid; 9 | private int empno; 10 | private Date dates; 11 | private String tablename; 12 | private String operate; 13 | private String bfupdate; 14 | private String updated; 15 | public int getLogid() { 16 | return logid; 17 | } 18 | public void setLogid(int logid) { 19 | this.logid = logid; 20 | } 21 | 22 | public int getEmpno() { 23 | return empno; 24 | } 25 | public void setEmpno(int empno) { 26 | this.empno = empno; 27 | } 28 | public Date getDates() { 29 | return dates; 30 | } 31 | public void setDates(Date dates) { 32 | this.dates = dates; 33 | } 34 | public String getTablename() { 35 | return tablename; 36 | } 37 | public void setTablename(String tablename) { 38 | this.tablename = tablename; 39 | } 40 | public String getOperate() { 41 | return operate; 42 | } 43 | public void setOperate(String operate) { 44 | this.operate = operate; 45 | } 46 | public String getBfupdate() { 47 | return bfupdate; 48 | } 49 | public void setBfupdate(String bfupdate) { 50 | this.bfupdate = bfupdate; 51 | } 52 | public String getUpdated() { 53 | return updated; 54 | } 55 | public void setUpdated(String updated) { 56 | this.updated = updated; 57 | } 58 | @Override 59 | public String toString() { 60 | return "Log [logid=" + logid + ", empno=" + empno + ", dates=" + dates 61 | + ", tablename=" + tablename + ", operate=" + operate 62 | + ", bfupdate=" + bfupdate + ", updated=" + updated + "]"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/webapp/partials/shift.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 9 |
10 |
11 | 14 | 15 |
16 | 17 | 18 |
19 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 48 | 49 |
idnamedept{{w | date:'M-d-EEE'}}
{{tb.emp.empno}}{{tb.emp.ename}}{{tb.emp.deptName}} 38 |
{{b==4?'休息':b==1?'白班':b==2?'夜班':b==3?'正常班':''}}
39 | 40 | 47 |
-------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/ScheduleAPIController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import com.alibaba.monitor.mavenWeb.contral.DateAction; 14 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 15 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 16 | import com.alibaba.monitor.mavenWeb.service.IEmpService; 17 | import com.alibaba.monitor.mavenWeb.service.IScheduleService; 18 | /** 19 | * @author zhuohaidi 20 | */ 21 | @Controller 22 | public class ScheduleAPIController{ 23 | 24 | @Autowired 25 | IScheduleService scheduleService; 26 | @Autowired 27 | IEmpService empService; 28 | @RequestMapping(value = "/api",method = RequestMethod.GET) 29 | @ResponseBody 30 | public List test (String date){ 31 | Date dates; 32 | List emplist=new ArrayList(); 33 | try { 34 | dates = DateAction.StringtoDate(date); 35 | } catch (Exception e) { 36 | return emplist; 37 | } 38 | 39 | if(dates==null) return emplist; 40 | List schedulelist=scheduleService.getScheduleByDate(dates); 41 | for(int i=0;i 2 | 5 | 6 | 7 | 8 | 12 | 16 | 22 | 23 | INSERT INTO statistics 24 | (months,years,empno,totalhours,dayshift,nightshift,normalshift,holidayshift) 25 | VALUES(#{months},#{years},#{empno},#{totalhours},#{dayshift},#{nightshift},#{normalshift},#{holidayshift}); 26 | 27 | 28 | update statistics 29 | set 30 | months=#{months},years=#{years},empno=#{empno},totalhours=#{totalhours},dayshift=#{dayshift},nightshift=#{nightshift},normalshift=#{normalshift},holidayshift=#{holidayshift} 31 | where stano=#{stano}; 32 | 33 | 34 | delete from 35 | statistics where stano=#{stano}; 36 | 37 | -------------------------------------------------------------------------------- /target/classes/mapper/statistics.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 12 | 16 | 22 | 23 | INSERT INTO statistics 24 | (months,years,empno,totalhours,dayshift,nightshift,normalshift,holidayshift) 25 | VALUES(#{months},#{years},#{empno},#{totalhours},#{dayshift},#{nightshift},#{normalshift},#{holidayshift}); 26 | 27 | 28 | update statistics 29 | set 30 | months=#{months},years=#{years},empno=#{empno},totalhours=#{totalhours},dayshift=#{dayshift},nightshift=#{nightshift},normalshift=#{normalshift},holidayshift=#{holidayshift} 31 | where stano=#{stano}; 32 | 33 | 34 | delete from 35 | statistics where stano=#{stano}; 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | import com.alibaba.monitor.mavenWeb.contral.MD5Util; 11 | import com.alibaba.monitor.mavenWeb.pojos.User; 12 | import com.alibaba.monitor.mavenWeb.service.IUserService; 13 | /** 14 | * @author zhuohaidi 15 | */ 16 | @Controller 17 | public class LoginController { 18 | 19 | @Autowired 20 | IUserService userService; 21 | @RequestMapping(value = "/login.html") 22 | public String login (HttpServletRequest request,Model model){ 23 | User user=(User)request.getSession().getAttribute("user"); 24 | if(user!=null) return "redirect:home"; 25 | String username=(String)request.getParameter("username"); 26 | String password=(String)request.getParameter("password"); 27 | if(username==null) 28 | { 29 | return "login"; 30 | } 31 | if(username.equals("")) 32 | { 33 | model.addAttribute("result","用户名不能为空"); 34 | return "login"; 35 | } 36 | else if(password==null||password.equals("")) 37 | { 38 | model.addAttribute("result","密码不能为空"); 39 | return "login"; 40 | } 41 | else 42 | { 43 | user=new User(); 44 | user.setUserid(username); 45 | user=userService.getUser(user); 46 | password=MD5Util.MD5(password); 47 | 48 | if(user!=null&&user.getPasswd().equals(password)) 49 | { 50 | request.getSession().setAttribute("user", user); 51 | return "redirect:home"; 52 | } 53 | else 54 | { 55 | model.addAttribute("result","用户名或密码错误"); 56 | return "login"; 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /target/classes/spring-mybatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 11 | classpath:jdbc.properties 12 | 13 | 14 | 15 | 16 | 18 | 19 | ${app.url} 20 | 21 | 22 | ${app.username} 23 | 24 | 25 | ${app.password} 26 | 27 | 28 | 29 | 30 | 33 | 35 | 36 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/resources/spring-mybatis.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 11 | classpath:jdbc.properties 12 | 13 | 14 | 15 | 16 | 18 | 19 | ${app.url} 20 | 21 | 22 | ${app.username} 23 | 24 | 25 | ${app.password} 26 | 27 | 28 | 29 | 30 | 33 | 35 | 36 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/ArrayClassServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Service; 6 | 7 | import com.alibaba.monitor.mavenWeb.contral.ArrayClassModeFourAction; 8 | import com.alibaba.monitor.mavenWeb.contral.ArrayClassModeOneAction; 9 | import com.alibaba.monitor.mavenWeb.contral.ArrayClassModeThreeAction; 10 | import com.alibaba.monitor.mavenWeb.contral.ArrayClassModeTwoAction; 11 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 12 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 13 | import com.alibaba.monitor.mavenWeb.service.IArrayClassService; 14 | /** 15 | * @author zhuohaidi 16 | */ 17 | @Service 18 | public class ArrayClassServiceImpl implements IArrayClassService { 19 | 20 | @Override 21 | public List ModeZero(List emplist,int year,int month,int day) { 22 | // TODO Auto-generated method stub 23 | 24 | return new ArrayClassModeOneAction().getArrayger(emplist,year,month,day); 25 | } 26 | 27 | @Override 28 | public List ModeOne(List emplist,int year,int month,int day) { 29 | // TODO Auto-generated method stub 30 | 31 | return new ArrayClassModeOneAction().getArrayger(emplist,year,month,day); 32 | } 33 | 34 | @Override 35 | public List ModeTow(List emplist,int year,int month,int day) { 36 | // TODO Auto-generated method stub 37 | return new ArrayClassModeTwoAction().getArrayger(emplist, year, month,day); 38 | } 39 | 40 | @Override 41 | public List ModeThree(List emplist,int year,int month,int day) { 42 | // TODO Auto-generated method stub 43 | return new ArrayClassModeThreeAction().getArrayger(emplist, year, month,day); 44 | } 45 | 46 | @Override 47 | public List ModeFour(List emplist, int year, int month, 48 | int day) { 49 | // TODO Auto-generated method stub 50 | return new ArrayClassModeFourAction().getArrayger(emplist, year, month, day); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/webapp/partials/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 自动排班系统帮助文档 4 | 5 | 6 | 7 | 8 |

操作流程

9 |

登录、退出排班系统

10 |

1.公司管理员通过输入已有的Userid、Password进入我们的主页。

11 |

2.公司管理员来到主页,点击“退出”按钮,即可退出排班系统。

12 |

人员管理

13 |

一.人员添加

14 |

1.公司管理员可点击“添加”按钮,直接添加员工信息;

15 |

2.公司管理员可点击“模板下载”按钮,下载网站提供的人员添加模板;将模板填写完整后,再点击“导入”按钮,将人员信息导入

16 |

二.人员信息编辑

17 |

1.公司管理员可点击“修改”按钮,修改员工信息;

18 |

2.公司管理员可点击“删除”按钮,删除员工信息;

19 |

三.人员信息查找

20 |

1.公司管理员可在人员姓名搜索框输入需查找的名字,进行人员信息查找;

21 |

2.公司管理员可在部门搜索框选择需查找的部门,进行部门信息查找;

22 |

3.公司管理员可在人员姓名搜索框输入需查找的名字、同时在部门搜索框选择需查找的部门,进行人员信息的精确查找;

23 |

四.人员是否排班选择

24 |

1.查找到员工信息后,点击“checkall/uncheckall”,来确定员工是否参与排班;

25 |

部门管理

26 |

一.部门添加

27 |

1.公司管理员可点击“添加”按钮,直接添加部门信息;

28 |

二.部门修改

29 |

1.公司管理员可点击“修改”按钮,直接修改部门信息;

30 |

排班管理

31 |

一.排班模式选择

32 |

1.公司管理员可根据网站所提供的模式,来选择合适的排班模式,;

33 |

一.排班年、月选择

34 |

1.公司管理员可根据网站所提供的年、月,来选择自己所需的排班年、月,点击“submit”按钮提交;

35 |

班次管理

36 |

二.部门信息查找

37 |

1.公司管理员可在部门搜索框选择需查找的部门,进行部门信息查找;

38 |

三.人员班次信息编辑

39 |

1.公司管理员勾选“打开编辑”,编辑相关人员的班次情况;

40 |

2.公司管理员再次勾选“打开编辑”,关闭编辑;

41 |

四.导出班次表

42 |

1.公司管理员点击“导出”,导出相应班次表;

43 |

五.翻页

44 |

1.公司管理员在本页找不到相关人员的信息时,可点击“Previous week”或“Next week”按钮,来进行上一页、下一页操作;

45 |

班次统计

46 |

一.人员工时信息查找

47 |

1.公司管理员可在人员姓名搜索框输入需查找的名字,进行人员班次工时情况查找;

48 |

2.公司管理员可在部门搜索框选择需查找的部门,进行人员班次工时情况查找;

49 |

3.公司管理员可在人员姓名搜索框输入需查找的名字、同时在部门搜索框选择需查找的部门,进行人员班次工时情况的精确查找;

50 |

二.翻页

51 |

1.公司管理员在本页找不到相关人员的信息时,可点击“Previous month”或“Next month”按钮,来进行上一页、下一页操作;

52 |

日期检索

53 |

一.日期查找

54 |

1.公司管理员可在日期搜索框选择相应日期,进行某日人员班次工时情况查找;

55 |

二.人员值班信息查找

56 |

1.公司管理员可在人员姓名搜索框输入需查找的名字,进行人员值班信息情况查找;

57 |

2.公司管理员可在部门搜索框选择需查找的部门,进行人员值班信息情况查找;

58 |

3.公司管理员可在人员姓名搜索框输入需查找的名字、同时在部门搜索框选择需查找的部门,进行人员值班信息情况的精确查找;

59 |

60 | 61 | -------------------------------------------------------------------------------- /src/main/webapp/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 阿里排班系统 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 37 | 38 |
39 |
40 |

404

41 | 42 |

43 | 请勿攻击网站。。。 44 |

45 | 46 |

47 | « 返回 48 |

49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Emp.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | /** 5 | * @author yangjiadi 6 | */ 7 | public class Emp { 8 | private int empno; 9 | private String ename; 10 | private int deptno; 11 | private String ephone; 12 | private String eemail; 13 | private String eaddress; 14 | @JsonIgnore 15 | private String passWord; 16 | private boolean arrayed=true; 17 | private boolean deleted; 18 | public int getEmpno() { 19 | return empno; 20 | } 21 | public void setEmpno(int empno) { 22 | this.empno = empno; 23 | } 24 | public String getEname() { 25 | return ename; 26 | } 27 | public void setEname(String ename) { 28 | this.ename = ename; 29 | } 30 | public int getDeptno() { 31 | return deptno; 32 | } 33 | public void setDeptno(int deptno) { 34 | this.deptno = deptno; 35 | } 36 | public String getEphone() { 37 | return ephone; 38 | } 39 | public void setEphone(String ephone) { 40 | this.ephone = ephone; 41 | } 42 | public String getEemail() { 43 | return eemail; 44 | } 45 | public void setEemail(String eemail) { 46 | this.eemail = eemail; 47 | } 48 | public String getEaddress() { 49 | return eaddress; 50 | } 51 | public void setEaddress(String eaddress) { 52 | this.eaddress = eaddress; 53 | } 54 | 55 | public String getPassWord() { 56 | return passWord; 57 | } 58 | public void setPassWord(String passWord) { 59 | this.passWord = passWord; 60 | } 61 | 62 | public boolean isDeleted() { 63 | return deleted; 64 | } 65 | 66 | public boolean isArrayed() { 67 | return arrayed; 68 | } 69 | public void setArrayed(boolean arrayed) { 70 | this.arrayed = arrayed; 71 | } 72 | public void setDeleted(boolean deleted) { 73 | this.deleted = deleted; 74 | } 75 | @Override 76 | public String toString() { 77 | return "Emp [empno=" + empno + ", ename=" + ename + ", deptno=" 78 | + deptno + ", ephone=" + ephone + ", eemail=" + eemail 79 | + ", eaddress=" + eaddress + ", passWord=" + passWord 80 | + ", arrayed=" + arrayed + ", deleted=" + deleted + "]"; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 阿里排班系统 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 37 | 38 |
39 |
40 |

Make It Simple.

41 | 42 |

43 | 最简洁的排班系统 44 |

45 | 46 |

47 | Start » 48 |

49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/DeptServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.alibaba.monitor.mavenWeb.dao.IDeptDao; 10 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 11 | import com.alibaba.monitor.mavenWeb.pojos.Dept; 12 | import com.alibaba.monitor.mavenWeb.pojos.Log; 13 | import com.alibaba.monitor.mavenWeb.service.IDeptService; 14 | /** 15 | * @author zhuohaidi 16 | */ 17 | @Service 18 | public class DeptServiceImpl implements IDeptService { 19 | 20 | @Autowired 21 | IDeptDao deptDao; 22 | @Autowired 23 | ILogDao logdao; 24 | @Override 25 | public Dept getDept(Dept dept) { 26 | // TODO Auto-generated method stub 27 | return deptDao.LoadDept(dept); 28 | } 29 | 30 | @Override 31 | public List getAllDept(Dept dept) { 32 | // TODO Auto-generated method stub 33 | return deptDao.LoadAllDept(dept); 34 | } 35 | 36 | @Override 37 | public void AddDept(Dept dept) { 38 | // TODO Auto-generated method stub 39 | 40 | Log log=new Log(); 41 | log.setEmpno(1); 42 | log.setDates(new Date()); 43 | log.setTablename("dept"); 44 | log.setOperate("add"); 45 | log.setBfupdate(""); 46 | log.setUpdated(dept.toString()); 47 | logdao.AddLog(log); 48 | deptDao.AddDept(dept); 49 | } 50 | 51 | @Override 52 | public void ModifyDept(Dept dept) { 53 | // TODO Auto-generated method stub 54 | 55 | Log log=new Log(); 56 | log.setEmpno(1); 57 | log.setDates(new Date()); 58 | log.setTablename("dept"); 59 | log.setOperate("update"); 60 | log.setBfupdate(deptDao.LoadDept(dept).toString()); 61 | log.setUpdated(dept.toString()); 62 | logdao.AddLog(log); 63 | deptDao.ModifyDept(dept); 64 | } 65 | 66 | @Override 67 | public void DeleteDept(Dept dept) { 68 | // TODO Auto-generated method stub 69 | 70 | Log log=new Log(); 71 | log.setEmpno(1); 72 | log.setDates(new Date()); 73 | log.setTablename("dept"); 74 | log.setOperate("delete"); 75 | log.setBfupdate(deptDao.LoadDept(dept).toString()); 76 | log.setUpdated(""); 77 | logdao.AddLog(log); 78 | deptDao.DeleteDept(dept); 79 | } 80 | 81 | @Override 82 | public void AddmultiDept(List deptlist) { 83 | // TODO Auto-generated method stub 84 | for(int i=0;i getAllClass(Clazz clazz) { 32 | // TODO Auto-generated method stub 33 | return classdao.LoadAllClass(clazz); 34 | } 35 | 36 | @Override 37 | public void AddClass(Clazz clazz) { 38 | // TODO Auto-generated method stub 39 | 40 | Log log=new Log(); 41 | log.setEmpno(1); 42 | log.setDates(new Date()); 43 | log.setTablename("clazz"); 44 | log.setOperate("add"); 45 | log.setBfupdate(""); 46 | log.setUpdated(clazz.toString()); 47 | logdao.AddLog(log); 48 | classdao.AddClass(clazz); 49 | } 50 | 51 | @Override 52 | public void ModifyClass(Clazz clazz) { 53 | // TODO Auto-generated method stub 54 | 55 | Log log=new Log(); 56 | log.setEmpno(1); 57 | log.setDates(new Date()); 58 | log.setTablename("clazz"); 59 | log.setOperate("update"); 60 | log.setBfupdate(classdao.LoadClass(clazz).toString()); 61 | log.setUpdated(clazz.toString()); 62 | logdao.AddLog(log); 63 | classdao.ModifyClass(clazz); 64 | } 65 | 66 | @Override 67 | public void DeleteClass(Clazz clazz) { 68 | // TODO Auto-generated method stub 69 | 70 | Log log=new Log(); 71 | log.setEmpno(1); 72 | log.setDates(new Date()); 73 | log.setTablename("clazz"); 74 | log.setOperate("delete"); 75 | log.setBfupdate(classdao.LoadClass(clazz).toString()); 76 | log.setUpdated(""); 77 | logdao.AddLog(log); 78 | classdao.DeleteClass(clazz); 79 | } 80 | 81 | @Override 82 | public void AddmultiClass(List clazzlist) { 83 | // TODO Auto-generated method stub 84 | for(int i=0;i 2 | 5 | 6 | 7 | 10 | 13 | 16 | 19 | 22 | 25 | 26 | INSERT INTO schedule (empno,classid,Dates) 27 | VALUES(#{empno},#{classid},#{Dates}); 28 | 29 | 30 | INSERT INTO schedule (empno,classid,Dates) 31 | VALUES 32 | 33 | (#{item.empno},#{item.classid},#{item.Dates}) 34 | 35 | 36 | 37 | update schedule set empno=#{empno},classid=#{classid},Dates=#{Dates} where schno=#{schno} 38 | 39 | 40 | update schedule set classid=#{classid} where empno=#{empno} and Dates=#{Dates}; 41 | 42 | 43 | delete from schedule where schno=#{schno}; 44 | 45 | -------------------------------------------------------------------------------- /target/classes/mapper/schedule.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 10 | 13 | 16 | 19 | 22 | 25 | 26 | INSERT INTO schedule (empno,classid,Dates) 27 | VALUES(#{empno},#{classid},#{Dates}); 28 | 29 | 30 | INSERT INTO schedule (empno,classid,Dates) 31 | VALUES 32 | 33 | (#{item.empno},#{item.classid},#{item.Dates}) 34 | 35 | 36 | 37 | update schedule set empno=#{empno},classid=#{classid},Dates=#{Dates} where schno=#{schno} 38 | 39 | 40 | update schedule set classid=#{classid} where empno=#{empno} and Dates=#{Dates}; 41 | 42 | 43 | delete from schedule where schno=#{schno}; 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/Test2Controller.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 14 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 15 | import com.alibaba.monitor.mavenWeb.service.IArrayClassService; 16 | import com.alibaba.monitor.mavenWeb.service.IClassService; 17 | import com.alibaba.monitor.mavenWeb.service.IDeptService; 18 | import com.alibaba.monitor.mavenWeb.service.IEmpService; 19 | import com.alibaba.monitor.mavenWeb.service.ILogService; 20 | import com.alibaba.monitor.mavenWeb.service.IM_ScheduleService; 21 | import com.alibaba.monitor.mavenWeb.service.IScheduleService; 22 | import com.alibaba.monitor.mavenWeb.service.IUserService; 23 | /** 24 | * @author yangjiadi 25 | */ 26 | @Controller 27 | 28 | public class Test2Controller{ 29 | 30 | @Autowired 31 | ILogService logservice; 32 | @Autowired 33 | IEmpService empservice; 34 | @Autowired 35 | IDeptService deptservice; 36 | @Autowired 37 | IClassService classService; 38 | @Autowired 39 | IArrayClassService arrayclassservice; 40 | @Autowired 41 | IScheduleService scheduleservice; 42 | @Autowired 43 | IM_ScheduleService mscheduleservice; 44 | @Autowired 45 | IUserService userservice; 46 | @RequestMapping("/test2") 47 | @ResponseBody 48 | public Object test (HttpServletRequest request,Model model){ 49 | 50 | List emplist=empservice.getEmpByKey("",2); 51 | // for(int i=0;i schedulelist=arrayclassservice.ModeThree(emplist, 2015, 7, 1); 58 | for(int i=0;i userlist=new ArrayList(); 64 | // User user=new User(); 65 | // user.setUsername("abc"); 66 | // user.setPasswd("111"); 67 | // User user2=new User(); 68 | // user2.setUsername("abcd"); 69 | // user2.setPasswd("111"); 70 | // User user3=new User(); 71 | // user3.setUsername("abce"); 72 | // user3.setPasswd("111"); 73 | // userlist.add(user); 74 | // userlist.add(user2); 75 | // userlist.add(user3); 76 | // userservice.AddMulitUser(userlist); 77 | // return userlist; 78 | } 79 | } -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/EmpController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestBody; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 13 | import com.alibaba.monitor.mavenWeb.pojos.EmpArrayed; 14 | import com.alibaba.monitor.mavenWeb.service.IEmpService; 15 | /** 16 | * @author zhuohaidi 17 | */ 18 | @RestController 19 | @RequestMapping("/employee") 20 | public class EmpController { 21 | 22 | @Autowired 23 | IEmpService empservice; 24 | 25 | @RequestMapping(method = RequestMethod.GET) 26 | public List getAllEmp() { 27 | return empservice.getAllEmp(null); 28 | } 29 | 30 | @RequestMapping(value = "/search", method = RequestMethod.POST) 31 | public List searchEmp(@RequestBody String keyword, 32 | @RequestBody String deptno) { 33 | int deptnum = Integer.parseInt(deptno); 34 | return empservice.getEmpByKey(keyword, deptnum); 35 | } 36 | 37 | @RequestMapping(value = "/batchAdd", method = RequestMethod.POST) 38 | public String batchAdd(@RequestBody List emplist) { 39 | empservice.AddMulitEmp(emplist); 40 | return "{\"ok\":true}"; 41 | } 42 | 43 | @RequestMapping("/delete/{id}") 44 | public String delete(@PathVariable int id) { 45 | Emp emp = new Emp(); 46 | emp.setEmpno(id); 47 | empservice.DeleteEmp(emp); 48 | return "{\"ok\":true}"; 49 | } 50 | 51 | @RequestMapping(value = "/edit", method = RequestMethod.POST) 52 | public String edit(@RequestBody Emp empl) { 53 | // System.out.println(empl); 54 | empservice.ModifyEmp(empl); 55 | return "{\"ok\":true}"; 56 | } 57 | @RequestMapping(value = "/batchEdit", method = RequestMethod.GET) 58 | public String batchEdit(Integer deptno,Integer chose , String keyword) 59 | { 60 | if(deptno==null) deptno=0; 61 | if(chose==null) chose=1; 62 | boolean chosed=true; 63 | if(chose==0) chosed=false; 64 | if(keyword==null) keyword=""; 65 | EmpArrayed emparrayed=new EmpArrayed(); 66 | emparrayed.setArrayed(chosed); 67 | emparrayed.setDeptno(deptno); 68 | emparrayed.setKeyword(keyword); 69 | empservice.ModifyMulitEmp(emparrayed); 70 | return "{\"ok\":true}"; 71 | } 72 | @RequestMapping(value = "/add", method = RequestMethod.POST) 73 | public String add(@RequestBody Emp empl) { 74 | // System.out.println(empl); 75 | empservice.AddEmp(empl); 76 | return "{\"ok\":true}"; 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/pojos/Statistics.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.pojos; 2 | /** 3 | * @author yangjiadi 4 | */ 5 | public class Statistics { 6 | private int stano; 7 | private int empno; 8 | private String ename; 9 | private int deptno; 10 | private int years; 11 | private int months; 12 | private int totalhours; 13 | private int dayshift; 14 | private int nightshift; 15 | private int normalshift; 16 | private int holidayshift; 17 | public int getStano() { 18 | return stano; 19 | } 20 | public void setStano(int stano) { 21 | this.stano = stano; 22 | } 23 | 24 | public String getEname() { 25 | return ename; 26 | } 27 | public void setEname(String ename) { 28 | this.ename = ename; 29 | } 30 | 31 | public int getDeptno() { 32 | return deptno; 33 | } 34 | public void setDeptno(int deptno) { 35 | this.deptno = deptno; 36 | } 37 | public int getMonths() { 38 | return months; 39 | } 40 | public void setMonths(int months) { 41 | this.months = months; 42 | } 43 | public int getEmpno() { 44 | return empno; 45 | } 46 | public void setEmpno(int empno) { 47 | this.empno = empno; 48 | } 49 | public int getYears() { 50 | return years; 51 | } 52 | public void setYears(int years) { 53 | this.years = years; 54 | } 55 | public int getTotalhours() { 56 | return totalhours; 57 | } 58 | public void setTotalhours(int totalhours) { 59 | this.totalhours = totalhours; 60 | } 61 | public int getDayshift() { 62 | return dayshift; 63 | } 64 | public void setDayshift(int dayshift) { 65 | this.dayshift = dayshift; 66 | } 67 | public int getNightshift() { 68 | return nightshift; 69 | } 70 | public void setNightshift(int nightshift) { 71 | this.nightshift = nightshift; 72 | } 73 | public int getNormalshift() { 74 | return normalshift; 75 | } 76 | public void setNormalshift(int normalshift) { 77 | this.normalshift = normalshift; 78 | } 79 | public int getHolidayshift() { 80 | return holidayshift; 81 | } 82 | public void setHolidayshift(int holidayshift) { 83 | this.holidayshift = holidayshift; 84 | } 85 | public void cntTotalhours() 86 | { 87 | this.totalhours = this.dayshift * 10 + this.nightshift * 10 88 | + this.normalshift * 8; 89 | } 90 | @Override 91 | public String toString() { 92 | return "Statistics [stano=" + stano + ", empno=" + empno + ", ename=" 93 | + ename + ", deptno=" + deptno + ", years=" + years 94 | + ", months=" + months + ", totalhours=" + totalhours 95 | + ", dayshift=" + dayshift + ", nightshift=" + nightshift 96 | + ", normalshift=" + normalshift + ", holidayshift=" 97 | + holidayshift + "]"; 98 | } 99 | 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/webapp/dist/paiban.css: -------------------------------------------------------------------------------- 1 | .color1{ 2 | background-color:#56B156; 3 | } 4 | .color2{ 5 | background-color:grey; 6 | } 7 | .color3{ 8 | background-color:#EAEAEA; 9 | } 10 | 11 | .color4{ 12 | background-color:#52BCDC; 13 | } 14 | 15 | /* 16 | * Base structure 17 | */ 18 | 19 | /* Move down content because we have a fixed navbar that is 50px tall */ 20 | body { 21 | padding-top: 60px; 22 | } 23 | 24 | img{ 25 | max-width: 100%; 26 | } 27 | 28 | .classA A:link {color:red;text-decoration:none;} 29 | .classA A:visited {color:red;text-decoration:none;} 30 | .classA A:active {color:red;text-decoration:none;} 31 | .classA A:hover {color:red;text-decoration:underline;} 32 | 33 | /* 34 | * Global add-ons 35 | */ 36 | .sub-header { 37 | padding-bottom: 10px; 38 | border-bottom: 1px solid #eee; 39 | } 40 | 41 | /* 42 | * Top navigation 43 | * Hide default border to remove 1px line. 44 | */ 45 | .navbar-fixed-top { 46 | border: 0; 47 | } 48 | 49 | /* 50 | * Sidebar 51 | */ 52 | 53 | /* Hide for mobile, show later */ 54 | .sidebar { 55 | display: none; 56 | } 57 | 58 | @media ( min-width : 768px) { 59 | .sidebar { 60 | position: fixed; 61 | top: 51px; 62 | bottom: 0; 63 | left: 0; 64 | z-index: 1000; 65 | display: block; 66 | padding: 20px; 67 | overflow-x: hidden; 68 | overflow-y: auto; 69 | /* Scrollable contents if viewport is shorter than content. */ 70 | background-color: #f5f5f5; 71 | border-right: 1px solid #eee; 72 | } 73 | } 74 | 75 | /* Sidebar navigation */ 76 | .nav-sidebar { 77 | margin-right: -21px; /* 20px padding + 1px border */ 78 | margin-bottom: 20px; 79 | margin-left: -20px; 80 | } 81 | 82 | .nav-sidebar>li>a { 83 | padding-right: 20px; 84 | padding-left: 20px; 85 | } 86 | 87 | .nav-sidebar>.active>a,.nav-sidebar>.active>a:hover,.nav-sidebar>.active>a:focus 88 | { 89 | color: #fff; 90 | background-color: #428bca; 91 | } 92 | 93 | /* 94 | * Main content 95 | */ 96 | .main { 97 | padding: 20px; 98 | } 99 | 100 | @media ( min-width : 768px) { 101 | .main { 102 | padding-right: 40px; 103 | padding-left: 40px; 104 | } 105 | } 106 | 107 | .main .page-header { 108 | margin-top: 0; 109 | } 110 | 111 | /* 112 | * Placeholder dashboard ideas 113 | */ 114 | .placeholders { 115 | margin-bottom: 30px; 116 | text-align: center; 117 | } 118 | 119 | .placeholders h4 { 120 | margin-bottom: 0; 121 | } 122 | 123 | .placeholder { 124 | margin-bottom: 20px; 125 | } 126 | 127 | .placeholder img { 128 | display: inline-block; 129 | border-radius: 50%; 130 | } -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | numberone 5 | paiban 6 | war 7 | 0.0.1-SNAPSHOT 8 | paiban Maven Webapp 9 | http://maven.apache.org 10 | 11 | 12 | 4.1.1.RELEASE 13 | 1.2.2 14 | 1.0.9 15 | 3.2.4 16 | 5.1.35 17 | 18 | 19 | 20 | 21 | junit 22 | junit 23 | 3.8.1 24 | test 25 | 26 | 27 | 28 | 29 | 30 | org.springframework 31 | spring-orm 32 | ${spring.version} 33 | 34 | 35 | org.springframework 36 | spring-web 37 | ${spring.version} 38 | 39 | 40 | org.springframework 41 | spring-webmvc 42 | ${spring.version} 43 | 44 | 45 | 46 | 47 | 48 | org.mybatis 49 | mybatis-spring 50 | ${mybatis-spring.version} 51 | 52 | 53 | 54 | org.mybatis 55 | mybatis 56 | ${mybatis.version} 57 | 58 | 59 | 60 | com.alibaba 61 | druid 62 | ${druid.version} 63 | 64 | 65 | 66 | mysql 67 | mysql-connector-java 68 | ${mysql.version} 69 | 70 | 71 | 72 | 73 | 74 | com.fasterxml.jackson.core 75 | jackson-core 76 | 2.5.3 77 | 78 | 79 | com.fasterxml.jackson.core 80 | jackson-databind 81 | 2.5.3 82 | 83 | 84 | org.slf4j 85 | slf4j-log4j12 86 | 1.7.2 87 | 88 | 89 | 90 | paiban 91 | 92 | 93 | -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/maven/numberone/paiban/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | numberone 5 | paiban 6 | war 7 | 0.0.1-SNAPSHOT 8 | paiban Maven Webapp 9 | http://maven.apache.org 10 | 11 | 12 | 4.1.1.RELEASE 13 | 1.2.2 14 | 1.0.9 15 | 3.2.4 16 | 5.1.35 17 | 18 | 19 | 20 | 21 | junit 22 | junit 23 | 3.8.1 24 | test 25 | 26 | 27 | 28 | 29 | 30 | org.springframework 31 | spring-orm 32 | ${spring.version} 33 | 34 | 35 | org.springframework 36 | spring-web 37 | ${spring.version} 38 | 39 | 40 | org.springframework 41 | spring-webmvc 42 | ${spring.version} 43 | 44 | 45 | 46 | 47 | 48 | org.mybatis 49 | mybatis-spring 50 | ${mybatis-spring.version} 51 | 52 | 53 | 54 | org.mybatis 55 | mybatis 56 | ${mybatis.version} 57 | 58 | 59 | 60 | com.alibaba 61 | druid 62 | ${druid.version} 63 | 64 | 65 | 66 | mysql 67 | mysql-connector-java 68 | ${mysql.version} 69 | 70 | 71 | 72 | 73 | 74 | com.fasterxml.jackson.core 75 | jackson-core 76 | 2.5.3 77 | 78 | 79 | com.fasterxml.jackson.core 80 | jackson-databind 81 | 2.5.3 82 | 83 | 84 | org.slf4j 85 | slf4j-log4j12 86 | 1.7.2 87 | 88 | 89 | 90 | paiban 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/StatisticsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 10 | import com.alibaba.monitor.mavenWeb.dao.IStatisticsDao; 11 | import com.alibaba.monitor.mavenWeb.pojos.Log; 12 | import com.alibaba.monitor.mavenWeb.pojos.Statistics; 13 | import com.alibaba.monitor.mavenWeb.service.IStatisticsService; 14 | @Service 15 | public class StatisticsServiceImpl implements IStatisticsService { 16 | @Autowired 17 | IStatisticsDao statisticsDao; 18 | @Autowired 19 | ILogDao logdao; 20 | @Override 21 | public Statistics getStatistics(Statistics statistics) { 22 | // TODO Auto-generated method stub 23 | return statisticsDao.LoadStatistics(statistics); 24 | } 25 | 26 | @Override 27 | public List getAllStatistics(Statistics statistics) { 28 | // TODO Auto-generated method stub 29 | return statisticsDao.LoadAllStatistics(statistics); 30 | } 31 | 32 | @Override 33 | public void AddStatistics(Statistics statistics) { 34 | // TODO Auto-generated method stub 35 | 36 | Log log=new Log(); 37 | log.setEmpno(1); 38 | log.setDates(new Date()); 39 | log.setTablename("schedule"); 40 | log.setOperate("add"); 41 | log.setBfupdate(""); 42 | log.setUpdated(statistics.toString()); 43 | logdao.AddLog(log); 44 | statisticsDao.AddStatistics(statistics); 45 | } 46 | 47 | @Override 48 | public void ModifyStatistics(Statistics statistics) { 49 | // TODO Auto-generated method stub 50 | 51 | Log log=new Log(); 52 | log.setEmpno(1); 53 | log.setDates(new Date()); 54 | log.setTablename("schedule"); 55 | log.setOperate("update"); 56 | log.setBfupdate(statisticsDao.LoadStatistics(statistics).toString()); 57 | log.setUpdated(statistics.toString()); 58 | logdao.AddLog(log); 59 | statisticsDao.ModifyStatistics(statistics); 60 | } 61 | 62 | @Override 63 | public void DeleteStatistics(Statistics statistics) { 64 | // TODO Auto-generated method stub 65 | 66 | Log log=new Log(); 67 | log.setEmpno(1); 68 | log.setDates(new Date()); 69 | log.setTablename("schedule"); 70 | log.setOperate("delete"); 71 | log.setBfupdate(statisticsDao.LoadStatistics(statistics).toString()); 72 | log.setUpdated(""); 73 | logdao.AddLog(log); 74 | statisticsDao.DeleteStatistics(statistics); 75 | } 76 | 77 | @Override 78 | public void AddMulitStatistics(List statisticslist) { 79 | // TODO Auto-generated method stub 80 | for(int i=0;i 2 | 5 | 6 | 7 | 8 | 12 | 16 | 20 | 27 | 34 | 35 | INSERT INTO emp 36 | (ename,deptno,passWord,ephone,eemail,eaddress,arrayed) 37 | VALUES(#{ename},#{deptno},#{passWord},#{ephone},#{eemail},#{eaddress},#{arrayed}); 38 | 39 | 40 | INSERT INTO emp 41 | (ename,deptno,passWord,ephone,eemail,eaddress,arrayed) 42 | VALUES 43 | 44 | (#{item.ename},#{item.deptno},#{item.passWord},#{item.ephone},#{item.eemail},#{item.eaddress},#{item.arrayed}) 45 | 46 | 47 | 48 | update emp set 49 | ename=#{ename},deptno=#{deptno},passWord=#{passWord},ephone=#{ephone},eemail=#{eemail},eaddress=#{eaddress},arrayed=#{arrayed} 50 | where empno=#{empno}; 51 | 52 | 53 | 54 | update emp set arrayed=#{arrayed} where ename like 55 | CONCAT(CONCAT('%', #{keyword}), '%') 56 | and deptno=#{deptno} and 57 | deleted=0; 58 | 59 | 60 | update emp set arrayed=#{arrayed} where 61 | ename like CONCAT(CONCAT('%', #{keyword}), '%') 62 | and deleted=0; 63 | 64 | 65 | update emp set deleted=1 66 | where empno=#{empno}; 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/mapper/emp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 12 | 16 | 20 | 27 | 34 | 35 | INSERT INTO emp 36 | (ename,deptno,passWord,ephone,eemail,eaddress,arrayed) 37 | VALUES(#{ename},#{deptno},#{passWord},#{ephone},#{eemail},#{eaddress},#{arrayed}); 38 | 39 | 40 | INSERT INTO emp 41 | (ename,deptno,passWord,ephone,eemail,eaddress,arrayed) 42 | VALUES 43 | 44 | (#{item.ename},#{item.deptno},#{item.passWord},#{item.ephone},#{item.eemail},#{item.eaddress},#{item.arrayed}) 45 | 46 | 47 | 48 | update emp set 49 | ename=#{ename},deptno=#{deptno},passWord=#{passWord},ephone=#{ephone},eemail=#{eemail},eaddress=#{eaddress},arrayed=#{arrayed} 50 | where empno=#{empno}; 51 | 52 | 53 | 54 | update emp set arrayed=#{arrayed} where ename like 55 | CONCAT(CONCAT('%', #{keyword}), '%') 56 | and deptno=#{deptno} and 57 | deleted=0; 58 | 59 | 60 | update emp set arrayed=#{arrayed} where 61 | ename like CONCAT(CONCAT('%', #{keyword}), '%') 62 | and deleted=0; 63 | 64 | 65 | update emp set deleted=1 66 | where empno=#{empno}; 67 | 68 | -------------------------------------------------------------------------------- /src/main/webapp/partials/department.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 25 | 26 |
#部门部门信息操作
{{dept.deptno}}{{dept.dname}}{{dept.describes}} 19 | 24 |
27 |
28 | 29 | 30 | 31 | 63 | 64 | 82 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/EmpServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.alibaba.monitor.mavenWeb.dao.IEmpDao; 10 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 11 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 12 | import com.alibaba.monitor.mavenWeb.pojos.EmpArrayed; 13 | import com.alibaba.monitor.mavenWeb.pojos.EmpSearch; 14 | import com.alibaba.monitor.mavenWeb.pojos.Log; 15 | import com.alibaba.monitor.mavenWeb.service.IEmpService; 16 | /** 17 | * @author zhuohaidi 18 | */ 19 | @Service 20 | public class EmpServiceImpl implements IEmpService 21 | { 22 | @Autowired 23 | IEmpDao empDao; 24 | @Autowired 25 | ILogDao logdao; 26 | @Override 27 | public Emp getEmp(Emp emp) 28 | { 29 | return empDao.LoadEmp(emp); 30 | } 31 | @Override 32 | public Emp getEmpByEmail(Emp emp) 33 | { 34 | return empDao.LoadEmpByEmail(emp); 35 | } 36 | @Override 37 | public List getAllEmp(Emp emp) { 38 | // TODO Auto-generated method stub 39 | return empDao.LoadAllEmp(emp); 40 | } 41 | @Override 42 | public List getEmpByKey(String keyword,int deptno) { 43 | // TODO Auto-generated method stub 44 | if(deptno!=0) 45 | { 46 | EmpSearch empsearch=new EmpSearch(); 47 | empsearch.setKeyword(keyword); 48 | empsearch.setDeptno(deptno); 49 | return empDao.loadEmpByEmpsearch(empsearch); 50 | } 51 | else 52 | return empDao.LoadEmpByKey(keyword); 53 | } 54 | @Override 55 | public void AddEmp(Emp emp) { 56 | // TODO Auto-generated method stub 57 | 58 | Log log=new Log(); 59 | log.setEmpno(1); 60 | log.setDates(new Date()); 61 | log.setTablename("emp"); 62 | log.setOperate("add"); 63 | log.setBfupdate(""); 64 | log.setUpdated(emp.toString()); 65 | logdao.AddLog(log); 66 | empDao.AddEmp(emp); 67 | } 68 | @Override 69 | public void ModifyEmp(Emp emp) { 70 | // TODO Auto-generated method stub 71 | 72 | Log log=new Log(); 73 | log.setEmpno(1); 74 | log.setDates(new Date()); 75 | log.setTablename("emp"); 76 | log.setOperate("update"); 77 | log.setBfupdate(empDao.LoadEmp(emp).toString()); 78 | log.setUpdated(emp.toString()); 79 | logdao.AddLog(log); 80 | empDao.ModifyEmp(emp); 81 | } 82 | @Override 83 | public void DeleteEmp(Emp emp) { 84 | // TODO Auto-generated method stub 85 | 86 | Log log=new Log(); 87 | log.setEmpno(1); 88 | log.setDates(new Date()); 89 | log.setTablename("emp"); 90 | log.setOperate("delete"); 91 | log.setBfupdate(empDao.LoadEmp(emp).toString()); 92 | log.setUpdated(""); 93 | logdao.AddLog(log); 94 | empDao.DeleteEmp(emp); 95 | } 96 | @Override 97 | public void AddMulitEmp(List emplist) { 98 | // TODO Auto-generated method stub 99 | empDao.AddMulitEmp(emplist); 100 | } 101 | @Override 102 | public void ModifyMulitEmp(EmpArrayed emparrayed) { 103 | // TODO Auto-generated method stub 104 | if(emparrayed.getDeptno()==0) 105 | empDao.ModifyMulitEmp2(emparrayed); 106 | else 107 | empDao.ModifyMulitEmp(emparrayed); 108 | } 109 | 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/main/webapp/dist/shift-ctrl.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | paibanControllers.controller('ShiftCtrl', [ 4 | '$scope', 5 | '$routeParams', 6 | '$http', 7 | '$route', 8 | function($scope, $routeParams, $http, $route) { 9 | $('#navLink>li').removeClass(); 10 | $('#navLink>li:nth-child(4)').addClass('active'); 11 | 12 | $scope.weekno = $routeParams.week - 0; 13 | $scope.deptno = $routeParams.deptno - 0; 14 | 15 | $http.get("department").success(function(data) { 16 | $scope.allDepartment = data; 17 | }); 18 | 19 | var d = new Date(); 20 | d.setDate(new Date().getDate() + $routeParams.week * 7); 21 | var w = d.getDay(); 22 | var n = (w == 0 ? 7 : w) - 1; 23 | d.setDate(d.getDate() - n); 24 | $scope.week = []; 25 | for (var i = 0; i < 7; i++) { 26 | $scope.week.push(JSON.parse(JSON.stringify(d))); 27 | d.setDate(d.getDate() + 1); 28 | } 29 | function loadSft() { 30 | 31 | $http.get( 32 | "chaxun2?weekno=" + $routeParams.week + "&deptno=" 33 | + $routeParams.deptno).success(function(data) { 34 | data.forEach(function (tb) { 35 | for (var i in $scope.allDepartment) { 36 | if ($scope.allDepartment[i].deptno == tb.emp.deptno) { 37 | tb.emp.deptName = $scope.allDepartment[i].dname; 38 | break; 39 | } 40 | } 41 | }); 42 | $scope.sft = data; 43 | }); 44 | 45 | } 46 | loadSft(); 47 | 48 | $scope.onChange = function(empno, clazzid, index) { 49 | $http.post("chaxun2/update", { 50 | empno : empno, 51 | classid : clazzid, 52 | date : $scope.week[index] 53 | }).success(function() { 54 | loadSft(); 55 | alert("update ok"); 56 | 57 | }).error(function() { 58 | alert("failed"); 59 | }); 60 | 61 | } 62 | 63 | $scope.export = function() { 64 | var w = $scope.week; 65 | var data = [ [ '姓名', '部门',w[0].substr(0, 10), w[1].substr(0, 10), 66 | w[2].substr(0, 10), w[3].substr(0, 10), 67 | w[4].substr(0, 10), w[5].substr(0, 10), 68 | w[6].substr(0, 10) ] ]; 69 | 70 | $scope.sft.forEach(function(tb) { 71 | data.push([ tb.emp.ename,tb.emp.deptName, kkk(tb.a[0]), kkk(tb.a[1]), 72 | kkk(tb.a[2]), kkk(tb.a[3]), kkk(tb.a[4]), 73 | kkk(tb.a[5]), kkk(tb.a[6]) ]); 74 | }); 75 | 76 | function kkk(i) { 77 | switch (i) { 78 | case 0: 79 | return ''; 80 | case 1: 81 | return '白班'; 82 | case 2: 83 | return '夜班'; 84 | case 3: 85 | return '正常班'; 86 | case 4: 87 | return '休息'; 88 | } 89 | } 90 | 91 | $scope.colors = [ '', 'green', 'grey', 'yellow', '' ]; 92 | 93 | var ranges = []; 94 | 95 | var ws_name = "SheetJS"; 96 | console.log(data); 97 | var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); 98 | /* add ranges to worksheet */ 99 | ws['!merges'] = ranges; 100 | /* add worksheet to workbook */ 101 | wb.SheetNames.push(ws_name); 102 | wb.Sheets[ws_name] = ws; 103 | 104 | var wbout = XLSX.write(wb, { 105 | bookType : 'xlsx', 106 | bookSST : false, 107 | type : 'binary' 108 | }); 109 | 110 | saveAs(new Blob([ s2ab(wbout) ], { 111 | type : "application/octet-stream" 112 | }), "paiban.xlsx") 113 | } 114 | 115 | } ]); 116 | -------------------------------------------------------------------------------- /src/main/webapp/page/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF8" 2 | pageEncoding="UTF8"%> 3 | <%@ page isELIgnored="false" %> 4 | 5 | 6 | 7 | 排班 8 | 9 | 10 | 11 | 12 | 13 | 33 |
34 |
35 | 36 |
37 |
38 | 39 | 登录 40 |
41 |
42 | 60 | 63 |
64 |
65 | 66 |
67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/webapp/dist/lib/angular-resource.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(I,d,B){'use strict';function D(f,q){q=q||{};d.forEach(q,function(d,h){delete q[h]});for(var h in f)!f.hasOwnProperty(h)||"$"===h.charAt(0)&&"$"===h.charAt(1)||(q[h]=f[h]);return q}var w=d.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var f=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}}; 7 | this.$get=["$http","$q",function(q,h){function t(d,g){this.template=d;this.defaults=s({},f.defaults,g);this.urlParams={}}function v(x,g,l,m){function c(b,k){var c={};k=s({},g,k);r(k,function(a,k){u(a)&&(a=a());var d;if(a&&a.charAt&&"@"==a.charAt(0)){d=b;var e=a.substr(1);if(null==e||""===e||"hasOwnProperty"===e||!C.test("."+e))throw w("badmember",e);for(var e=e.split("."),n=0,g=e.length;n 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 49 | 51 | 52 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /target/classes/spring-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 49 | 51 | 52 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/service/impl/ScheduleServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.service.impl; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.alibaba.monitor.mavenWeb.dao.ILogDao; 10 | import com.alibaba.monitor.mavenWeb.dao.IScheduleDao; 11 | import com.alibaba.monitor.mavenWeb.pojos.Log; 12 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 13 | import com.alibaba.monitor.mavenWeb.pojos.ScheduleSearch; 14 | import com.alibaba.monitor.mavenWeb.service.IScheduleService; 15 | @Service 16 | public class ScheduleServiceImpl implements IScheduleService{ 17 | @Autowired 18 | IScheduleDao scheduleDao; 19 | @Autowired 20 | ILogDao logdao; 21 | @Override 22 | public Schedule getSchedule(Schedule schedule) { 23 | // TODO Auto-generated method stub 24 | return scheduleDao.LoadSchedule(schedule); 25 | } 26 | 27 | @Override 28 | public List getAllSchedule(Schedule schedule) { 29 | // TODO Auto-generated method stub 30 | return scheduleDao.LoadAllSchedule(schedule); 31 | } 32 | 33 | @Override 34 | public List getScheduleByEmpno(int empno) { 35 | // TODO Auto-generated method stub 36 | return scheduleDao.LoadScheduleByEmpno(empno); 37 | } 38 | 39 | @Override 40 | public List getScheduleBySsearch(ScheduleSearch sdsh) { 41 | // TODO Auto-generated method stub 42 | return scheduleDao.LoadScheduleBySsearch(sdsh); 43 | } 44 | 45 | @Override 46 | public void AddSchedule(Schedule schedule) { 47 | // TODO Auto-generated method stub 48 | 49 | Log log=new Log(); 50 | log.setEmpno(1); 51 | log.setDates(new Date()); 52 | log.setTablename("schedule"); 53 | log.setOperate("add"); 54 | log.setBfupdate(""); 55 | log.setUpdated(schedule.toString()); 56 | logdao.AddLog(log); 57 | scheduleDao.AddSchedule(schedule); 58 | } 59 | 60 | @Override 61 | public void ModifySchedule(Schedule schedule) { 62 | // TODO Auto-generated method stub 63 | 64 | Log log=new Log(); 65 | log.setEmpno(1); 66 | log.setDates(new Date()); 67 | log.setTablename("schedule"); 68 | log.setOperate("update"); 69 | log.setBfupdate(scheduleDao.LoadSchedule(schedule).toString()); 70 | log.setUpdated(schedule.toString()); 71 | logdao.AddLog(log); 72 | scheduleDao.ModifySchedule(schedule); 73 | } 74 | 75 | @Override 76 | public void DeleteSchedule(Schedule schedule) { 77 | // TODO Auto-generated method stub 78 | 79 | Log log=new Log(); 80 | log.setEmpno(1); 81 | log.setDates(new Date()); 82 | log.setTablename("schedule"); 83 | log.setOperate("delete"); 84 | log.setBfupdate(scheduleDao.LoadSchedule(schedule).toString()); 85 | log.setUpdated(""); 86 | logdao.AddLog(log); 87 | scheduleDao.DeleteSchedule(schedule); 88 | } 89 | 90 | @Override 91 | public void AddMulitSchedule(List schedulelist) { 92 | // TODO Auto-generated method stub 93 | scheduleDao.AddMulitSchedule(schedulelist); 94 | } 95 | 96 | @Override 97 | public void ModifyScheduleByEmpno(Schedule schedule) { 98 | // TODO Auto-generated method stub 99 | scheduleDao.ModifyScheduleByEmpno(schedule); 100 | } 101 | 102 | @Override 103 | public List getScheduleByDate(Date date) { 104 | // TODO Auto-generated method stub 105 | return scheduleDao.LoadScheduleByDate(date); 106 | } 107 | 108 | @Override 109 | public Schedule getScheduleByEmpTime(Schedule schedule) { 110 | // TODO Auto-generated method stub 111 | return scheduleDao.LoadScheduleByEmpTime(schedule); 112 | } 113 | 114 | 115 | 116 | } 117 | -------------------------------------------------------------------------------- /src/main/webapp/sheetjs/Export2Excel.js: -------------------------------------------------------------------------------- 1 | function generateArray(table) { 2 | var out = []; 3 | var rows = table.querySelectorAll('tr'); 4 | var ranges = []; 5 | for (var R = 0; R < rows.length; ++R) { 6 | var outRow = []; 7 | var row = rows[R]; 8 | var columns = row.querySelectorAll('td'); 9 | for (var C = 0; C < columns.length; ++C) { 10 | var cell = columns[C]; 11 | var colspan = cell.getAttribute('colspan'); 12 | var rowspan = cell.getAttribute('rowspan'); 13 | var cellValue = cell.innerText; 14 | if(cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue; 15 | 16 | //Skip ranges 17 | ranges.forEach(function(range) { 18 | if(R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) { 19 | for(var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null); 20 | } 21 | }); 22 | 23 | //Handle Row Span 24 | if (rowspan || colspan) { 25 | rowspan = rowspan || 1; 26 | colspan = colspan || 1; 27 | ranges.push({s:{r:R, c:outRow.length},e:{r:R+rowspan-1, c:outRow.length+colspan-1}}); 28 | }; 29 | 30 | //Handle Value 31 | outRow.push(cellValue !== "" ? cellValue : null); 32 | 33 | //Handle Colspan 34 | if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null); 35 | } 36 | out.push(outRow); 37 | } 38 | return [out, ranges]; 39 | }; 40 | 41 | function datenum(v, date1904) { 42 | if(date1904) v+=1462; 43 | var epoch = Date.parse(v); 44 | return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000); 45 | } 46 | 47 | function sheet_from_array_of_arrays(data, opts) { 48 | var ws = {}; 49 | var range = {s: {c:10000000, r:10000000}, e: {c:0, r:0 }}; 50 | for(var R = 0; R != data.length; ++R) { 51 | for(var C = 0; C != data[R].length; ++C) { 52 | if(range.s.r > R) range.s.r = R; 53 | if(range.s.c > C) range.s.c = C; 54 | if(range.e.r < R) range.e.r = R; 55 | if(range.e.c < C) range.e.c = C; 56 | var cell = {v: data[R][C] }; 57 | if(cell.v == null) continue; 58 | var cell_ref = XLSX.utils.encode_cell({c:C,r:R}); 59 | 60 | if(typeof cell.v === 'number') cell.t = 'n'; 61 | else if(typeof cell.v === 'boolean') cell.t = 'b'; 62 | else if(cell.v instanceof Date) { 63 | cell.t = 'n'; cell.z = XLSX.SSF._table[14]; 64 | cell.v = datenum(cell.v); 65 | } 66 | else cell.t = 's'; 67 | 68 | ws[cell_ref] = cell; 69 | } 70 | } 71 | if(range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range); 72 | return ws; 73 | } 74 | 75 | function Workbook() { 76 | if(!(this instanceof Workbook)) return new Workbook(); 77 | this.SheetNames = []; 78 | this.Sheets = {}; 79 | } 80 | 81 | function s2ab(s) { 82 | var buf = new ArrayBuffer(s.length); 83 | var view = new Uint8Array(buf); 84 | for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; 85 | return buf; 86 | } 87 | 88 | function export_table_to_excel(id) { 89 | var theTable = document.getElementById(id); 90 | var oo = generateArray(theTable); 91 | var ranges = oo[1]; 92 | 93 | /* original data */ 94 | var data = oo[0]; 95 | var ws_name = "SheetJS"; 96 | console.log(data); 97 | 98 | var wb = new Workbook(), ws = sheet_from_array_of_arrays(data); 99 | 100 | /* add ranges to worksheet */ 101 | ws['!merges'] = ranges; 102 | 103 | /* add worksheet to workbook */ 104 | wb.SheetNames.push(ws_name); 105 | wb.Sheets[ws_name] = ws; 106 | 107 | var wbout = XLSX.write(wb, {bookType:'xlsx', bookSST:false, type: 'binary'}); 108 | 109 | saveAs(new Blob([s2ab(wbout)],{type:"application/octet-stream"}), "test.xlsx") 110 | } 111 | -------------------------------------------------------------------------------- /src/main/webapp/dist/lib/angular-route.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.3.15 3 | (c) 2010-2014 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(q,d,C){'use strict';function v(r,k,h){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,f,b,c,y){function z(){l&&(h.cancel(l),l=null);m&&(m.$destroy(),m=null);n&&(l=h.leave(n),l.then(function(){l=null}),n=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),c=r.current;n=y(b,function(b){h.enter(b,null,n||f).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||k()});z()});m=c.scope=b;m.$emit("$viewContentLoaded"); 7 | m.$eval(w)}else z()}var m,n,l,t=b.autoscroll,w=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,k,h){return{restrict:"ECA",priority:-400,link:function(a,f){var b=h.current,c=b.locals;f.html(c.$template);var y=d(f.contents());b.controller&&(c.$scope=a,c=k(b.controller,c),b.controllerAs&&(a[b.controllerAs]=c),f.data("$ngControllerController",c),f.children().data("$ngControllerController",c));y(a)}}}q=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,f){return d.extend(Object.create(a), 8 | f)}function k(a,d){var b=d.caseInsensitiveMatch,c={originalPath:a,regexp:a},h=c.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,d,b,c){a="?"===c?c:null;c="*"===c?c:null;h.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");c.regexp=new RegExp("^"+a+"$",b?"i":"");return c}var h={};this.when=function(a,f){var b=d.copy(f);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0); 9 | d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);h[a]=d.extend(b,a&&k(a,b));if(a){var c="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";h[c]=d.extend({redirectTo:a},k(c,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(a,f,b,c,k,q,x){function m(b){var e=s.current; 10 | (v=(p=l())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!w)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function n(){var u=s.current,e=p;if(v)u.params=e.params,d.copy(u.params,b),a.$broadcast("$routeUpdate",u);else if(e||u)w=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?f.path(t(e.redirectTo,e.params)).search(e.params).replace():f.url(e.redirectTo(e.pathParams,f.path(),f.search())).replace()),c.when(e).then(function(){if(e){var a= 11 | d.extend({},e.resolve),b,g;d.forEach(a,function(b,e){a[e]=d.isString(b)?k.get(b):k.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(g=e.templateUrl)&&(d.isFunction(g)&&(g=g(e.params)),g=x.getTrustedResourceUrl(g),d.isDefined(g)&&(e.loadedTemplateUrl=g,b=q(g)));d.isDefined(b)&&(a.$template=b);return c.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",e,u))},function(b){e==s.current&&a.$broadcast("$routeChangeError", 12 | e,u,b)})}function l(){var a,b;d.forEach(h,function(c,h){var g;if(g=!b){var k=f.path();g=c.keys;var m={};if(c.regexp)if(k=c.regexp.exec(k)){for(var l=1,n=k.length;l schedulelist=null; 35 | List emplist=null; 36 | if(weekno==null) weekno=0; 37 | if(deptno==null) deptno=0; 38 | if(keyword==null) keyword=""; 39 | emplist=empService.getEmpByKey(keyword, deptno); 40 | Date Momdy=DateAction.getWeekDay(); 41 | ScheduleSearch sdsh=new ScheduleSearch(); 42 | sdsh.setLeftdate(DateAction.getDateAfter(Momdy, weekno*7)); 43 | sdsh.setRightdate(DateAction.getDateAfter(Momdy, weekno*7+6)); 44 | // System.out.println(Momdy); 45 | // System.out.println(sdsh.getLeftdate()); 46 | // System.out.println(sdsh.getRightdate()); 47 | // Map map=new HashMap(); 48 | //Map map=new HashMap(); 49 | 50 | long left = sdsh.getLeftdate().getTime(); 51 | 52 | List empcla = new ArrayList(); 53 | for(int i=0;i 3 | 4 | 5 | 6 | 7 | 8 | 阿里排班系统 9 | 10 | 11 | 12 | 13 | <%! 14 | User user; 15 | %> 16 | <% 17 | user=(User)session.getAttribute("user"); 18 | %> 19 | 20 | 60 | 61 |
62 |
63 | 73 | 74 |
76 | 77 |
78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 110 | 111 | -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/controller/ShiftcfgController.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Calendar; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestBody; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import com.alibaba.monitor.mavenWeb.pojos.Dept; 14 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 15 | import com.alibaba.monitor.mavenWeb.pojos.M_Schedule; 16 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 17 | import com.alibaba.monitor.mavenWeb.service.IArrayClassService; 18 | import com.alibaba.monitor.mavenWeb.service.IDeptService; 19 | import com.alibaba.monitor.mavenWeb.service.IEmpService; 20 | import com.alibaba.monitor.mavenWeb.service.IM_ScheduleService; 21 | import com.alibaba.monitor.mavenWeb.service.IScheduleService; 22 | /** 23 | * @author zhuohaidi 24 | */ 25 | @RestController 26 | @RequestMapping("/shiftcfg") 27 | public class ShiftcfgController { 28 | 29 | @Autowired 30 | IEmpService empservice; 31 | @Autowired 32 | IScheduleService scheduleservice; 33 | @Autowired 34 | IM_ScheduleService mscheduleservice; 35 | @Autowired 36 | IDeptService deptservice; 37 | @Autowired 38 | IArrayClassService arrayclassservice; 39 | 40 | @RequestMapping(method = RequestMethod.POST) 41 | public String Shiftcfg(@RequestBody SimpleBean sb) { 42 | Integer year = sb.year; 43 | Integer month = sb.month; 44 | Integer mode = sb.mode; 45 | // System.out.println("y:" + sb.year + " m: " + month + " mode:" + 46 | // mode); 47 | 48 | if (year == null) 49 | year = 2015; 50 | if (month == null) 51 | month = 6; 52 | if (mode == null) 53 | mode = 1; 54 | 55 | Calendar calendar = Calendar.getInstance(); 56 | int Year = calendar.get(Calendar.YEAR); 57 | int Month = calendar.get(Calendar.MONTH) + 1; 58 | int day = 1; 59 | 60 | if (year < Year || (year == Year && month < Month)) 61 | return "{\"ok\":\"时间已过去,不能进行排班\"}"; 62 | if (year == Year && month == Month) 63 | day = calendar.get(Calendar.DAY_OF_MONTH); 64 | // System.out.println(year); 65 | // System.out.println(month); 66 | // System.out.println(day); 67 | List deptlist = deptservice.getAllDept(null); 68 | // System.out.println("******deptlist*********"); 69 | // for (int i = 0; i < deptlist.size(); i++) { 70 | // System.out.println(deptlist.get(i).toString()); 71 | // } 72 | 73 | for (int i = 0; i < deptlist.size(); i++) { 74 | List emps = empservice.getEmpByKey("", deptlist.get(i) 75 | .getDeptno()); 76 | // System.out.println("******emps*********"); 77 | // for (int l = 0; l < emps.size(); l++) { 78 | // System.out.println(emps.get(l).toString()); 79 | // } 80 | List emplist = new ArrayList(); 81 | List mschedulelist = new ArrayList(); 82 | // System.out.println(emps.size()); 83 | for (int j = 0; j < emps.size(); j++) { 84 | Emp emp = emps.get(j); 85 | if (emp.isArrayed() == false) 86 | continue; 87 | M_Schedule mschedule = new M_Schedule(); 88 | mschedule.setYears(year); 89 | mschedule.setMonths(month); 90 | mschedule.setFlag(false); 91 | mschedule.setEmpno(emp.getEmpno()); 92 | // System.out.println(mschedule.toStrings()); 93 | M_Schedule ms = mscheduleservice.getMScheduleByEmpno(mschedule); 94 | if (ms != null) 95 | continue; 96 | emplist.add(emp); 97 | mschedulelist.add(mschedule); 98 | } 99 | // System.out.println("******emplist*********"); 100 | // for (int l = 0; l < emplist.size(); l++) { 101 | // System.out.println(emplist.get(l).toString()); 102 | // } 103 | List schedulelist = null; 104 | if(emplist.size()==0) 105 | { 106 | continue; 107 | } 108 | else if (emplist.size() < 6) { 109 | // System.out.println("jin"+year+" "+month+" "+day+"\n"); 110 | schedulelist = arrayclassservice.ModeFour(emplist, year, month,day); 111 | } 112 | else if (mode == 0) { 113 | schedulelist = arrayclassservice.ModeFour(emplist, year, month,day); 114 | } 115 | else if (mode == 1) 116 | schedulelist = arrayclassservice.ModeOne(emplist, year, month, 117 | day); 118 | else if (mode == 2) 119 | schedulelist = arrayclassservice.ModeTow(emplist, year, month, 120 | day); 121 | else if (mode == 3) 122 | schedulelist = arrayclassservice.ModeThree(emplist, year, 123 | month, day); 124 | // System.out.println("******schedulelist*********"); 125 | // for (int l = 0; l < schedulelist.size(); l++) { 126 | // System.out.println(schedulelist.get(l).toString()); 127 | // } 128 | scheduleservice.AddMulitSchedule(schedulelist); 129 | mscheduleservice.AddMulitMSchedule(mschedulelist); 130 | 131 | } 132 | return "{\"ok\":\"排班完成\"}"; 133 | 134 | } 135 | 136 | private static class SimpleBean { 137 | public Integer year, month; 138 | public Integer mode; 139 | } 140 | } -------------------------------------------------------------------------------- /src/main/java/com/alibaba/monitor/mavenWeb/contral/ArrayClassModeOneAction.java: -------------------------------------------------------------------------------- 1 | package com.alibaba.monitor.mavenWeb.contral; 2 | 3 | import java.text.DateFormat; 4 | import java.text.ParseException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | import com.alibaba.monitor.mavenWeb.pojos.Emp; 10 | import com.alibaba.monitor.mavenWeb.pojos.Schedule; 11 | /** 12 | * @author zhuohaidi 13 | */ 14 | public class ArrayClassModeOneAction { 15 | int n; 16 | int a[][]=new int[200][40]; 17 | int daysOfmonth; 18 | private int random(int k) 19 | { 20 | int num=0; 21 | while(true) 22 | { 23 | 24 | num=(int)(Math.random()*n); 25 | //System.out.println(num); 26 | if(a[num][k-1]-a[num][k-7]<5&&a[num][k]==0) 27 | { 28 | a[num][k]=1; 29 | return num; 30 | } 31 | } 32 | } 33 | private void arrayger() 34 | { 35 | int k=n/2+1; 36 | //int kk=(int) Math.floor(n*22.0/30); 37 | for(int i=8;i<8+daysOfmonth;i++) 38 | { 39 | int t=0; 40 | while(t11&&a[j][i-1]-a[j][i-5]<=2&&a[j][i]==0) 50 | { 51 | a[j][i]=1; 52 | } 53 | else if(i>12&&a[j][i-1]-a[j][i-6]<=3&&a[j][i]==0) 54 | { 55 | a[j][i]=1; 56 | } 57 | else if(i>13&&a[j][i-1]-a[j][i-7]<=4&&a[j][i]==0) 58 | { 59 | a[j][i]=1; 60 | } 61 | a[j][i]+=a[j][i-1]; 62 | } 63 | //System.out.print("\n"); 64 | } 65 | } 66 | public List getArrayger(List emplist,int year,int month,int day) 67 | { 68 | this.n=emplist.size(); 69 | this.daysOfmonth=DateAction.daysOfmonth(year, month); 70 | //System.out.println(this.n); 71 | arrayger(); 72 | DateFormat dd=new SimpleDateFormat("yyyy-MM-dd"); 73 | List schlist=new ArrayList(); 74 | for(int i=0;i11&&a[j][i-1]-a[j][i-5]<=2&&a[j][i]==0) 162 | // { 163 | // a[j][i]=1; 164 | // } 165 | // else if(i>12&&a[j][i-1]-a[j][i-6]<=3&&a[j][i]==0) 166 | // { 167 | // a[j][i]=1; 168 | // } 169 | // else if(i>13&&a[j][i-1]-a[j][i-7]<=4&&a[j][i]==0) 170 | // { 171 | // a[j][i]=1; 172 | // } 173 | // a[j][i]+=a[j][i-1]; 174 | // } 175 | // } 176 | // } 177 | // public List getArrayger(List emplist) throws ParseException 178 | // { 179 | // List schlist=new ArrayList(); 180 | // DateFormat dd=new SimpleDateFormat("yyyy-MM-dd"); 181 | // this.n=emplist.size(); 182 | // arrayger(); 183 | // for(int i=0;i Shiftcfg(Integer m) { 43 | if(m==null) 44 | m=0; 45 | int Year = DateAction.getYear(); 46 | int Month = DateAction.getMonth(); 47 | int month=Month+m; 48 | int year=Year+(month/12); 49 | month=month%12; 50 | if(month<=0){ 51 | month+=12; 52 | year-=1; 53 | } 54 | int daysOfmonth=DateAction.daysOfmonth(year, month); 55 | //System.out.println(Year + " " + Month); 56 | 57 | List emplist=empservice.getAllEmp(null); 58 | List statisticslist=new ArrayList(); 59 | if (year < Year || (year == Year && month < Month)) 60 | { 61 | ScheduleSearch sdsh=new ScheduleSearch(); 62 | try { 63 | sdsh.setLeftdate(DateAction.StringtoDate(year+"-"+month+"-01")); 64 | } catch (Exception e) { 65 | // TODO Auto-generated catch block 66 | } 67 | try { 68 | sdsh.setRightdate(DateAction.StringtoDate(year+"-"+month+"-"+daysOfmonth)); 69 | } catch (Exception e) { 70 | // TODO Auto-generated catch block 71 | } 72 | Statistics statistics=new Statistics(); 73 | statistics.setYears(year); 74 | statistics.setMonths(month); 75 | for(int i=0;i schedulelist=scheduleservice.getScheduleBySsearch(sdsh); 91 | for(int j=0;j schedulelist=scheduleservice.getScheduleBySsearch(sdsh); 122 | Statistics statistics=new Statistics(); 123 | statistics.setEmpno(emp.getEmpno()); 124 | statistics.setEname(emp.getEname()); 125 | statistics.setDeptno(emp.getDeptno()); 126 | 127 | statistics.setYears(year); 128 | statistics.setMonths(month); 129 | for(int j=0;j=c;d--)e.end&&e.end(f[d]);f.length=c}}"string"!==typeof a&&(a=null===a||"undefined"===typeof a?"":""+a);var b,k,f=[],m=a,l;for(f.last=function(){return f[f.length-1]};a;){l="";k=!0;if(f.last()&&w[f.last()])a=a.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+f.last()+"[^>]*>","i"),function(a,b){b=b.replace(H,"$1").replace(I,"$1");e.chars&&e.chars(q(b));return""}),c("",f.last());else{if(0===a.indexOf("\x3c!--"))b=a.indexOf("--",4),0<=b&&a.lastIndexOf("--\x3e",b)===b&&(e.comment&& 8 | e.comment(a.substring(4,b)),a=a.substring(b+3),k=!1);else if(x.test(a)){if(b=a.match(x))a=a.replace(b[0],""),k=!1}else if(J.test(a)){if(b=a.match(y))a=a.substring(b[0].length),b[0].replace(y,c),k=!1}else K.test(a)&&((b=a.match(z))?(b[4]&&(a=a.substring(b[0].length),b[0].replace(z,d)),k=!1):(l+="<",a=a.substring(1)));k&&(b=a.indexOf("<"),l+=0>b?a:a.substring(0,b),a=0>b?"":a.substring(b),e.chars&&e.chars(q(l)))}if(a==m)throw L("badparse",a);m=a}c()}function q(a){if(!a)return"";A.innerHTML=a.replace(//g,">")}function r(a,e){var d=!1,c=h.bind(a,a.push);return{start:function(a,k,f){a=h.lowercase(a);!d&&w[a]&&(d=a);d||!0!==C[a]||(c("<"),c(a),h.forEach(k,function(d,f){var k=h.lowercase(f),g="img"===a&&"src"===k||"background"=== 10 | k;!0!==O[k]||!0===D[k]&&!e(d,g)||(c(" "),c(f),c('="'),c(B(d)),c('"'))}),c(f?"/>":">"))},end:function(a){a=h.lowercase(a);d||!0!==C[a]||(c(""));a==d&&(d=!1)},chars:function(a){d||c(B(a))}}}var L=h.$$minErr("$sanitize"),z=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,y=/^<\/\s*([\w:-]+)[^>]*>/,G=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,K=/^]*?)>/i, 11 | I=/"\u201d\u2019]/,d=/^mailto:/;return function(c,b){function k(a){a&&g.push(E(a))}function f(a,c){g.push("');k(c);g.push("")}if(!c)return c;for(var m,l=c,g=[],n,p;m=l.match(e);)n=m[0],m[2]||m[4]||(n=(m[3]?"http://":"mailto:")+n),p=m.index,k(l.substr(0,p)),f(n,m[0].replace(d,"")),l=l.substring(p+m[0].length);k(l);return a(g.join(""))}}])})(window,window.angular); 16 | //# sourceMappingURL=angular-sanitize.min.js.map 17 | -------------------------------------------------------------------------------- /src/main/webapp/sheetjs/Blob.js: -------------------------------------------------------------------------------- 1 | /* Blob.js 2 | * A Blob implementation. 3 | * 2014-05-27 4 | * 5 | * By Eli Grey, http://eligrey.com 6 | * By Devin Samarin, https://github.com/eboyjr 7 | * License: X11/MIT 8 | * See LICENSE.md 9 | */ 10 | 11 | /*global self, unescape */ 12 | /*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, 13 | plusplus: true */ 14 | 15 | /*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ 16 | 17 | (function (view) { 18 | "use strict"; 19 | 20 | view.URL = view.URL || view.webkitURL; 21 | 22 | if (view.Blob && view.URL) { 23 | try { 24 | new Blob; 25 | return; 26 | } catch (e) {} 27 | } 28 | 29 | // Internally we use a BlobBuilder implementation to base Blob off of 30 | // in order to support older browsers that only have BlobBuilder 31 | var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) { 32 | var 33 | get_class = function(object) { 34 | return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; 35 | } 36 | , FakeBlobBuilder = function BlobBuilder() { 37 | this.data = []; 38 | } 39 | , FakeBlob = function Blob(data, type, encoding) { 40 | this.data = data; 41 | this.size = data.length; 42 | this.type = type; 43 | this.encoding = encoding; 44 | } 45 | , FBB_proto = FakeBlobBuilder.prototype 46 | , FB_proto = FakeBlob.prototype 47 | , FileReaderSync = view.FileReaderSync 48 | , FileException = function(type) { 49 | this.code = this[this.name = type]; 50 | } 51 | , file_ex_codes = ( 52 | "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " 53 | + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR" 54 | ).split(" ") 55 | , file_ex_code = file_ex_codes.length 56 | , real_URL = view.URL || view.webkitURL || view 57 | , real_create_object_URL = real_URL.createObjectURL 58 | , real_revoke_object_URL = real_URL.revokeObjectURL 59 | , URL = real_URL 60 | , btoa = view.btoa 61 | , atob = view.atob 62 | 63 | , ArrayBuffer = view.ArrayBuffer 64 | , Uint8Array = view.Uint8Array 65 | ; 66 | FakeBlob.fake = FB_proto.fake = true; 67 | while (file_ex_code--) { 68 | FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; 69 | } 70 | if (!real_URL.createObjectURL) { 71 | URL = view.URL = {}; 72 | } 73 | URL.createObjectURL = function(blob) { 74 | var 75 | type = blob.type 76 | , data_URI_header 77 | ; 78 | if (type === null) { 79 | type = "application/octet-stream"; 80 | } 81 | if (blob instanceof FakeBlob) { 82 | data_URI_header = "data:" + type; 83 | if (blob.encoding === "base64") { 84 | return data_URI_header + ";base64," + blob.data; 85 | } else if (blob.encoding === "URI") { 86 | return data_URI_header + "," + decodeURIComponent(blob.data); 87 | } if (btoa) { 88 | return data_URI_header + ";base64," + btoa(blob.data); 89 | } else { 90 | return data_URI_header + "," + encodeURIComponent(blob.data); 91 | } 92 | } else if (real_create_object_URL) { 93 | return real_create_object_URL.call(real_URL, blob); 94 | } 95 | }; 96 | URL.revokeObjectURL = function(object_URL) { 97 | if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { 98 | real_revoke_object_URL.call(real_URL, object_URL); 99 | } 100 | }; 101 | FBB_proto.append = function(data/*, endings*/) { 102 | var bb = this.data; 103 | // decode data to a binary string 104 | if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { 105 | var 106 | str = "" 107 | , buf = new Uint8Array(data) 108 | , i = 0 109 | , buf_len = buf.length 110 | ; 111 | for (; i < buf_len; i++) { 112 | str += String.fromCharCode(buf[i]); 113 | } 114 | bb.push(str); 115 | } else if (get_class(data) === "Blob" || get_class(data) === "File") { 116 | if (FileReaderSync) { 117 | var fr = new FileReaderSync; 118 | bb.push(fr.readAsBinaryString(data)); 119 | } else { 120 | // async FileReader won't work as BlobBuilder is sync 121 | throw new FileException("NOT_READABLE_ERR"); 122 | } 123 | } else if (data instanceof FakeBlob) { 124 | if (data.encoding === "base64" && atob) { 125 | bb.push(atob(data.data)); 126 | } else if (data.encoding === "URI") { 127 | bb.push(decodeURIComponent(data.data)); 128 | } else if (data.encoding === "raw") { 129 | bb.push(data.data); 130 | } 131 | } else { 132 | if (typeof data !== "string") { 133 | data += ""; // convert unsupported types to strings 134 | } 135 | // decode UTF-16 to binary string 136 | bb.push(unescape(encodeURIComponent(data))); 137 | } 138 | }; 139 | FBB_proto.getBlob = function(type) { 140 | if (!arguments.length) { 141 | type = null; 142 | } 143 | return new FakeBlob(this.data.join(""), type, "raw"); 144 | }; 145 | FBB_proto.toString = function() { 146 | return "[object BlobBuilder]"; 147 | }; 148 | FB_proto.slice = function(start, end, type) { 149 | var args = arguments.length; 150 | if (args < 3) { 151 | type = null; 152 | } 153 | return new FakeBlob( 154 | this.data.slice(start, args > 1 ? end : this.data.length) 155 | , type 156 | , this.encoding 157 | ); 158 | }; 159 | FB_proto.toString = function() { 160 | return "[object Blob]"; 161 | }; 162 | FB_proto.close = function() { 163 | this.size = this.data.length = 0; 164 | }; 165 | return FakeBlobBuilder; 166 | }(view)); 167 | 168 | view.Blob = function Blob(blobParts, options) { 169 | var type = options ? (options.type || "") : ""; 170 | var builder = new BlobBuilder(); 171 | if (blobParts) { 172 | for (var i = 0, len = blobParts.length; i < len; i++) { 173 | builder.append(blobParts[i]); 174 | } 175 | } 176 | return builder.getBlob(type); 177 | }; 178 | }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this)); 179 | --------------------------------------------------------------------------------