Commit 2159f48a981eb23f67f925a1dbc1356e03ccc720

Authored by 潘钊
1 parent 2de24e68

update...

src/main/java/com/bsth/controller/schedule/InOutScheduleController.java
... ... @@ -66,4 +66,14 @@ public class InOutScheduleController {
66 66 public Map<String, Object> rybd(@RequestParam Map<String, Object> map){
67 67 return inOutScheduleService.rybd(map);
68 68 }
  69 +
  70 + /**
  71 + * 车已出场
  72 + * @param map
  73 + * @return
  74 + */
  75 + @RequestMapping(value = "cycc", method = RequestMethod.POST)
  76 + public Map<String, Object> cycc(@RequestParam Map<String, Object> map){
  77 + return inOutScheduleService.cycc(map);
  78 + }
69 79 }
... ...
src/main/java/com/bsth/data/abnormal/MainAbnormalClient.java
... ... @@ -83,4 +83,8 @@ public class MainAbnormalClient {
83 83 public AbnormalEntity rybd(Long id,String timeStr, String reason, String remark) {
84 84 return attendanceHandler.rybd(id, timeStr, reason, remark);
85 85 }
  86 +
  87 + public AbnormalEntity cycc(Long id, String timeStr, String reason, String remarks) {
  88 + return inOutHandler.cycc(id, timeStr, reason, remarks);
  89 + }
86 90 }
... ...
src/main/java/com/bsth/data/abnormal/handler/AttendanceHandler.java
... ... @@ -78,8 +78,7 @@ public class AttendanceHandler {
78 78 ae.setReason(reason);
79 79  
80 80 ScheduleInOut sio = ScheduleDataBuffer.findById(id);
81   - if(null != sio && sio.getAbnormalStatus()==-1)
82   - sio.setAbnormalStatus(0);
  81 + sio.reCalcAnStatus();
83 82  
84 83 schIdMap.remove(ae.getSchId());
85 84 return ae;
... ...
src/main/java/com/bsth/data/abnormal/handler/InOutHandler.java
... ... @@ -3,6 +3,7 @@ package com.bsth.data.abnormal.handler;
3 3 import com.bsth.data.abnormal.entity.AbnormalEntity;
4 4 import com.bsth.data.schedule.dto.ScheduleInOut;
5 5 import com.bsth.data.schedule.real.ScheduleDataBuffer;
  6 +import com.bsth.security.util.SecurityUtils;
6 7 import org.springframework.stereotype.Component;
7 8  
8 9 import java.util.concurrent.ConcurrentHashMap;
... ... @@ -54,4 +55,26 @@ public class InOutHandler {
54 55 public void handler(Long id){
55 56  
56 57 }
  58 +
  59 + public AbnormalEntity cycc(Long id, String timeStr, String reason, String remarks) {
  60 +
  61 +
  62 + AbnormalEntity ae = schIdMap.get(id);
  63 + if(null == ae)
  64 + return null;
  65 +
  66 + Long t = System.currentTimeMillis();
  67 +
  68 +
  69 + ae.setHandlerTime(t);
  70 + ae.setHandlerUser(SecurityUtils.getCurrentUser().getUserName());
  71 + ae.setHandlerDes(timeStr + "已出场,备注:" + remarks);
  72 + ae.setReason(reason);
  73 +
  74 + ScheduleInOut sio = ScheduleDataBuffer.findById(id);
  75 + sio.reCalcAnStatus();
  76 +
  77 + schIdMap.remove(ae.getSchId());
  78 + return ae;
  79 + }
57 80 }
... ...
src/main/java/com/bsth/data/schedule/dto/ScheduleInOut.java
... ... @@ -52,6 +52,11 @@ public class ScheduleInOut {
52 52 private Long outTimeRfid;//出场时间 -rfid
53 53 private Long outTimePzsb;//出场时间 -牌照识别
54 54  
  55 + /**
  56 + * 设置出场时间的用户,手动出场时,该字段有值
  57 + */
  58 + private String ccTimeUser;
  59 +
55 60 public Long getId() {
56 61 return id;
57 62 }
... ... @@ -315,4 +320,24 @@ public class ScheduleInOut {
315 320 public void setjNameCamelChars(String jNameCamelChars) {
316 321 this.jNameCamelChars = jNameCamelChars;
317 322 }
  323 +
  324 + /**
  325 + * 设置异常状态
  326 + */
  327 + public void reCalcAnStatus() {
  328 + this.abnormalStatus = 0;
  329 + if(null == this.attSjTime)
  330 + this.abnormalStatus = -1;
  331 +
  332 + if(null == this.outTimeRfid)
  333 + this.abnormalStatus = -2;
  334 + }
  335 +
  336 + public String getCcTimeUser() {
  337 + return ccTimeUser;
  338 + }
  339 +
  340 + public void setCcTimeUser(String ccTimeUser) {
  341 + this.ccTimeUser = ccTimeUser;
  342 + }
318 343 }
... ...
src/main/java/com/bsth/service/schedule/ScheduleService.java
... ... @@ -36,6 +36,8 @@ public interface ScheduleService {
36 36  
37 37 Map<String,Object> rybd(Map<String, Object> map);
38 38  
  39 + Map<String,Object> cycc(Map<String, Object> map);
  40 +
39 41 //void inOut(CarInOutEntity obj);
40 42  
41 43 //void busInOut(CarInOutEntity obj);
... ...
src/main/java/com/bsth/service/schedule/impl/ScheduleServiceImpl.java
... ... @@ -237,4 +237,36 @@ public class ScheduleServiceImpl implements ScheduleService {
237 237 }
238 238 return rs;
239 239 }
  240 +
  241 + @Override
  242 + public Map<String, Object> cycc(Map<String, Object> map) {
  243 + Map<String, Object> rs = new HashMap<>();
  244 +
  245 + try{
  246 + String rq = map.get("rq").toString();
  247 + String timeStr = map.get("outSjTimeStr").toString();
  248 + String reason = map.get("reason").toString();
  249 + String remarks = map.get("remarks").toString();
  250 + Long id = Long.parseLong(map.get("schId").toString());
  251 +
  252 +
  253 + long time = fmtyyyyMMddHHmm.parseMillis(rq+timeStr);
  254 +
  255 + //班次设置RFID出场时间
  256 + ScheduleInOut sio = ScheduleDataBuffer.findById(id);
  257 + sio.setOutTimeRfid(time);
  258 + sio.setCcTimeUser(SecurityUtils.getCurrentUser().getUserName());
  259 +
  260 + //处理掉异常
  261 + AbnormalEntity ae = mainAbnormalClient.cycc(id,timeStr,reason,remarks);
  262 +
  263 + rs.put("status", ResponseCode.SUCCESS);
  264 + rs.put("t", sio);
  265 + rs.put("ae", ae);
  266 + }catch (Exception e){
  267 + logger.error("", e);
  268 + rs.put("status", ResponseCode.ERROR);
  269 + }
  270 + return rs;
  271 + }
240 272 }
... ...
src/main/resources/static/pages/abnormal/fragments/expand_card_modal.html
... ... @@ -67,7 +67,9 @@
67 67 </td>
68 68 <td><span title="{{sch.remarks}}">{{sch.remarks}}</span></td>
69 69 <td>
70   - {{if sch.outTimeRfid!=null && sch.outTimePzsb!=null}}
  70 + {{if sch.outTimeRfid!=null && sch.ccTimeUser!=null}}
  71 + <small>已出场(-{{sch.ccTimeUser}})</small>
  72 + {{else if sch.outTimeRfid!=null && sch.outTimePzsb!=null}}
71 73 <small style="color: #2283e3;">已出场(2)</small>
72 74 {{else if sch.outTimeRfid!=null}}
73 75 <small>已出场(RFID)</small>
... ...
src/main/resources/static/pages/abnormal/fragments/type_0/h_cont_rybd.html
... ... @@ -79,6 +79,8 @@
79 79  
80 80 //submit
81 81 var f = $('form', wrap).formValidation(gb_form_validation_opts);
  82 +
  83 + $('[name=attSjTimeStr]', f).focus();
82 84 //日期默认值
83 85 $('[name=rq]', f).val(moment().format('YYYY-MM-DD'));
84 86 $('.submit-btn', wrap).on('click', function () {
... ... @@ -89,7 +91,6 @@
89 91  
90 92 var data = $(this).serializeJSON();
91 93  
92   - console.log('data', data);
93 94 gb_common.$post('/in_out/rybd', data, function (rs) {
94 95 UIkit.notification('操作成功!', 'success');
95 96 gb_os_card.update(rs.t);
... ...
src/main/resources/static/pages/abnormal/fragments/type_1/abnormal_handler.html
... ... @@ -24,7 +24,7 @@
24 24 //加载片段1
25 25 $.get(folder + 'h_cont_cycc.html', function (dom) {
26 26 $('._content_one',wrap).html(dom);
27   - $('.handler_cont_cycc_wrap', wrap).trigger('init', {ae: ae});
  27 + $('.handler_cont_cycc_wrap', wrap).trigger('init', {ae: ae, modalId: modalId});
28 28 });
29 29  
30 30 //加载片段2
... ...
src/main/resources/static/pages/abnormal/fragments/type_1/h_cont_cycc.html
... ... @@ -19,18 +19,19 @@
19 19 <td>{{ae.lineName}}</td>
20 20 <td>{{ae.lpName}}</td>
21 21 <td>{{ae.nbbm}}</td>
22   - <td>{{ae.dfsjStr}}</td>
  22 + <td>{{ae.planTimeStr}}</td>
23 23 <td>{{current_tcc_name}}</td>
24 24 <td><samp>未出场</samp></td>
25 25 </tr>
26 26 </table>
27 27  
28 28 <form class="uk-form-horizontal">
  29 + <input type="hidden" value="{{ae.schId}}" name="schId">
29 30 <div class="uk-margin">
30 31 <label class="uk-form-label" for="form-horizontal-text">出场时间</label>
31 32 <div class="uk-form-controls">
32 33 <input class="uk-input" name="rq" type="date" style="width: 160px;" required>
33   - <input class="uk-input" name="attSjTimeStr" id="form-horizontal-text" type="time" style="width: calc(100% - 170px)" required>
  34 + <input class="uk-input" name="outSjTimeStr" id="form-horizontal-text" type="time" style="width: calc(100% - 170px)" required>
34 35 </div>
35 36 </div>
36 37  
... ... @@ -62,7 +63,7 @@
62 63 <script>
63 64 (function () {
64 65  
65   - var wrap = '.handler_cont_cycc_wrap', ae, $cont;
  66 + var wrap = '.handler_cont_cycc_wrap', ae, $cont, modalId;
66 67  
67 68  
68 69 $(wrap).on('init', function (e, data) {
... ... @@ -71,13 +72,16 @@
71 72 return;
72 73  
73 74 ae = data.ae;
  75 + modalId = data.modalId;
74 76  
75 77 var htmlStr = template('o_s_abnormal_handler_cycc-temp', {ae: ae, current_tcc_name: current_tcc_name});
76 78 $cont = $('.hc_body', wrap).html(htmlStr);
77 79  
78 80 //submit
79 81 var f = $('form', wrap).formValidation(gb_form_validation_opts);
  82 +
80 83 $('[name=rq]', f).val(moment().format('YYYY-MM-DD'));
  84 + $('[name=outSjTimeStr]', f).focus();
81 85 $('.submit-btn', wrap).on('click', function () {
82 86 f.submit();
83 87 });
... ... @@ -86,7 +90,12 @@
86 90  
87 91 var data = $(this).serializeJSON();
88 92  
89   - console.log('data', data);
  93 + gb_common.$post('/in_out/cycc', data, function (rs) {
  94 + UIkit.notification('操作成功!', 'success');
  95 + gb_os_card.update(rs.t);
  96 + gb_o_s_abnormal.handle(rs.ae);
  97 + UIkit.modal(modalId).hide();
  98 + });
90 99 });
91 100  
92 101 //选择原因
... ...
src/main/resources/static/pages/abnormal/main.html
... ... @@ -135,7 +135,7 @@
135 135 </dd>
136 136 <dd class="parallel_dl">
137 137 <span>{{sch.dfsjStr}}</span>
138   - <span class="green"></span>
  138 + <span style="color: {{sch.rfidLate>0?'red':'blue'}};">{{sch.outTimeRfidStr}}</span>
139 139 </dd>
140 140 </dl>
141 141 {{/if}}
... ...