查询人员信息修改(门禁下发)
diff --git a/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java b/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
index 180b14d..7a7174b 100644
--- a/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
+++ b/src/main/java/com/supwisdom/dlpay/doorlist/controller/DoorlistMgrController.java
@@ -27,10 +27,7 @@
 import com.supwisdom.dlpay.paysdk.ApiLoginHelper;

 import com.supwisdom.dlpay.paysdk.proxy.ApiLoginProxy;

 import com.supwisdom.dlpay.paysdk.proxy.UserProxy;

-import com.supwisdom.dlpay.system.domain.TDept;

-import com.supwisdom.dlpay.system.domain.TDictionaryId;

-import com.supwisdom.dlpay.system.domain.TRegion;

-import com.supwisdom.dlpay.system.domain.TSystemParam;

+import com.supwisdom.dlpay.system.domain.*;

 import com.supwisdom.dlpay.system.page.Pagination;

 import com.supwisdom.dlpay.system.service.SystemService;

 import com.supwisdom.dlpay.util.RedisUtil;

@@ -449,11 +446,11 @@
     @ResponseBody

     @RequestMapping(value = "/getAllTCustomerList", method = RequestMethod.POST)

     public Map getAllTCustomerList(@RequestParam(value = "perName", required = false, defaultValue = "") String perName,

-                                   @RequestParam(value = "cardno", required = false, defaultValue = "") String cardno,

-                                   @RequestParam(value = "bankcardno", required = false, defaultValue = "") String bankcardno) {

+                                   @RequestParam(value = "custtypeid", required = false, defaultValue = "") Integer custtypeid,

+                                   @RequestParam(value = "deptcode", required = false, defaultValue = "") String deptcode) {

         Map map = new HashMap();

         try {

-            List<TCustomerInfo> pNotInResult = webInterfaceService.getAllTCustomerList(perName, cardno, bankcardno);

+            List<TCustomerInfo> pNotInResult = webInterfaceService.getAllCustNew(perName, null, null,custtypeid,deptcode);

             Boolean countIndex = false;

             if (pNotInResult.size() > 4000) {

                 countIndex = true;

@@ -468,6 +465,29 @@
     }

 

     /**

+     *

+     * @return

+     */

+

+    @ResponseBody

+    @RequestMapping(value = "/loadDeptCusttype")

+    public Map loaddeptcusttype(){

+        Map map=new HashMap();

+

+        List<TCustType> custtypelist= null;

+        try {

+            custtypelist = systemService.findAllCusttype();

+            map.put("custtypelist",custtypelist);

+            List<TDept> deptlist=systemService.findAllDept();

+            map.put("deptlist",deptlist);

+        } catch (Exception e) {

+            e.printStackTrace();

+            map.put("errStr","加载失败!");

+        }

+        return map;

+    }

+

+    /**

      * 下发名单导入查询模板下载

      *

      * @param request

diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
index da3e237..f3f492a 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/CustomerDao.java
@@ -31,4 +31,5 @@
 

     List<String> getChildDeptlist( String deptcode) ;

 

-    }

+    public List<TCustomerInfo> getAllCustNew(String perName, String cardno, String bankcardno,String custid,Integer custtypeid,String deptcode);

+}

diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
index f54c697..a549315 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/dao/impl/CustomerDaoImpl.java
@@ -244,4 +244,50 @@
         List<TCustomerExportBean> list = query.getResultList();

         return list;

     }

+

+    @Override

+    public List<TCustomerInfo> getAllCustNew(String perName, String cardno, String bankcardno, String custid, Integer custtypeid, String deptcode) {

+        String sql = "select a.custid,a.custname,b.cardno,b.bankcardno,b.cardphyid,b.expiredate,a.custtypeid,a.deptcode from T_Customer a left join t_card b on a.custid = b.custid " +

+                " where a.status='1' and b.status='normal' and b.transtatus='normal' ";

+        if (!StringUtil.isEmpty(perName)){

+            sql += " and a.custname like :perName ";

+        }

+        if (!StringUtil.isEmpty(cardno)){

+            sql +=" and b.cardno like :cardno ";

+        }

+        if (!StringUtil.isEmpty(bankcardno)){

+            sql +=" and b.bankcardno like :bankcardno ";

+        }

+        if (!StringUtil.isEmpty(custid)){

+            sql +=" and a.custid = :custid ";

+        }

+        if(custtypeid != null){

+            sql+= " and a.custtypeid= :ctypeid ";

+        }

+        if(!StringUtil.isEmpty(deptcode)){

+            sql+=" and a.deptcode = :dcode ";

+        }

+        sql +=" order by b.cardno desc ";

+        Query query = entityManager.createNativeQuery(sql, TCustomerInfo.class);

+        if (!StringUtil.isEmpty(perName)){

+            query.setParameter("perName", "%"+perName+"%");

+        }

+        if (!StringUtil.isEmpty(cardno)){

+            query.setParameter("cardno", "%"+cardno+"%");

+        }

+        if (!StringUtil.isEmpty(bankcardno)){

+            query.setParameter("bankcardno", "%"+bankcardno+"%");

+        }

+        if (!StringUtil.isEmpty(custid)){

+            query.setParameter("custid", custid);

+        }

+        if(custtypeid != null){

+            query.setParameter("ctypeid",custtypeid);

+        }

+        if(!StringUtil.isEmpty(deptcode)){

+           query.setParameter("dcode",deptcode);

+        }

+        List<TCustomerInfo> list = query.getResultList();

+        return list;

+    }

 }

diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java b/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
index ad275a0..558e14b 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/service/WebInterfaceService.java
@@ -154,5 +154,6 @@
     @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})

     List<TCustomerExportBean> getCustomerExportBean(String custname,String deptcode);

 

-

+    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})

+    public List<TCustomerInfo> getAllCustNew(String perName, String cardno, String bankcardno,Integer custtypeid,String deptcode);

 }

diff --git a/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
index 2576c39..38c4400 100644
--- a/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/mainservice/service/impl/WebInterfaceServiceImpl.java
@@ -269,4 +269,9 @@
     public List<TCustomerExportBean> getCustomerExportBean(String custname, String deptcode) {

         return customerDao.getCustomerExportList(custname,deptcode);

     }

+

+    @Override

+    public List<TCustomerInfo> getAllCustNew(String perName, String cardno, String bankcardno, Integer custtypeid, String deptcode) {

+        return customerDao.getAllCustNew(perName, cardno, bankcardno,"",custtypeid,deptcode);

+    }

 }

diff --git a/src/main/resources/templates/doorlist/addDoorlist.html b/src/main/resources/templates/doorlist/addDoorlist.html
index 2412036..87a7214 100644
--- a/src/main/resources/templates/doorlist/addDoorlist.html
+++ b/src/main/resources/templates/doorlist/addDoorlist.html
@@ -21,32 +21,90 @@
             <div id="addDoorlist_personSelect">
                 <!--<div class="x_panel" style="margin-left: 1%;width: 98%;float: left;">-->
                     <div style="height: 60px;border-left: 1px solid #dfe6ec;border-right: 1px solid #dfe6ec;">
-                        <el-col :span="22" :offset="1" >
-                            <el-row :span="24" style="padding-bottom: 10px">
-                                <el-col :span="12">
-                                    <el-col :span="3"><lable>姓名:</lable></el-col>
-                                    <el-col :span="20"><el-input placeholder="请输入内容" size="mini" v-model="person_person.custname"></el-input></el-col>
-                                </el-col>
-                                <el-col :span="12">
-                                    <el-col :span="3"><lable>卡号:</lable></el-col>
-                                    <el-col :span="21"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.cardno"></el-input></el-col>
-                                </el-col>
-                            </el-row>
-                            <el-row :span="24">
-                                <el-col :span="12">
-                                    <el-col :span="4"><lable>银行卡号:</lable></el-col>
-                                    <el-col :span="19"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.bankcardno"></el-input></el-col>
-                                </el-col>
-                                <el-col :span="12">
-                                    <el-col :span="3"  :offset="3">
-                                        <el-button size="small" style="height:24px; line-height:9px;overflow:hidden;width:100%;" type="primary" @click="person_searchPerson">&nbsp;搜索&nbsp;</el-button>
-                                    </el-col>
-                                    <el-col :span="3"  :offset="1">
-                                        <el-button type="warning" size="small" style="height:24px; line-height:9px;overflow:hidden; " onclick="javascript:document.getElementById('addDoorlist_importquery').scrollIntoView()" @click="open3">上传名单</el-button>
-                                    </el-col>
-                                </el-col>
-                            </el-row>
-                        </el-col>
+                        <!--<el-col :span="22" :offset="1" >-->
+                            <!--<el-row :span="24" style="padding-bottom: 10px">-->
+                                <!--<el-col :span="12">-->
+                                    <!--<el-col :span="3"><lable>姓名:</lable></el-col>-->
+                                    <!--<el-col :span="20"><el-input placeholder="请输入内容" size="mini" v-model="person_person.custname"></el-input></el-col>-->
+                                <!--</el-col>-->
+                                <!--<el-col :span="12">-->
+                                    <!--<el-col :span="3"><lable>卡号:</lable></el-col>-->
+                                    <!--<el-col :span="21"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.cardno"></el-input></el-col>-->
+                                <!--</el-col>-->
+                            <!--</el-row>-->
+                            <!--<el-row :span="24">-->
+                                <!--<el-col :span="12">-->
+                                    <!--<el-col :span="4"><lable>银行卡号:</lable></el-col>-->
+                                    <!--<el-col :span="19"><el-input placeholder="输入%进行模糊查询" size="mini" v-model="person_person.bankcardno"></el-input></el-col>-->
+                                <!--</el-col>-->
+                                <!--<el-col :span="12">-->
+                                    <!--<el-col :span="3"  :offset="3">-->
+                                        <!--<el-button size="small" style="height:24px; line-height:9px;overflow:hidden;width:100%;" type="primary" @click="person_searchPerson">&nbsp;搜索&nbsp;</el-button>-->
+                                    <!--</el-col>-->
+                                    <!--<el-col :span="3"  :offset="1">-->
+                                        <!--<el-button type="warning" size="small" style="height:24px; line-height:9px;overflow:hidden; " onclick="javascript:document.getElementById('addDoorlist_importquery').scrollIntoView()" @click="open3">上传名单</el-button>-->
+                                    <!--</el-col>-->
+                                <!--</el-col>-->
+                            <!--</el-row>-->
+                        <!--</el-col>-->
+                        <el-form :inline="true" ref="devform" :model="person_person" data-parsley-validate
+                                 class="form-horizontal form-label-left">
+                            <div class="col-md-3" >
+                                <div class="form-group">
+                                    <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">姓名:</span>
+                                    </label>
+                                    <div class="col-md-8 col-sm-12 col-xs-12">
+                                        <el-input v-model="person_person.custname" ></el-input>
+                                    </div>
+                                </div>
+                            </div>
+
+                            <div class="col-md-3" >
+                                <div class="form-group">
+                                    <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">人员类别:</span>
+                                    </label>
+                                    <div class="col-md-8 col-sm-12 col-xs-12">
+                                        <el-select v-model="person_person.custtypeid"
+                                                   filterable
+                                                   clearable
+                                                   placeholder="请选择">
+                                            <el-option
+                                                    v-for="custtypeid in custtypelist"
+                                                    :key="custtypeid.value"
+                                                    :label="custtypeid.label"
+                                                    :value="custtypeid.value">
+                                            </el-option>
+                                        </el-select>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="col-md-3" >
+                                <div class="form-group">
+                                    <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">部门:</span>
+                                    </label>
+                                    <div class="col-md-8 col-sm-12 col-xs-12">
+                                        <el-select v-model="person_person.deptcode"
+                                                   filterable
+                                                   clearable
+                                                   placeholder="请选择">
+                                            <el-option
+                                                    v-for="deptcode in deptlist"
+                                                    :key="deptcode.value"
+                                                    :label="deptcode.label"
+                                                    :value="deptcode.value">
+                                            </el-option>
+                                        </el-select>
+                                    </div>
+                                </div>
+                            </div>
+
+                            <div class="col-md-3" >
+                                <div class="form-group">
+                                    <button type="button" class="btn btn-info" @click="person_searchPerson" >查 询</button>
+                                    <button type="warning" class="btn btn-warning  btn-info" onclick="javascript:document.getElementById('addDoorlist_importquery').scrollIntoView()" @click="open3" >上传名单</button>
+                                </div>
+                            </div>
+                        </el-form>
 
 
                     </div>
@@ -93,9 +151,16 @@
                                             width="100">
                                     </el-table-column>
                                     <el-table-column
-                                            prop="bankcardno"
-                                            label="银行卡号"
-                                            width="200">
+                                            prop="custtypeid"
+                                            label="人员类别"
+                                            :formatter="custtypefor"
+                                    >
+                                    </el-table-column>
+                                    <el-table-column
+                                            prop="deptcode"
+                                            label="部门"
+                                            :formatter="deptfor"
+                                           >
                                     </el-table-column>
                                 </el-table>
                             </template>
@@ -150,9 +215,16 @@
                                         width="100">
                                 </el-table-column>
                                 <el-table-column
-                                        prop="bankcardno"
-                                        label="银行卡号"
-                                        width="200">
+                                        prop="custtypeid"
+                                        label="人员类别"
+                                        :fomatter="custtypefor"
+                                        >
+                                </el-table-column>
+                                <el-table-column
+                                        prop="deptcode"
+                                        label="部门"
+                                        :formatter="deptfor"
+                                        >
                                 </el-table-column>
                             </el-table>
                         </template>
@@ -647,7 +719,9 @@
             person_person:{
                 custname:'',
                 cardno:'',
-                bankcardno:''
+                bankcardno:'',
+                custtypeid:'',
+                deptcode:''
             },
             personSel_excelNum:0,
             personSel_excelInfo:'',
@@ -707,6 +781,8 @@
             timeTitle:'',
             //holiTitle:'',
             postCollapse:['1','2'],
+            custtypelist:[],
+            deptlist:[],
         },
         methods:{
             //人员选择部分
@@ -730,8 +806,10 @@
                 var custname=person_person.custname;
                 var cardno=person_person.cardno;
                 var bankcardno=person_person.bankcardno;
-                urlNotIn = "[[@{/doorlistMgr/getAllTCustomerList?}]]"+"perName="+custname+"&cardno="+cardno
-                    +"&bankcardno="+bankcardno;
+                var custtypeid=person_person.custtypeid;
+                var deptcode=person_person.deptcode;
+                urlNotIn = "[[@{/doorlistMgr/getAllTCustomerList?}]]"+"perName="+custname+"&custtypeid="+custtypeid
+                    +"&deptcode="+deptcode;
                 addDoorlist_getAllTCustomerList(urlNotIn);
             },
             person_addBtn:function(){
@@ -1008,10 +1086,45 @@
                     duration: 20000
                 });
             },
-
+            custtypefor:function(row){
+                return custtype_grpname(row.custtypeid);
+            },
+            deptfor:function (row){
+                return dept_grpname(row.deptcode);
+            },
         },
         created:function(){
-
+            var url = "[[@{/doorlistMgr/loadDeptCusttype}]]";
+            var _self=this;
+            $.ajax({
+                type: "get",
+                url: url,
+                dataType: "json",
+                success: function (data) {
+                    if(data.errStr!=undefined){
+                        layer.msg(data.errStr,{icon:2,time:1000});
+                        return ;
+                    }
+                    var depts=data.deptlist;
+                    var deptlist=[];
+                    for(var i=0;i<depts.length;i++){
+                        deptlist.push({
+                            value: depts[i].deptcode,
+                            label: depts[i].deptname
+                        });
+                    }
+                    _self.deptlist=deptlist;
+                    var custtypes=data.custtypelist;
+                    var custtypelist=[];
+                    for(var i=0;i<custtypes.length;i++){
+                        custtypelist.push({
+                            value: custtypes[i].custtypeid,
+                            label: custtypes[i].custtypename
+                        });
+                    }
+                    _self.custtypelist=custtypelist;
+                }
+            });
         }
     });
     function addDoorlist_fillmsg(_self){
@@ -1365,6 +1478,28 @@
             }
         }
     }
+    function custtype_grpname(grpid){
+//        console.log(typeof timeid)
+        if(grpid!=null){
+            var list = addDoorlist_vue.custtypelist;
+            for(var i=0;i<list.length;i++){
+                if(list[i].value == grpid){
+                    return list[i].label;
+                }
+            }
+        }
+    }
+    function dept_grpname(grpid){
+//        console.log(typeof timeid)
+        if(grpid!=null){
+            var list = addDoorlist_vue.deptlist;
+            for(var i=0;i<list.length;i++){
+                if(list[i].value == grpid){
+                    return list[i].label;
+                }
+            }
+        }
+    }
 </script>
 
 <style>