wuxw %!s(int64=6) %!d(string=hai) anos
pai
achega
89284e806b
Modificáronse 14 ficheiros con 712 adicións e 232 borrados
  1. 2 0
      HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/machineRecord/AbstractMachineRecordBusinessServiceDataFlowListener.java
  2. 10 1
      WebService/src/main/java/com/java110/web/components/machineRecord/MachineRecordManageComponent.java
  3. 49 0
      WebService/src/main/java/com/java110/web/components/machineRecord/MachineVistorPhotoManageComponent.java
  4. 10 1
      WebService/src/main/resources/components/machinePackage/machineRecord-manage/machineRecordManage.html
  5. 3 1
      WebService/src/main/resources/components/machinePackage/machineRecord-manage/machineRecordManage.js
  6. 64 0
      WebService/src/main/resources/components/machinePackage/machineRecordDetail/machineRecordDetail.html
  7. 42 0
      WebService/src/main/resources/components/machinePackage/machineRecordDetail/machineRecordDetail.js
  8. 133 0
      WebService/src/main/resources/components/machinePackage/machineVistorPhoto-manage/machineVistorPhotoManage.html
  9. 83 0
      WebService/src/main/resources/components/machinePackage/machineVistorPhoto-manage/machineVistorPhotoManage.js
  10. 36 0
      WebService/src/main/resources/views/machineVistorPhotoFlow.html
  11. 9 0
      java110-bean/src/main/java/com/java110/dto/hardwareAdapation/MachineRecordDto.java
  12. 42 21
      java110-bean/src/main/java/com/java110/vo/api/machineRecord/ApiMachineRecordDataVo.java
  13. 2 0
      java110-db/db/HardwareAdapationService/create_machine_record.sql
  14. 227 208
      java110-db/src/main/resources/mapper/hardwareAdapation/MachineRecordServiceDaoImplMapper.xml

+ 2 - 0
HardwareAdapationService/src/main/java/com/java110/hardwareAdapation/listener/machineRecord/AbstractMachineRecordBusinessServiceDataFlowListener.java

@@ -48,6 +48,7 @@ public abstract class AbstractMachineRecordBusinessServiceDataFlowListener exten
         businessMachineRecordInfo.put("tel", businessMachineRecordInfo.get("tel"));
         businessMachineRecordInfo.put("communityId", businessMachineRecordInfo.get("community_id"));
         businessMachineRecordInfo.put("fileId", businessMachineRecordInfo.get("file_id"));
+        businessMachineRecordInfo.put("recordTypeCd", businessMachineRecordInfo.get("record_type_cd"));
         businessMachineRecordInfo.remove("bId");
         businessMachineRecordInfo.put("statusCd", statusCd);
     }
@@ -83,6 +84,7 @@ public abstract class AbstractMachineRecordBusinessServiceDataFlowListener exten
         currentMachineRecordInfo.put("tel", currentMachineRecordInfo.get("tel"));
         currentMachineRecordInfo.put("communityId", currentMachineRecordInfo.get("community_id"));
         currentMachineRecordInfo.put("fileId", currentMachineRecordInfo.get("file_id"));
+        currentMachineRecordInfo.put("recordTypeCd", currentMachineRecordInfo.get("record_type_cd"));
 
 
         currentMachineRecordInfo.put("operate", StatusConstant.OPERATE_DEL);

+ 10 - 1
WebService/src/main/java/com/java110/web/components/machineRecord/MachineRecordManageComponent.java

@@ -1,7 +1,10 @@
 package com.java110.web.components.machineRecord;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.java110.core.context.IPageData;
+import com.java110.core.context.PageData;
+import com.java110.utils.constant.StateConstant;
 import com.java110.web.smo.machineRecord.IListMachineRecordsSMO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
@@ -27,7 +30,13 @@ public class MachineRecordManageComponent {
      * @return 返回 ResponseEntity 对象
      */
     public ResponseEntity<String> list(IPageData pd){
-        return listMachineRecordsSMOImpl.listMachineRecords(pd);
+        JSONObject reqParam = JSONObject.parseObject(pd.getReqData());
+        reqParam.put("recordTypeCd", "8888");
+
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getToken(),
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId());
+
+        return listMachineRecordsSMOImpl.listMachineRecords(newPd);
     }
 
     public IListMachineRecordsSMO getListMachineRecordsSMOImpl() {

+ 49 - 0
WebService/src/main/java/com/java110/web/components/machineRecord/MachineVistorPhotoManageComponent.java

@@ -0,0 +1,49 @@
+package com.java110.web.components.machineRecord;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.context.IPageData;
+import com.java110.core.context.PageData;
+import com.java110.web.smo.machineRecord.IListMachineRecordsSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 开门记录组件管理类
+ *
+ * add by wuxw
+ *
+ * 2019-06-29
+ */
+@Component("machineRecordManage")
+public class MachineVistorPhotoManageComponent {
+
+    @Autowired
+    private IListMachineRecordsSMO listMachineRecordsSMOImpl;
+
+    /**
+     * 查询开门记录列表
+     * @param pd 页面数据封装
+     * @return 返回 ResponseEntity 对象
+     */
+    public ResponseEntity<String> list(IPageData pd){
+        JSONObject reqParam = JSONObject.parseObject(pd.getReqData());
+        reqParam.put("recordTypeCd", "6666");
+
+        IPageData newPd = PageData.newInstance().builder(pd.getUserId(), pd.getToken(),
+                reqParam.toJSONString(), pd.getComponentCode(), pd.getComponentMethod(), "", pd.getSessionId());
+
+        return listMachineRecordsSMOImpl.listMachineRecords(newPd);
+
+    }
+
+    public IListMachineRecordsSMO getListMachineRecordsSMOImpl() {
+        return listMachineRecordsSMOImpl;
+    }
+
+    public void setListMachineRecordsSMOImpl(IListMachineRecordsSMO listMachineRecordsSMOImpl) {
+        this.listMachineRecordsSMOImpl = listMachineRecordsSMOImpl;
+    }
+}

+ 10 - 1
WebService/src/main/resources/components/machinePackage/machineRecord-manage/machineRecordManage.html

@@ -92,6 +92,7 @@
                             <th class="text-center">开门方式</th>
                             <th class="text-center">用户手机号</th>
                             <th class="text-center">身份证</th>
+                            <th class="text-center">操作</th>
                         </tr>
                         </thead>
                         <tbody>
@@ -103,7 +104,13 @@
                             <td class="text-center">{{machineRecord.openTypeCd}}</td>
                             <td class="text-center">{{machineRecord.tel}}</td>
                             <td class="text-center">{{machineRecord.idCard}}</td>
-
+                            <td class="text-center">
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openMachineRecordDetailModel(machineRecord)">详情
+                                    </button>
+                                </div>
+                            </td>
                         </tr>
                         </tbody>
                         <tfoot>
@@ -121,4 +128,6 @@
         </div>
     </div>
 
+    <vc:create name="machineRecordDetail"></vc:create>
+
 </div>

+ 3 - 1
WebService/src/main/resources/components/machinePackage/machineRecord-manage/machineRecordManage.js

@@ -65,7 +65,9 @@
             },
             _queryMachineRecordMethod: function () {
                 vc.component._listMachineRecords(DEFAULT_PAGE, DEFAULT_ROWS);
-
+            },
+            _openMachineRecordDetailModel:function(_machineRecord){
+                vc.emit('machineRecordDetail', 'openMachineRecordDetailModal',_machineRecord);
             },
             _moreCondition: function () {
                 if (vc.component.machineRecordManageInfo.moreCondition) {

+ 64 - 0
WebService/src/main/resources/components/machinePackage/machineRecordDetail/machineRecordDetail.html

@@ -0,0 +1,64 @@
+<div id="editMachineRecordModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
+     aria-hidden="true">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content">
+            <div class="modal-body">
+                <h3 class="m-t-none m-b ">开门详情</h3>
+                <div class="ibox-content">
+                    <div>
+                        <div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">设备编码</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.machineCode" type="text"
+                                           placeholder="必填,请填写设备编码" readonly class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">设备ID</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.machineId" type="text"
+                                           placeholder="必填,请填写设备ID" readonly class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">用户名称</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.name" readonly type="text" placeholder="必填,请填写用户名称"
+                                           class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">开门方式</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.openTypeCd" type="text"
+                                           placeholder="必填,请填写开门方式" readonly class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">用户手机号</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.tel" readonly type="text" placeholder="必填,请填写用户手机号"
+                                           class="form-control">
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-sm-2 col-form-label">身份证</label>
+                                <div class="col-sm-10">
+                                    <input v-model="machineRecordDetailInfo.idCard" readonly type="text" placeholder="必填,请填写身份证"
+                                           class="form-control">
+                                </div>
+                            </div>
+
+                            <div class="ibox-content">
+                                <button type="button" class="btn btn-warning float-right"
+                                        data-dismiss="modal">关闭
+                                </button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>

+ 42 - 0
WebService/src/main/resources/components/machinePackage/machineRecordDetail/machineRecordDetail.js

@@ -0,0 +1,42 @@
+(function (vc, vm) {
+
+    vc.extends({
+        data: {
+            machineRecordDetailInfo: {
+                machineRecordId: '',
+                machineCode: '',
+                machineId: '',
+                name: '',
+                openTypeCd: '',
+                tel: '',
+                idCard: '',
+            }
+        },
+        _initMethod: function () {
+
+        },
+        _initEvent: function () {
+            vc.on('machineRecordDetail', 'openMachineRecordDetailModal', function (_params) {
+                vc.component.refreshEditMachineRecordInfo();
+                $('#editMachineRecordModel').modal('show');
+                vc.copyObject(_params, vc.component.machineRecordDetailInfo);
+                vc.component.machineRecordDetailInfo.communityId = vc.getCurrentCommunity().communityId;
+            });
+        },
+        methods: {
+            refreshEditMachineRecordInfo: function () {
+                vc.component.machineRecordDetailInfo = {
+                    machineRecordId: '',
+                    machineCode: '',
+                    machineId: '',
+                    name: '',
+                    openTypeCd: '',
+                    tel: '',
+                    idCard: '',
+
+                }
+            }
+        }
+    });
+
+})(window.vc, window.vc.component);

+ 133 - 0
WebService/src/main/resources/components/machinePackage/machineVistorPhoto-manage/machineVistorPhotoManage.html

@@ -0,0 +1,133 @@
+<div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce">
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox ">
+                <div class="ibox-title">
+                    <h5>查询条件</h5>
+                    <div class="ibox-tools" style="top:10px;">
+                        <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
+                                v-on:click="_moreCondition()">{{machineVistorPhotoManageInfo.moreCondition ==
+                            true?'隐藏':'更多'}}
+                        </button>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="row">
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入用户名称"
+                                       v-model="machineVistorPhotoManageInfo.conditions.name" class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-4">
+                            <select class="custom-select" v-model="machineVistorPhotoManageInfo.conditions.openTypeCd">
+                                <option selected value="">请选择开门方式</option>
+                                <option value="1000">人脸开门</option>
+                                <option value="2000">钥匙开门</option>
+                            </select></div>
+                        <div class="col-sm-3">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入用户手机"
+                                       v-model="machineVistorPhotoManageInfo.conditions.tel" class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-1">
+                            <button type="button" class="btn btn-primary btn-sm"
+                                    v-on:click="_queryMachineRecordMethod()">
+                                <i class="glyphicon glyphicon-search"></i> 查询
+                            </button>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-sm-4" v-if="machineVistorPhotoManageInfo.moreCondition == true">
+                            <select class="custom-select" v-model="machineVistorPhotoManageInfo.conditions.ownerTypeCd">
+                                <option selected value="">请选择用户类型</option>
+                                <option value="1001">业主</option>
+                                <option value="1002">业主成员</option>
+                            </select></div>
+                        <div class="col-sm-4" v-if="machineVistorPhotoManageInfo.moreCondition == true">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入设备名称"
+                                       v-model="machineVistorPhotoManageInfo.conditions.machineName" class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-3" v-if="machineVistorPhotoManageInfo.moreCondition == true">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入设备编码"
+                                       v-model="machineVistorPhotoManageInfo.conditions.machineCode" class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-1">
+                        </div>
+                    </div>
+
+
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox">
+                <div class="ibox-title">
+                    <h5>开门记录</h5>
+                    <div class="ibox-tools" style="top:10px;">
+<!--                        <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddMachineRecordModal()">-->
+<!--                            <i class="glyphicon glyphicon-plus"></i>-->
+<!--                            添加开门记录-->
+<!--                        </button>-->
+                    </div>
+                </div>
+                <div class="ibox-content">
+
+                    <table class="footable table table-stripped toggle-arrow-tiny"
+                           data-page-size="15"
+                    >
+                        <thead>
+                        <tr>
+                            <th class="text-center">开门记录ID</th>
+                            <th class="text-center">设备编码</th>
+                            <th class="text-center">设备ID</th>
+                            <th class="text-center">被呼叫用户名称</th>
+                            <th class="text-center">被呼叫方式</th>
+                            <th class="text-center">被呼叫用户手机号</th>
+                            <th class="text-center">身份证</th>
+                            <th class="text-center">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr v-for="machineRecord in machineVistorPhotoManageInfo.machineRecords">
+                            <td class="text-center">{{machineRecord.machineRecordId}}</td>
+                            <td class="text-center">{{machineRecord.machineCode}}</td>
+                            <td class="text-center">{{machineRecord.machineId}}</td>
+                            <td class="text-center">{{machineRecord.name}}</td>
+                            <td class="text-center">{{machineRecord.openTypeCd}}</td>
+                            <td class="text-center">{{machineRecord.tel}}</td>
+                            <td class="text-center">{{machineRecord.idCard}}</td>
+                            <td class="text-center">
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs"
+                                            v-on:click="_openMachineRecordDetailModel(machineRecord)">详情
+                                    </button>
+                                </div>
+                            </td>
+                        </tr>
+                        </tbody>
+                        <tfoot>
+                        <tr>
+                            <td colspan="7">
+                                <ul class="pagination float-right"></ul>
+                            </td>
+                        </tr>
+                        </tfoot>
+                    </table>
+                    <!-- 分页 -->
+                    <vc:create name="pagination"></vc:create>
+                </div>
+            </div>
+        </div>
+    </div>
+
+    <vc:create name="machineRecordDetail"></vc:create>
+
+</div>

+ 83 - 0
WebService/src/main/resources/components/machinePackage/machineVistorPhoto-manage/machineVistorPhotoManage.js

@@ -0,0 +1,83 @@
+/**
+ 入驻小区
+ **/
+(function (vc) {
+    var DEFAULT_PAGE = 1;
+    var DEFAULT_ROWS = 10;
+    vc.extends({
+        data: {
+            machineVistorPhotoManageInfo: {
+                machineRecords: [],
+                total: 0,
+                records: 1,
+                moreCondition: false,
+                name: '',
+                conditions: {
+                    name: '',
+                    openTypeCd: '',
+                    tel: '',
+                    ownerTypeCd: '',
+                    machineName: '',
+                    machineCode: '',
+
+                }
+            }
+        },
+        _initMethod: function () {
+            vc.component._listMachineRecords(DEFAULT_PAGE, DEFAULT_ROWS);
+        },
+        _initEvent: function () {
+
+            vc.on('machineVistorPhotoManage', 'listMachineRecord', function (_param) {
+                vc.component._listMachineRecords(DEFAULT_PAGE, DEFAULT_ROWS);
+            });
+            vc.on('pagination', 'page_event', function (_currentPage) {
+                vc.component._listMachineRecords(_currentPage, DEFAULT_ROWS);
+            });
+        },
+        methods: {
+            _listMachineRecords: function (_page, _rows) {
+
+                vc.component.machineVistorPhotoManageInfo.conditions.page = _page;
+                vc.component.machineVistorPhotoManageInfo.conditions.row = _rows;
+                var param = {
+                    params: vc.component.machineVistorPhotoManageInfo.conditions
+                };
+
+                //发送get请求
+                vc.http.get('machineVistorPhotoManage',
+                    'list',
+                    param,
+                    function (json, res) {
+                        var _machineVistorPhotoManageInfo = JSON.parse(json);
+                        vc.component.machineVistorPhotoManageInfo.total = _machineVistorPhotoManageInfo.total;
+                        vc.component.machineVistorPhotoManageInfo.records = _machineVistorPhotoManageInfo.records;
+                        vc.component.machineVistorPhotoManageInfo.machineRecords = _machineVistorPhotoManageInfo.machineRecords;
+                        vc.emit('pagination', 'init', {
+                            total: vc.component.machineVistorPhotoManageInfo.records,
+                            dataCount: vc.component.machineVistorPhotoManageInfo.total,
+                            currentPage: _page
+                        });
+                    }, function (errInfo, error) {
+                        console.log('请求失败处理');
+                    }
+                );
+            },
+            _queryMachineRecordMethod: function () {
+                vc.component._listMachineRecords(DEFAULT_PAGE, DEFAULT_ROWS);
+            },
+            _openMachineRecordDetailModel:function(_machineRecord){
+                vc.emit('machineRecordDetail', 'openMachineRecordDetailModal',_machineRecord);
+            },
+            _moreCondition: function () {
+                if (vc.component.machineVistorPhotoManageInfo.moreCondition) {
+                    vc.component.machineVistorPhotoManageInfo.moreCondition = false;
+                } else {
+                    vc.component.machineVistorPhotoManageInfo.moreCondition = true;
+                }
+            }
+
+
+        }
+    });
+})(window.vc);

+ 36 - 0
WebService/src/main/resources/views/machineVistorPhotoFlow.html

@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>访客留影|java110</title>
+    <vc:create name="commonTop"></vc:create>
+</head>
+<body>
+<vc:create name="bodyTop"></vc:create>
+<div id="wrapper">
+    <vc:create name="menu"></vc:create>
+
+
+    <div id="page-wrapper" class="gray-bg dashbard-1">
+        <div class="row border-bottom">
+            <vc:create name="nav"></vc:create>
+        </div>
+        <div class="wrapper wrapper-content" style="padding-bottom: 0px;">
+            <vc:create name="breadcrumb"></vc:create>
+        </div>
+        <!-- id="component" -->
+        <div class="wrapper wrapper-content animated fadeInRight">
+            <vc:create name="machineVistorPhotoManage"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/hardwareAdapation/MachineRecordDto.java

@@ -25,6 +25,7 @@ public class MachineRecordDto extends PageDto implements Serializable {
     private String tel;
     private String communityId;
     private String fileId;
+    private String recordTypeCd;
 
 
     private Date createTime;
@@ -128,4 +129,12 @@ public class MachineRecordDto extends PageDto implements Serializable {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getRecordTypeCd() {
+        return recordTypeCd;
+    }
+
+    public void setRecordTypeCd(String recordTypeCd) {
+        this.recordTypeCd = recordTypeCd;
+    }
 }

+ 42 - 21
java110-bean/src/main/java/com/java110/vo/api/machineRecord/ApiMachineRecordDataVo.java

@@ -6,55 +6,76 @@ import java.util.Date;
 public class ApiMachineRecordDataVo implements Serializable {
 
     private String machineRecordId;
-private String machineCode;
-private String machineId;
-private String name;
-private String openTypeCd;
-private String tel;
-private String idCard;
-public String getMachineRecordId() {
+    private String machineCode;
+    private String machineId;
+    private String name;
+    private String openTypeCd;
+    private String tel;
+    private String idCard;
+    private String recordTypeCd;
+
+
+    public String getMachineRecordId() {
         return machineRecordId;
     }
-public void setMachineRecordId(String machineRecordId) {
+
+    public void setMachineRecordId(String machineRecordId) {
         this.machineRecordId = machineRecordId;
     }
-public String getMachineCode() {
+
+    public String getMachineCode() {
         return machineCode;
     }
-public void setMachineCode(String machineCode) {
+
+    public void setMachineCode(String machineCode) {
         this.machineCode = machineCode;
     }
-public String getMachineId() {
+
+    public String getMachineId() {
         return machineId;
     }
-public void setMachineId(String machineId) {
+
+    public void setMachineId(String machineId) {
         this.machineId = machineId;
     }
-public String getName() {
+
+    public String getName() {
         return name;
     }
-public void setName(String name) {
+
+    public void setName(String name) {
         this.name = name;
     }
-public String getOpenTypeCd() {
+
+    public String getOpenTypeCd() {
         return openTypeCd;
     }
-public void setOpenTypeCd(String openTypeCd) {
+
+    public void setOpenTypeCd(String openTypeCd) {
         this.openTypeCd = openTypeCd;
     }
-public String getTel() {
+
+    public String getTel() {
         return tel;
     }
-public void setTel(String tel) {
+
+    public void setTel(String tel) {
         this.tel = tel;
     }
-public String getIdCard() {
+
+    public String getIdCard() {
         return idCard;
     }
-public void setIdCard(String idCard) {
+
+    public void setIdCard(String idCard) {
         this.idCard = idCard;
     }
 
+    public String getRecordTypeCd() {
+        return recordTypeCd;
+    }
 
-
+    public void setRecordTypeCd(String recordTypeCd) {
+        this.recordTypeCd = recordTypeCd;
+    }
 }

+ 2 - 0
java110-db/db/HardwareAdapationService/create_machine_record.sql

@@ -9,6 +9,7 @@ create table business_machine_record(
   community_id varchar(30) not null comment '小区ID',
   tel varchar(11) not null comment '手机号',
   id_card varchar(20) not null comment '用户身份证',
+  record_type_cd varchar(12) not null comment '记录类型,8888 开门记录 6666 访客留影',
   file_id varchar(64) comment '文件ID',
   file_time timestamp  default  CURRENT_TIMESTAMP COMMENT '文件生成时间',
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
@@ -25,6 +26,7 @@ create table machine_record(
   community_id varchar(30) not null comment '小区ID',
   tel varchar(11) not null comment '手机号',
   id_card varchar(20) not null comment '用户身份证',
+  record_type_cd varchar(12) not null comment '记录类型,8888 开门记录 6666 访客留影',
   file_id varchar(64) comment '文件ID',
   file_time timestamp  default  CURRENT_TIMESTAMP COMMENT '文件生成时间',
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',

+ 227 - 208
java110-db/src/main/resources/mapper/hardwareAdapation/MachineRecordServiceDaoImplMapper.xml

@@ -5,242 +5,261 @@
 <mapper namespace="machineRecordServiceDaoImpl">
 
     <!-- 保存设备上报信息 add by wuxw 2018-07-03 -->
-       <insert id="saveBusinessMachineRecordInfo" parameterType="Map">
+    <insert id="saveBusinessMachineRecordInfo" parameterType="Map">
            insert into business_machine_record(
-file_time,machine_code,open_type_cd,id_card,machine_record_id,machine_id,operate,name,tel,community_id,b_id,file_id
+file_time,machine_code,open_type_cd,id_card,machine_record_id,machine_id,operate,`name`,tel,community_id,b_id,file_id,record_type_cd
 ) values (
 #{fileTime},#{machineCode},#{openTypeCd},#{idCard},#{machineRecordId},#{machineId},#{operate},#{name},#{tel},#{communityId},#{bId},#{fileId}
+,#{recordTypeCd}
 )
        </insert>
 
 
-       <!-- 查询设备上报信息(Business) add by wuxw 2018-07-03 -->
-       <select id="getBusinessMachineRecordInfo" parameterType="Map" resultType="Map">
-           select  t.file_time,t.file_time fileTime,t.machine_code,t.machine_code machineCode,t.open_type_cd,t.open_type_cd openTypeCd,t.id_card,t.id_card idCard,t.machine_record_id,t.machine_record_id machineRecordId,t.machine_id,t.machine_id machineId,t.operate,t.name,t.tel,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId 
-from business_machine_record t 
-where 1 =1 
-<if test="fileTime !=null and fileTime != ''">
-   and t.file_time= #{fileTime}
-</if> 
-<if test="machineCode !=null and machineCode != ''">
-   and t.machine_code= #{machineCode}
-</if> 
-<if test="openTypeCd !=null and openTypeCd != ''">
-   and t.open_type_cd= #{openTypeCd}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="machineRecordId !=null and machineRecordId != ''">
-   and t.machine_record_id= #{machineRecordId}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="operate !=null and operate != ''">
-   and t.operate= #{operate}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="fileId !=null and fileId != ''">
-   and t.file_id= #{fileId}
-</if> 
-
-       </select>
-
-
+    <!-- 查询设备上报信息(Business) add by wuxw 2018-07-03 -->
+    <select id="getBusinessMachineRecordInfo" parameterType="Map" resultType="Map">
+        select t.file_time,t.file_time fileTime,t.machine_code,t.machine_code machineCode,t.open_type_cd,t.open_type_cd
+        openTypeCd,t.id_card,t.id_card idCard,t.machine_record_id,t.machine_record_id
+        machineRecordId,t.machine_id,t.machine_id machineId,t.operate,t.name,t.tel,t.community_id,t.community_id
+        communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd
+        from business_machine_record t
+        where 1 =1
+        <if test="fileTime !=null and fileTime != ''">
+            and t.file_time= #{fileTime}
+        </if>
+        <if test="machineCode !=null and machineCode != ''">
+            and t.machine_code= #{machineCode}
+        </if>
+        <if test="openTypeCd !=null and openTypeCd != ''">
+            and t.open_type_cd= #{openTypeCd}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="machineRecordId !=null and machineRecordId != ''">
+            and t.machine_record_id= #{machineRecordId}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="operate !=null and operate != ''">
+            and t.operate= #{operate}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="fileId !=null and fileId != ''">
+            and t.file_id= #{fileId}
+        </if>
+        <if test="recordTypeCd !=null and recordTypeCd != ''">
+            and t.record_type_cd= #{recordTypeCd}
+        </if>
 
+    </select>
 
 
     <!-- 保存设备上报信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveMachineRecordInfoInstance" parameterType="Map">
         insert into machine_record(
-file_time,machine_code,open_type_cd,id_card,status_cd,machine_record_id,machine_id,name,tel,community_id,b_id,file_id
-) select t.file_time,t.machine_code,t.open_type_cd,t.id_card,'0',t.machine_record_id,t.machine_id,t.name,t.tel,t.community_id,t.b_id,t.file_id from business_machine_record t where 1=1
-<if test="fileTime !=null and fileTime != ''">
-   and t.file_time= #{fileTime}
-</if> 
-<if test="machineCode !=null and machineCode != ''">
-   and t.machine_code= #{machineCode}
-</if> 
-<if test="openTypeCd !=null and openTypeCd != ''">
-   and t.open_type_cd= #{openTypeCd}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="machineRecordId !=null and machineRecordId != ''">
-   and t.machine_record_id= #{machineRecordId}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-   and t.operate= 'ADD'
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="fileId !=null and fileId != ''">
-   and t.file_id= #{fileId}
-</if> 
+        file_time,machine_code,open_type_cd,id_card,status_cd,machine_record_id,machine_id,`name`,tel,community_id,b_id,file_id,record_type_cd
+        ) select
+        t.file_time,t.machine_code,t.open_type_cd,t.id_card,'0',t.machine_record_id,t.machine_id,t.name,t.tel,t.community_id,t.b_id,t.file_id,t.record_type_cd
+        from business_machine_record t where 1=1
+        <if test="fileTime !=null and fileTime != ''">
+            and t.file_time= #{fileTime}
+        </if>
+        <if test="machineCode !=null and machineCode != ''">
+            and t.machine_code= #{machineCode}
+        </if>
+        <if test="openTypeCd !=null and openTypeCd != ''">
+            and t.open_type_cd= #{openTypeCd}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="machineRecordId !=null and machineRecordId != ''">
+            and t.machine_record_id= #{machineRecordId}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        and t.operate= 'ADD'
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="fileId !=null and fileId != ''">
+            and t.file_id= #{fileId}
+        </if>
+        <if test="recordTypeCd !=null and recordTypeCd != ''">
+            and t.record_type_cd= #{recordTypeCd}
+        </if>
 
     </insert>
 
 
-
     <!-- 查询设备上报信息 add by wuxw 2018-07-03 -->
     <select id="getMachineRecordInfo" parameterType="Map" resultType="Map">
-        select  t.file_time,t.file_time fileTime,t.machine_code,t.machine_code machineCode,t.open_type_cd,t.open_type_cd openTypeCd,t.id_card,t.id_card idCard,t.status_cd,t.status_cd statusCd,t.machine_record_id,t.machine_record_id machineRecordId,t.machine_id,t.machine_id machineId,t.name,t.tel,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId 
-from machine_record t 
-where 1 =1 
-<if test="fileTime !=null and fileTime != ''">
-   and t.file_time= #{fileTime}
-</if> 
-<if test="machineCode !=null and machineCode != ''">
-   and t.machine_code= #{machineCode}
-</if> 
-<if test="openTypeCd !=null and openTypeCd != ''">
-   and t.open_type_cd= #{openTypeCd}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="machineRecordId !=null and machineRecordId != ''">
-   and t.machine_record_id= #{machineRecordId}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="fileId !=null and fileId != ''">
-   and t.file_id= #{fileId}
-</if> 
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.file_time,t.file_time fileTime,t.machine_code,t.machine_code machineCode,t.open_type_cd,t.open_type_cd
+        openTypeCd,t.id_card,t.id_card idCard,t.status_cd,t.status_cd statusCd,t.machine_record_id,t.machine_record_id
+        machineRecordId,t.machine_id,t.machine_id machineId,t.name,t.tel,t.community_id,t.community_id
+        communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd
+        from machine_record t
+        where 1 =1
+        <if test="fileTime !=null and fileTime != ''">
+            and t.file_time= #{fileTime}
+        </if>
+        <if test="machineCode !=null and machineCode != ''">
+            and t.machine_code= #{machineCode}
+        </if>
+        <if test="openTypeCd !=null and openTypeCd != ''">
+            and t.open_type_cd= #{openTypeCd}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="machineRecordId !=null and machineRecordId != ''">
+            and t.machine_record_id= #{machineRecordId}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="fileId !=null and fileId != ''">
+            and t.file_id= #{fileId}
+        </if>
+        <if test="recordTypeCd !=null and recordTypeCd != ''">
+            and t.record_type_cd= #{recordTypeCd}
+        </if>
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改设备上报信息 add by wuxw 2018-07-03 -->
     <update id="updateMachineRecordInfoInstance" parameterType="Map">
-        update  machine_record t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="fileTime !=null and fileTime != ''">
-, t.file_time= #{fileTime}
-</if> 
-<if test="machineCode !=null and machineCode != ''">
-, t.machine_code= #{machineCode}
-</if> 
-<if test="openTypeCd !=null and openTypeCd != ''">
-, t.open_type_cd= #{openTypeCd}
-</if> 
-<if test="idCard !=null and idCard != ''">
-, t.id_card= #{idCard}
-</if> 
-<if test="machineId !=null and machineId != ''">
-, t.machine_id= #{machineId}
-</if> 
-<if test="name !=null and name != ''">
-, t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-, t.tel= #{tel}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="fileId !=null and fileId != ''">
-, t.file_id= #{fileId}
-</if> 
- where 1=1 <if test="machineRecordId !=null and machineRecordId != ''">
-and t.machine_record_id= #{machineRecordId}
-</if> 
-<if test="bId !=null and bId != ''">
-and t.b_id= #{bId}
-</if> 
+        update machine_record t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="fileTime !=null and fileTime != ''">
+            , t.file_time= #{fileTime}
+        </if>
+        <if test="machineCode !=null and machineCode != ''">
+            , t.machine_code= #{machineCode}
+        </if>
+        <if test="openTypeCd !=null and openTypeCd != ''">
+            , t.open_type_cd= #{openTypeCd}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            , t.id_card= #{idCard}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            , t.machine_id= #{machineId}
+        </if>
+        <if test="name !=null and name != ''">
+            , t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            , t.tel= #{tel}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="fileId !=null and fileId != ''">
+            , t.file_id= #{fileId}
+        </if>
+        <if test="recordTypeCd !=null and recordTypeCd != ''">
+            , t.record_type_cd= #{recordTypeCd}
+        </if>
+        where 1=1
+        <if test="machineRecordId !=null and machineRecordId != ''">
+            and t.machine_record_id= #{machineRecordId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
 
     </update>
 
     <!-- 查询设备上报数量 add by wuxw 2018-07-03 -->
-     <select id="queryMachineRecordsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from machine_record t 
-where 1 =1 
-<if test="fileTime !=null and fileTime != ''">
-   and t.file_time= #{fileTime}
-</if> 
-<if test="machineCode !=null and machineCode != ''">
-   and t.machine_code= #{machineCode}
-</if> 
-<if test="openTypeCd !=null and openTypeCd != ''">
-   and t.open_type_cd= #{openTypeCd}
-</if> 
-<if test="idCard !=null and idCard != ''">
-   and t.id_card= #{idCard}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="machineRecordId !=null and machineRecordId != ''">
-   and t.machine_record_id= #{machineRecordId}
-</if> 
-<if test="machineId !=null and machineId != ''">
-   and t.machine_id= #{machineId}
-</if> 
-<if test="name !=null and name != ''">
-   and t.name= #{name}
-</if> 
-<if test="tel !=null and tel != ''">
-   and t.tel= #{tel}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="bId !=null and bId != ''">
-   and t.b_id= #{bId}
-</if> 
-<if test="fileId !=null and fileId != ''">
-   and t.file_id= #{fileId}
-</if> 
-
-
-     </select>
+    <select id="queryMachineRecordsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from machine_record t
+        where 1 =1
+        <if test="fileTime !=null and fileTime != ''">
+            and t.file_time= #{fileTime}
+        </if>
+        <if test="machineCode !=null and machineCode != ''">
+            and t.machine_code= #{machineCode}
+        </if>
+        <if test="openTypeCd !=null and openTypeCd != ''">
+            and t.open_type_cd= #{openTypeCd}
+        </if>
+        <if test="idCard !=null and idCard != ''">
+            and t.id_card= #{idCard}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="machineRecordId !=null and machineRecordId != ''">
+            and t.machine_record_id= #{machineRecordId}
+        </if>
+        <if test="machineId !=null and machineId != ''">
+            and t.machine_id= #{machineId}
+        </if>
+        <if test="name !=null and name != ''">
+            and t.name= #{name}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and t.tel= #{tel}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="fileId !=null and fileId != ''">
+            and t.file_id= #{fileId}
+        </if>
+        <if test="recordTypeCd !=null and recordTypeCd != ''">
+            and t.record_type_cd= #{recordTypeCd}
+        </if>
+
+
+    </select>
 
 </mapper>