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 |
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(""),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=/^,J=/^<\//,H=/\x3c!--(.*?)--\x3e/g,x=/]*?)>/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 |
--------------------------------------------------------------------------------