(メッセージはありません)
@@ -85,7 +85,7 @@ | ||
85 | 85 | |
86 | 86 | //従業者ごとにエラーの数をチェックする。 |
87 | 87 | for (int i = 1; i <= this.employee.size(); i++) { |
88 | - HashMap<String, String> emp = this.employee.get(Integer.valueOf(i)); | |
88 | + HashMap<String, String> emp = this.employee.get(i); | |
89 | 89 | |
90 | 90 | System.out.println(emp.get("EMPLOYEE_NAME")); |
91 | 91 | String employeeName = emp.get("EMPLOYEE_NAME"); |
@@ -105,7 +105,8 @@ | ||
105 | 105 | + "on WR.EMPLOYEE_ID = TR.EMPLOYEE_ID and WR.REC_DATE = TR.CHECK_DATE\n" |
106 | 106 | + "where WR.STATUS = 999 and TR.DISABLE = 0 and WR.REC_DATE <= '%s' and WR.EMPLOYEE_ID = %d order by REC_DATE"; |
107 | 107 | cmd = String.format(cmd, ldate, i); |
108 | - ResultSet rs = ((ClearfyApplication) this.getApplication()).getJdbc() | |
108 | + ResultSet rs = ((ClearfyApplication) this.getApplication()). | |
109 | + getJdbc() | |
109 | 110 | .select(cmd); |
110 | 111 | String message = employeeName + " 様の打刻記録にエラーが見つかりましたのでご連絡します。\n" |
111 | 112 | + "ご確認と訂正をよろしくお願いします。\n" |
@@ -116,7 +117,8 @@ | ||
116 | 117 | } |
117 | 118 | rs.close(); |
118 | 119 | } catch (SQLException ex) { |
119 | - Logger.getLogger(ErrorPicker.class.getName()).log(Level.SEVERE, null, ex); | |
120 | + Logger.getLogger(ErrorPicker.class.getName()).log( | |
121 | + Level.SEVERE, null, ex); | |
120 | 122 | } |
121 | 123 | |
122 | 124 | message += "\n\n※このメッセージはタイムカードシステムより自動配信されております。"; |
@@ -134,20 +136,26 @@ | ||
134 | 136 | MailSetting msetting = new MailSetting(); |
135 | 137 | msetting.setJdbcSupplier(this); |
136 | 138 | MailSender mailer = new MailSender(); |
137 | - String smtpserver = msetting.getParameter(org.clearfy.plugin.mail.Constants.SMTP_SERVER); | |
138 | - String szPort = msetting.getParameter(org.clearfy.plugin.mail.Constants.PORT); | |
139 | + String smtpserver = msetting.getParameter( | |
140 | + org.clearfy.plugin.mail.Constants.SMTP_SERVER); | |
141 | + String szPort = msetting.getParameter( | |
142 | + org.clearfy.plugin.mail.Constants.PORT); | |
139 | 143 | int port = Integer.valueOf(szPort); |
140 | 144 | |
141 | 145 | mailer.setSMTPServer(smtpserver, port) |
142 | 146 | .setStartTls(true) |
143 | 147 | .setAuthenticate(true); |
144 | - int timeout = Integer.valueOf(msetting.getParameter(org.clearfy.plugin.mail.Constants.DEFAULT_TIMEOUT) | |
148 | + int timeout = Integer.valueOf(msetting.getParameter( | |
149 | + org.clearfy.plugin.mail.Constants.DEFAULT_TIMEOUT) | |
145 | 150 | ); |
146 | 151 | mailer.setTimeout(timeout); |
147 | 152 | |
148 | - String domain = msetting.getParameter(org.clearfy.plugin.mail.Constants.DOMAIN); | |
149 | - String myaccount = msetting.getParameter(org.clearfy.plugin.mail.Constants.SYSTEM_MAIL_SENDER); | |
150 | - String password = msetting.getParameter(org.clearfy.plugin.mail.Constants.PASSWORD); | |
153 | + String domain = msetting.getParameter( | |
154 | + org.clearfy.plugin.mail.Constants.DOMAIN); | |
155 | + String myaccount = msetting.getParameter( | |
156 | + org.clearfy.plugin.mail.Constants.SYSTEM_MAIL_SENDER); | |
157 | + String password = msetting.getParameter( | |
158 | + org.clearfy.plugin.mail.Constants.PASSWORD); | |
151 | 159 | |
152 | 160 | mailer.setMessageId(myaccount, domain); |
153 | 161 | mailer.setDebugMode(true); |
@@ -184,7 +192,8 @@ | ||
184 | 192 | rs.next(); |
185 | 193 | rvalue = rs.getInt("reccount"); |
186 | 194 | } catch (SQLException ex) { |
187 | - Logger.getLogger(ErrorPicker.class.getName()).log(Level.SEVERE, null, ex); | |
195 | + Logger.getLogger(ErrorPicker.class.getName()). | |
196 | + log(Level.SEVERE, null, ex); | |
188 | 197 | } |
189 | 198 | return rvalue; |
190 | 199 |
@@ -206,7 +215,8 @@ | ||
206 | 215 | } |
207 | 216 | rs.close(); |
208 | 217 | } catch (SQLException ex) { |
209 | - Logger.getLogger(ErrorPicker.class.getName()).log(Level.SEVERE, null, ex); | |
218 | + Logger.getLogger(ErrorPicker.class.getName()). | |
219 | + log(Level.SEVERE, null, ex); | |
210 | 220 | } |
211 | 221 | } |
212 | 222 |
@@ -231,7 +241,8 @@ | ||
231 | 241 | } |
232 | 242 | rs.close(); |
233 | 243 | } catch (SQLException ex) { |
234 | - Logger.getLogger(ErrorPicker.class.getName()).log(Level.SEVERE, null, ex); | |
244 | + Logger.getLogger(ErrorPicker.class.getName()). | |
245 | + log(Level.SEVERE, null, ex); | |
235 | 246 | } |
236 | 247 | } |
237 | 248 | } |
@@ -34,44 +34,97 @@ | ||
34 | 34 | </head> |
35 | 35 | <body> |
36 | 36 | <wicket:extend> |
37 | - <script> | |
38 | -//ユーザーの現在の位置情報を取得 | |
39 | - navigator.geolocation.getCurrentPosition(successCallback, errorCallback); | |
37 | + <h3>打刻</h3> | |
38 | + <form wicket:id="timeRecorder"> | |
39 | + <div> | |
40 | + <span wicket:id="clock" /> | |
41 | + </div> | |
42 | + <div> | |
43 | + <input type="button" value="打刻" /> | |
44 | + </div> | |
45 | + <div class="locationpicker" > | |
46 | + <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCY2EpuxW8aKPvtDVWt9wmqBPKRHRoPwTQ&callback=initMap" | |
47 | + async defer> | |
48 | + </script> | |
49 | + <label class="localtionpicker title">現在位置</label> | |
50 | + <div class="localtionpicker map" name="map" style="width:40vw; height:25vh;"></div> | |
51 | + <div class="localtionpicker coordinates" name="localtionpicker.coordinates"> | |
52 | + <div> | |
53 | + <label class="locatitonpicker coordinates label">緯度</label> | |
54 | + <label class="locationpicker corrdinaltes parameter" name="latitude">[緯度]</label> | |
55 | + </div> | |
56 | + <div> | |
57 | + <label class="locatitonpicker coordinates label">経度</label> | |
58 | + <label class="locationpicker corrdinaltes parameter" name="longitude">[経度]</label> | |
59 | + </div> | |
60 | + <div> | |
61 | + <label class="locatitonpicker coordinates label">誤差</label> | |
62 | + <label class="locationpicker corrdinaltes parameter" name="accuracy">[誤差]</label> | |
63 | + </div> | |
64 | + </div> | |
65 | + <input class="localtionpicker result" type="hidden" name="map_result" /> | |
66 | + <div class="localtionpicker message" name="show_result" /> | |
67 | + <script> | |
68 | + var currentPosition; | |
69 | + var map; | |
70 | + var marker; | |
71 | + function initMap() { | |
72 | + //ユーザーの現在の位置情報を取得 | |
73 | + navigator.geolocation.getCurrentPosition(successCallback, errorCallback); | |
74 | + } | |
40 | 75 | |
41 | - /***** ユーザーの現在の位置情報を取得 *****/ | |
42 | - function successCallback(position) { | |
43 | - var gl_text = "緯度:" + position.coords.latitude + "<br>"; | |
44 | - gl_text += "経度:" + position.coords.longitude + "<br>"; | |
45 | - gl_text += "高度:" + position.coords.altitude + "<br>"; | |
46 | - gl_text += "緯度・経度の誤差:" + position.coords.accuracy + "<br>"; | |
47 | - gl_text += "高度の誤差:" + position.coords.altitudeAccuracy + "<br>"; | |
48 | - gl_text += "方角:" + position.coords.heading + "<br>"; | |
49 | - gl_text += "速度:" + position.coords.speed + "<br>"; | |
50 | - document.getElementById("show_result").innerHTML = gl_text; | |
51 | - } | |
76 | + /***** ユーザーの現在の位置情報を取得 *****/ | |
77 | + function successCallback(position) { | |
78 | + currentPosition = position; | |
79 | + //wicketとの干渉を避けるため、getElementsByNameで操作 | |
80 | + document.getElementsByName('latitude')[0].textContent = | |
81 | + position.coords.latitude; | |
82 | + document.getElementsByName('longitude')[0].textContent = | |
83 | + position.coords.longitude; | |
84 | + document.getElementsByName('accuracy')[0].textContent = | |
85 | + position.coords.accuracy; | |
52 | 86 | |
53 | - /***** 位置情報が取得できない場合 *****/ | |
54 | - function errorCallback(error) { | |
55 | - var err_msg = ""; | |
56 | - switch (error.code) | |
57 | - { | |
58 | - case 1: | |
59 | - err_msg = "位置情報の利用が許可されていません"; | |
60 | - break; | |
61 | - case 2: | |
62 | - err_msg = "デバイスの位置が判定できません"; | |
63 | - break; | |
64 | - case 3: | |
65 | - err_msg = "タイムアウトしました"; | |
66 | - break; | |
67 | - } | |
68 | - document.getElementById("show_result").innerHTML = err_msg; | |
69 | - //デバッグ用→ document.getElementById("show_result").innerHTML = error.message; | |
70 | - } | |
71 | - </script> | |
72 | - <h3>打刻</h3> | |
73 | - <form wicket:id="timeRecorder"> | |
74 | - <span wicket:id="clock" /> | |
87 | + var position = new google.maps.LatLng( | |
88 | + currentPosition.coords.latitude, | |
89 | + currentPosition.coords.longitude); | |
90 | + | |
91 | + var mapOptions = { | |
92 | + center: position, | |
93 | + zoom: 18, | |
94 | + mapTypeId: google.maps.MapTypeId.ROADMAP | |
95 | + }; | |
96 | + map = new google.maps.Map(document.getElementsByName('map')[0], mapOptions); | |
97 | + var markerOptions = { | |
98 | + position: position, | |
99 | + map: map | |
100 | + }; | |
101 | + marker = new google.maps.Marker(markerOptions); | |
102 | + document.getElementsByName('map_result')[0].setAttribute("value", 0); | |
103 | + } | |
104 | + | |
105 | + /***** 位置情報が取得できない場合 *****/ | |
106 | + function errorCallback(error) { | |
107 | + var err_msg = ""; | |
108 | + switch (error.code) | |
109 | + { | |
110 | + case 1: | |
111 | + err_msg = "位置情報の利用が許可されていません"; | |
112 | + break; | |
113 | + case 2: | |
114 | + err_msg = "デバイスの位置が判定できません"; | |
115 | + break; | |
116 | + case 3: | |
117 | + err_msg = "タイムアウトしました"; | |
118 | + break; | |
119 | + } | |
120 | + document.getElementsByName('map')[0].setAttribute("style", "display: none;"); | |
121 | + document.getElementsByName('localtionpicker.coordinates')[0].setAttribute("style", "display: none;"); | |
122 | + document.getElementsByName('map_result')[0].setAttribute("value", error.code); | |
123 | + document.getElementsByName("show_result")[0].innerHTML = err_msg; | |
124 | + //デバッグ用→ document.getElementById("show_result").innerHTML = error.message; | |
125 | + } | |
126 | + </script> | |
127 | + </div> | |
75 | 128 | </form> |
76 | 129 | <div class="section center"> |
77 | 130 | <h3>本日の打刻状況</h3> |
@@ -75,7 +75,7 @@ | ||
75 | 75 | } |
76 | 76 | }; |
77 | 77 | this.timeRecorder.add(new DateLabel("clock", clockModel, |
78 | - new PatternDateConverter("yyyy/MM/dd HH:mm:ss", true)) { | |
78 | + new PatternDateConverter("yyyy/MM/dd HH:mm:ss", true)) { | |
79 | 79 | @Override |
80 | 80 | protected void onInitialize() { |
81 | 81 | super.onInitialize(); |
@@ -112,7 +112,8 @@ | ||
112 | 112 | } |
113 | 113 | |
114 | 114 | @Override |
115 | - public void beforeCreateColumns(List<IColumn<Record, String>> columns) { | |
115 | + public void beforeCreateColumns( | |
116 | + List<IColumn<Record, String>> columns) { | |
116 | 117 | } |
117 | 118 | |
118 | 119 | @Override |
@@ -125,7 +126,7 @@ | ||
125 | 126 | |
126 | 127 | @Override |
127 | 128 | public void onRecordSelected(AjaxRequestTarget target, Record record) { |
128 | - //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
129 | + | |
129 | 130 | } |
130 | 131 | }; |
131 | 132 | this.tableView.setOutputMarkupId(true); |
@@ -143,20 +144,23 @@ | ||
143 | 144 | this.tableView.clear(); |
144 | 145 | |
145 | 146 | LocalDateTime currentTime = LocalDateTime.now(); |
146 | - LocalDateTime todayStart = currentTime.withHour(0).withMinute(0).withSecond(0); | |
147 | - String szCurrentTime = todayStart.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); | |
147 | + LocalDateTime todayStart = currentTime.withHour(0).withMinute(0). | |
148 | + withSecond(0); | |
149 | + String szCurrentTime = todayStart.format(DateTimeFormatter.ofPattern( | |
150 | + "yyyy-MM-dd")); | |
148 | 151 | |
149 | 152 | LocalDateTime nextStart = todayStart.plusDays(1); |
150 | - String szNextTime = nextStart.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); | |
153 | + String szNextTime = nextStart.format(DateTimeFormatter.ofPattern( | |
154 | + "yyyy-MM-dd")); | |
151 | 155 | |
152 | 156 | String cmd = "select TIME_RECORD_ID 打刻ID, CHECK_DATE 勤務日, RECORD_DATETIME 打刻日時, EMPLOYEE_NAME 従業者," |
153 | - + " ORGANIZATION_NAME 場所 from TIME_RECORD TR\n" | |
154 | - + "inner join EMPLOYEE E on\n" | |
155 | - + " E.EMPLOYEE_ID = TR.EMPLOYEE_ID\n" | |
156 | - + "inner join ORGANIZATION O on\n" | |
157 | - + " TR.ORGANIZATION_ID = O.ORGANIZATION_ID " | |
158 | - + " where CHECK_DATE >= '%s' and CHECK_DATE < '%s' and TR.DISABLE = 0 " | |
159 | - + " order by RECORD_DATETIME desc"; | |
157 | + + " ORGANIZATION_NAME 場所 from TIME_RECORD TR\n" | |
158 | + + "inner join EMPLOYEE E on\n" | |
159 | + + " E.EMPLOYEE_ID = TR.EMPLOYEE_ID\n" | |
160 | + + "inner join ORGANIZATION O on\n" | |
161 | + + " TR.ORGANIZATION_ID = O.ORGANIZATION_ID " | |
162 | + + " where CHECK_DATE >= '%s' and CHECK_DATE < '%s' and TR.DISABLE = 0 " | |
163 | + + " order by RECORD_DATETIME desc"; | |
160 | 164 | cmd = String.format(cmd, szCurrentTime, szNextTime); |
161 | 165 | //this.recordList.select(cmd); |
162 | 166 |