Commit fc1818a31d9887430d281f50c538e240299dca12

Authored by 潘钊
1 parent 3eaea7a9

update...

src/main/java/com/bsth/controller/attendace/AttendaceController.java
1 1 package com.bsth.controller.attendace;
2 2  
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.data.attendance.entity.JsyAttendance;
3 5 import org.springframework.web.bind.annotation.RequestMapping;
4 6 import org.springframework.web.bind.annotation.RestController;
5 7  
... ... @@ -8,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
8 10 */
9 11 @RestController
10 12 @RequestMapping("attendace")
11   -public class AttendaceController {
  13 +public class AttendaceController extends BaseController<JsyAttendance, Long> {
12 14  
13 15  
14 16 }
... ...
src/main/java/com/bsth/data/attendance/entity/JsyAttendance.java
... ... @@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
7 7 import javax.persistence.Entity;
8 8 import javax.persistence.Id;
9 9 import javax.persistence.Table;
  10 +import javax.persistence.Transient;
10 11 import java.util.Date;
11 12  
12 13 /**
... ... @@ -22,8 +23,17 @@ public class JsyAttendance {
22 23  
23 24 private String company;
24 25  
  26 + private String fgsCompany;
  27 +
25 28 private String userId;
26 29  
  30 + private String userName;
  31 +
  32 + private String lineCode;
  33 +
  34 + @Transient
  35 + private String lineName;
  36 +
27 37 /**
28 38 * 0: 签到
29 39 * 1:签退
... ... @@ -40,6 +50,7 @@ public class JsyAttendance {
40 50  
41 51 private Date serverTime;
42 52  
  53 + private String cardNo;
43 54  
44 55 static Logger logger = LoggerFactory.getLogger(JsyAttendance.class);
45 56  
... ... @@ -135,4 +146,44 @@ public class JsyAttendance {
135 146 public void setServerTime(Date serverTime) {
136 147 this.serverTime = serverTime;
137 148 }
  149 +
  150 + public String getFgsCompany() {
  151 + return fgsCompany;
  152 + }
  153 +
  154 + public void setFgsCompany(String fgsCompany) {
  155 + this.fgsCompany = fgsCompany;
  156 + }
  157 +
  158 + public String getCardNo() {
  159 + return cardNo;
  160 + }
  161 +
  162 + public void setCardNo(String cardNo) {
  163 + this.cardNo = cardNo;
  164 + }
  165 +
  166 + public String getUserName() {
  167 + return userName;
  168 + }
  169 +
  170 + public void setUserName(String userName) {
  171 + this.userName = userName;
  172 + }
  173 +
  174 + public String getLineCode() {
  175 + return lineCode;
  176 + }
  177 +
  178 + public void setLineCode(String lineCode) {
  179 + this.lineCode = lineCode;
  180 + }
  181 +
  182 + public String getLineName() {
  183 + return lineName;
  184 + }
  185 +
  186 + public void setLineName(String lineName) {
  187 + this.lineName = lineName;
  188 + }
138 189 }
... ...
src/main/java/com/bsth/data/schedule/real/ScheduleDataBuffer.java
... ... @@ -197,7 +197,7 @@ public class ScheduleDataBuffer implements CommandLineRunner {
197 197  
198 198 @Override
199 199 public void run(String... strings) throws Exception {
200   - Application.mainServices.scheduleWithFixedDelay(fixedRefreshThread, 40, 30, TimeUnit.SECONDS);
  200 + Application.mainServices.scheduleWithFixedDelay(fixedRefreshThread, 40, 230, TimeUnit.SECONDS);
201 201 }
202 202  
203 203 /**
... ...
src/main/java/com/bsth/repository/attendace/AttendaceRepository.java 0 → 100644
  1 +package com.bsth.repository.attendace;
  2 +
  3 +import com.bsth.data.attendance.entity.JsyAttendance;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2018/2/23.
  9 + */
  10 +@Repository
  11 +public interface AttendaceRepository extends BaseRepository<JsyAttendance, Long>{
  12 +}
... ...
src/main/java/com/bsth/service/attendace/AttendaceService.java 0 → 100644
  1 +package com.bsth.service.attendace;
  2 +
  3 +import com.bsth.data.attendance.entity.JsyAttendance;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +/**
  7 + * Created by panzhao on 2018/2/23.
  8 + */
  9 +public interface AttendaceService extends BaseService<JsyAttendance, Long>{
  10 +}
... ...
src/main/java/com/bsth/service/attendace/AttendaceServiceImpl.java 0 → 100644
  1 +package com.bsth.service.attendace;
  2 +
  3 +import com.bsth.data.attendance.entity.JsyAttendance;
  4 +import com.bsth.data.basic.line.LineDataBuffer;
  5 +import com.bsth.entity.Line;
  6 +import com.bsth.service.impl.BaseServiceImpl;
  7 +import org.springframework.data.domain.Page;
  8 +import org.springframework.data.domain.Pageable;
  9 +import org.springframework.stereotype.Service;
  10 +
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by panzhao on 2018/2/23.
  15 + */
  16 +@Service
  17 +public class AttendaceServiceImpl extends BaseServiceImpl<JsyAttendance, Long> implements AttendaceService{
  18 +
  19 + @Override
  20 + public Page<JsyAttendance> list(Map<String, Object> map, Pageable pageable) {
  21 + Page<JsyAttendance> page = super.list(map, pageable);
  22 +
  23 + Line line;
  24 + for(JsyAttendance att : page.getContent()){
  25 + line = LineDataBuffer.get(att.getLineCode());
  26 + if(null != line)
  27 + att.setLineName(line.getName());
  28 + }
  29 + return page;
  30 + }
  31 +}
... ...
src/main/resources/static/assets/css/main.css
... ... @@ -574,7 +574,7 @@ table tr th, table tr td{
574 574 /*ct_plan_inout_tab_width*/
575 575  
576 576 .ct_plan_inout_tab_width{
577   - font-size: 18px;
  577 + font-size: 15px;
578 578 }
579 579  
580 580 .ct_plan_inout_tab_width.uk-table{
... ... @@ -952,4 +952,33 @@ table tr th, table tr td{
952 952  
953 953 .charge_pile_wrap>.berth_card:nth-of-type(1){
954 954 margin-right: 4px;
  955 +}
  956 +
  957 +.ct_attendance_list_table a{
  958 + text-decoration: underline;
  959 +}
  960 +
  961 +.ct_attendance_tab_width th:nth-of-type(1), .ct_attendance_tab_width td:nth-of-type(1) {
  962 + width: 12%;
  963 +}
  964 +.ct_attendance_tab_width th:nth-of-type(2), .ct_attendance_tab_width td:nth-of-type(2) {
  965 + width: 12%;
  966 +}
  967 +.ct_attendance_tab_width th:nth-of-type(3), .ct_attendance_tab_width td:nth-of-type(3) {
  968 + width: 8%;
  969 +}
  970 +.ct_attendance_tab_width th:nth-of-type(4), .ct_attendance_tab_width td:nth-of-type(4) {
  971 + width: 14%;
  972 +}
  973 +.ct_attendance_tab_width th:nth-of-type(5), .ct_attendance_tab_width td:nth-of-type(5) {
  974 + width: 14%;
  975 +}
  976 +.ct_attendance_tab_width th:nth-of-type(6), .ct_attendance_tab_width td:nth-of-type(6) {
  977 + width: 14%;
  978 +}
  979 +.ct_attendance_tab_width th:nth-of-type(7), .ct_attendance_tab_width td:nth-of-type(7) {
  980 + width: 13%;
  981 +}
  982 +.ct_attendance_tab_width th:nth-of-type(8), .ct_attendance_tab_width td:nth-of-type(8) {
  983 + width: 13%;
955 984 }
956 985 \ No newline at end of file
... ...
src/main/resources/static/index.html
... ... @@ -29,7 +29,7 @@
29 29 <span class="ct-btn-link lasting" data-name="b_p_manager" data-page="/pages/b_p_manager/b_p_main.html">停放监管</span>
30 30 <span class="ct-btn-link lasting">异常监管</span>
31 31 <span class="ct-btn-link" data-name="inout_data" data-page="/pages/inout/in_out_main.html">进出场</span>
32   - <span class="ct-btn-link">签到/退</span>
  32 + <span class="ct-btn-link" data-name="attendance_data" data-page="/pages/attendance/att_data_main.html">签到/退</span>
33 33 <span class="ct-btn-link">计划/任务</span>
34 34 <span class="ct-btn-link" data-name="basic_data" data-page="/pages/basic_data/main.html">基础数据</span>
35 35 <span class="ct-btn-link">系统管理</span>
... ...
src/main/resources/static/pages/attendance/att_data_main.html 0 → 100644
  1 +<div id="att_data_wrap" class="l_r_split_screen">
  2 +
  3 + <div class="left-menus">
  4 + <ul class="uk-list">
  5 + <li class="ct-btn-link" data-name="att_list" data-page="/pages/attendance/list.html">签到退记录</li>
  6 + </ul>
  7 + </div>
  8 + <div class="right-body">
  9 +
  10 + </div>
  11 +
  12 + <script>
  13 + (function () {
  14 + var wrap = '#att_data_wrap', $body = $('.right-body', wrap);
  15 +
  16 + $('.left-menus .ct-btn-link', wrap).on('click', function () {
  17 + var page = $(this).data('page');
  18 + if(!page)
  19 + return;
  20 +
  21 + var that = this;
  22 + $body.empty().load(page, function () {
  23 + $('.left-menus .ct-btn-link.active', wrap).removeClass('active');
  24 + $(that).addClass('active');
  25 + });
  26 + });
  27 +
  28 + //默认选中第一项
  29 + $('.left-menus .ct-btn-link:eq(0)', wrap).trigger('click');
  30 + })();
  31 + </script>
  32 +</div>
0 33 \ No newline at end of file
... ...
src/main/resources/static/pages/attendance/list.html 0 → 100644
  1 +<div id="attendance_list_wrap" style="padding: 25px;height: calc(100% - 50px);">
  2 +
  3 + <div class="ct_cont" style="height: 100%;">
  4 + <div class="ct_search_form_wrap">
  5 + <form>
  6 + <div class="ct_field">
  7 + <label>公司:
  8 + <select class="uk-select" name="company_eq">
  9 + </select>
  10 + </label>
  11 + </div>
  12 + <div class="ct_field">
  13 + <label>分公司:
  14 + <select class="uk-select" name="fgsCompany_eq">
  15 + </select>
  16 + </label>
  17 + </div>
  18 + <div class="ct_field">
  19 + <label>状态:
  20 + <select class="uk-select" name="type_eq">
  21 + <option value="">全部</option>
  22 + <option value="0">签到</option>
  23 + <option value="1">签退</option>
  24 + </select>
  25 + </label>
  26 + </div>
  27 + <div class="ct_field">
  28 + <label>出入时间:
  29 + <input class="uk-input flatpickr_input" name="at_gt" style="width: 130px">
  30 + 至
  31 + <input class="uk-input flatpickr_input" name="t_lt" style="width: 130px">
  32 + </label>
  33 + </div>
  34 + <div class="ct_field">
  35 + <label>线路:
  36 + <select class="" name="lineCode_eq">
  37 + </select>
  38 + </label>
  39 + </div>
  40 + <div class="ct_field">
  41 + <label>工号:
  42 + <input class="uk-input" name="userId_like" placeholder="员工号">
  43 + </label>
  44 + </div>
  45 + <div class="ct_field">
  46 + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button>
  47 + </div>
  48 + </form>
  49 + </div>
  50 + <div class="ct_table_wrap" >
  51 + <table class="uk-table uk-table-small ct_attendance_tab_width" style="margin-bottom: 0;">
  52 + <thead>
  53 + <tr>
  54 + <th>人卡号</th>
  55 + <th>员工号</th>
  56 + <th>状态</th>
  57 + <th>操作时间</th>
  58 + <th>出门证内容</th>
  59 + <th>线路</th>
  60 + <th>所属分公司</th>
  61 + <th>查询机IP</th>
  62 + </tr>
  63 + </thead>
  64 + </table>
  65 + <div class="t_body_wrap" >
  66 + <table class="uk-table uk-table-divider uk-table-hover uk-table-small ct_attendance_list_table ct_attendance_tab_width">
  67 + <tbody>
  68 + </tbody>
  69 + </table>
  70 + </div>
  71 + <div class="pagination-holder"></div>
  72 + <div class="count_text"></div>
  73 + </div>
  74 + </div>
  75 +
  76 + <script id="attendance_list_body-temp" type="text/html">
  77 + {{each list as obj i}}
  78 + <tr>
  79 + <td>{{obj.cardNo}}</td>
  80 + <td>{{obj.userId}}/{{obj.userName}}</td>
  81 + <td>{{obj.type==0?'签到':'签退'}}</td>
  82 + <td>{{obj.tStr}}</td>
  83 + <td><a>{{obj.outCard}}</a></td>
  84 + <td>{{obj.lineCode}}/{{obj.lineName}}</td>
  85 + <td>{{company_ns[obj.company+'_'+obj.fgsCompany]}}</td>
  86 + <td>{{obj.ip}}</td>
  87 + </tr>
  88 + {{/each}}
  89 + </script>
  90 +
  91 + <script>
  92 + (function () {
  93 + var wrap = '#attendance_list_wrap', ps = $('.t_body_wrap', wrap);
  94 +
  95 + var page=0, pageSize=14, fs = 'YYYY-MM-DD HH:mm';
  96 + //日期控件
  97 + flatpickr(wrap + ' .flatpickr_input', flatpickrDateTimeConfig);
  98 + //初始化公司——>分公司 ——> 线路级联下拉框
  99 + var comp = $('[name=company_eq]', wrap);
  100 + var fgsComp = $('[name=fgsCompany_eq]', wrap);
  101 + var lineSelect = $('[name=lineCode_eq]', wrap);
  102 + gb_common.companySelect(comp, fgsComp, lineSelect);
  103 +
  104 + query();
  105 + function query() {
  106 + var data = $('.ct_search_form_wrap>form', wrap).serializeJSON();
  107 + data.page=page;
  108 + data.size=pageSize;
  109 + data.order='at';
  110 + //时间戳转换
  111 + if(data.t_gt)
  112 + data.at_gt = moment(data.t_gt, fs).format('X') + '000';
  113 + if(data.t_lt)
  114 + data.at_lt = moment(data.t_lt, fs).format('X') + '000';
  115 +
  116 + delete data.t_gt;
  117 + delete data.t_lt;
  118 + //query
  119 + gb_common.$get('/attendace', data, function (rs) {
  120 + //处理时间戳
  121 + handlerTime(rs.content);
  122 + var tbodyStr = template('attendance_list_body-temp', {list:rs.content, company_ns: company_code_name});
  123 + $('.ct_attendance_list_table>tbody', wrap).html(tbodyStr);
  124 +
  125 + if (resetPagination){
  126 + pagination(rs['totalPages'], rs.number);
  127 + }
  128 + });
  129 +
  130 + }
  131 +
  132 + var resetPagination = true;
  133 + var pagination = function(pages, currentPage) {
  134 + //分页
  135 + $('.pagination-holder', wrap).pagination({
  136 + pages: pages,
  137 + currentPage: currentPage,
  138 + cssStyle: 'light-theme',
  139 + onPageClick: function (pageNumber, e) {
  140 + e.stopPropagation();
  141 + page = pageNumber - 1;
  142 + query();
  143 + return false;
  144 + }
  145 + });
  146 + resetPagination = false;
  147 + };
  148 +
  149 + $('.ct_search_form_wrap', wrap).on('submit', function () {
  150 + resetPagination = true;
  151 + page = 0;
  152 + query();
  153 + return false;
  154 + });
  155 +
  156 + function handlerTime(list) {
  157 + for(var i=0,obj;obj=list[i++];){
  158 + if(obj.at)
  159 + obj.tStr = moment(obj.at).format(fs+':ss');
  160 + }
  161 + }
  162 +
  163 + })();
  164 + </script>
  165 +</div>
0 166 \ No newline at end of file
... ...
src/main/resources/static/pages/inout/in_out_schedule/list.html
1   -<div id="in_out_schedule_list_wrap" style="height: calc(100% - 20px);padding: 20px 0 0 10px;background: #fdfdfd;">
  1 +<div id="in_out_schedule_list_wrap" style="height: calc(100% - 20px);padding: 20px 0 0 10px;">
2 2  
3 3 <div class="ct_table_wrap" style="height: calc(100% - 40px);">
4 4 <table class="uk-table uk-table-small ct_plan_inout_tab_width" style="margin-bottom: 0;">
... ...