人员查询添加客户类别
diff --git a/build.gradle b/build.gradle
index 50b7563..fa8028b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -43,7 +43,7 @@
}
docker {
- name 'harbor.supwisdom.com/dali/door:' + version
+ name 'harbor.supwisdom.com/dali/conference:' + version
println(jar.archivePath)
files jar.archivePath
}
diff --git a/src/main/java/com/supwisdom/dlpay/customer/bean/CustomerSearchBean.java b/src/main/java/com/supwisdom/dlpay/customer/bean/CustomerSearchBean.java
index 54ca392..9658f04 100644
--- a/src/main/java/com/supwisdom/dlpay/customer/bean/CustomerSearchBean.java
+++ b/src/main/java/com/supwisdom/dlpay/customer/bean/CustomerSearchBean.java
@@ -6,6 +6,7 @@
private String custname;
private String checkstatus;
private String deptcode;
+ private Integer custtypeid;
public String getCustname() {
return custname;
@@ -30,4 +31,12 @@
public void setCheckstatus(String checkstatus) {
this.checkstatus = checkstatus;
}
+
+ public Integer getCusttypeid() {
+ return custtypeid;
+ }
+
+ public void setCusttypeid(Integer custtypeid) {
+ this.custtypeid = custtypeid;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java b/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
index a8f6bb1..b58c106 100644
--- a/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
+++ b/src/main/java/com/supwisdom/dlpay/customer/controller/CustomerController.java
@@ -60,6 +60,12 @@
model.put("deptlist", deptString);
String typeString = gson.toJson(lst);
model.put("custtypelist", typeString);
+ List<TCustType> list = systemService.findAllCusttype();
+ TCustType type=new TCustType();
+ type.setCusttypeid(0);
+ type.setCusttypename("全部");
+ list.add(0,type);
+ model.addAttribute("typelist", list);
return "doorlist/customer/index";
}
@@ -70,6 +76,7 @@
@RequestParam("limit") Integer pageSize,
@RequestParam(value = "custname", required = false) String custname,
@RequestParam(value = "deptcode", required = false) String deptcode,
+ @RequestParam(value = "custtypeid", required = false) Integer custtypeid,
@AuthenticationPrincipal TOperator operUser) {
try {
if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
@@ -82,7 +89,7 @@
deptcode = operUser.getDeptcode();
}
searchBean.setDeptcode(deptcode);
-
+ searchBean.setCusttypeid(custtypeid);
PageResult<TCustomerInfo> bean = webInterfaceService.getCustomerInfoPage(searchBean);
return bean;
@@ -95,8 +102,7 @@
@GetMapping("/loadadd")
public String loadadd(Model model) {
- List<TCustType> list = systemService.findAllCusttype();
- model.addAttribute("typelist", list);
+
List<TDept> deptlist = systemService.findAllDept();
model.addAttribute("deptlist", deptlist);
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 a549315..af0f85f 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
@@ -115,10 +115,16 @@
String countSql = "select count(*) as cnt 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 (null!=param.getCusttypeid()){
+ sql += " and a.custtypeid = :custtypeid ";
+ countSql += " and a.custtypeid = :custtypeid ";
+ }
+
if (!StringUtil.isEmpty(perName)){
sql += " and a.custname like :perName ";
countSql += " and a.custname like :perName ";
}
+
if (!StringUtil.isEmpty(childdplist)) {
sql+=" and a.deptcode in ('"+ StringUtils.join(childdplist.toArray(),"','")+"') ";
countSql+=" and a.deptcode in ('"+ StringUtils.join(childdplist.toArray(),"','")+"') ";
@@ -131,8 +137,12 @@
Query query = entityManager.createNativeQuery(sql);
Query countQuery = entityManager.createNativeQuery(countSql);
if (!StringUtil.isEmpty(perName)){
- query.setParameter("perName", "%"+perName+"%");
- countQuery.setParameter("perName", "%"+perName+"%");
+ query.setParameter("perName", "%"+perName.trim()+"%");
+ countQuery.setParameter("perName", "%"+perName.trim()+"%");
+ }
+ if (null!=param.getCusttypeid()){
+ query.setParameter("custtypeid", param.getCusttypeid());
+ countQuery.setParameter("custtypeid", param.getCusttypeid());
}
query.setFirstResult((param.getPageNo() - 1) * param.getPageSize());
query.setMaxResults(param.getPageSize()); //分页显示
diff --git a/src/main/resources/templates/doorlist/customer/index.html b/src/main/resources/templates/doorlist/customer/index.html
index 2f6513a..9e29e75 100644
--- a/src/main/resources/templates/doorlist/customer/index.html
+++ b/src/main/resources/templates/doorlist/customer/index.html
@@ -11,7 +11,10 @@
搜索:
<div class="layui-inline" style="margin-right: 20px;">
<input id="customer-search-value" class="layui-input search-input" type="text" placeholder="输入姓名"
- style="margin-right: 20px"/>
+ />
+ <select class="layui-select" id="customer-search-custtype" style="margin-right: 20px">
+ <option th:each="type : ${typelist}" th:value="${type.custtypeid}">[[${type.custtypename}]]</option>
+ </select>
<input id="search-customer-deptcode" type="text"
lay-filter="search-customer-deptcode-filter" autocomplete="off"
class="layui-input search-input"/>
@@ -151,8 +154,9 @@
$('#customer-btn-search').click(function () {
let key = $('#customer-search-value').val().trim();
let deptcode=$('#search-customer-deptcode').val();
-
- table.reload('customer-table', {where: {custname: key,deptcode:deptcode}, page: {curr: 1}});
+ let custtypeid=$('#customer-search-custtype').val();
+ console.log(custtypeid);
+ table.reload('customer-table', {where: {custname: key,deptcode:deptcode,custtypeid:custtypeid}, page: {curr: 1}});
});
$('#customer-btn-add').click(function () {
showModel();