微信访客签到,前台查询优化
diff --git a/src/main/java/com/supwisdom/dlpay/conference/api/bean/TempCustomerBean.java b/src/main/java/com/supwisdom/dlpay/conference/api/bean/TempCustomerBean.java
new file mode 100644
index 0000000..5d9889a
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/bean/TempCustomerBean.java
@@ -0,0 +1,40 @@
+package com.supwisdom.dlpay.conference.api.bean;
+
+public class TempCustomerBean {
+ private Integer confid;
+ private String custname;
+ private String deptname;
+ private String phone;
+
+ public Integer getConfid() {
+ return confid;
+ }
+
+ public void setConfid(Integer confid) {
+ this.confid = confid;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
index b3435f4..c79cda4 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/api/controller/ConerenceApiController.java
@@ -12,18 +12,18 @@
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.mainservice.domain.TCustomer;
import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
+import com.supwisdom.dlpay.ncmgr.bean.NcDevBean;
import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
import com.supwisdom.dlpay.ncmgr.service.NcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
@Controller
@RequestMapping("/api/conference")
@@ -183,7 +183,6 @@
mov.setViewName("apph5/tempattend");
return mov;
}
-
TCustomer customer = webInterfaceService.findCustomerById(userid);
if (null == customer) {
mov.addObject("msg", "签到失败");
@@ -259,6 +258,58 @@
return mov;
}
+ @RequestMapping(value = "/savetempcust", method = RequestMethod.POST)
+ @ResponseBody
+ public Map saveTempCustomer(@RequestBody TempCustomerBean postData) {
+ Map map = new HashMap();
+ TConference conference=conferenceService.getConferenceById(postData.getConfid());
+ if(null==conference.getConfid()){
+ map.put("errcode","500");
+ map.put("errStr","会议不存在");
+ }
+ String atttime = DateUtil.getNow("HHmm");
+
+ int compareStart = DateUtil.compareDatetime(atttime, conference.getStarttime(), "HHmm");
+ String attstatus;
+
+ if (-1 != compareStart) {
+ attstatus = ConferenceConstant.ATTENDSTATUS_LATE;
+ } else {
+ attstatus = ConferenceConstant.ATTENDSTATUS_CHECKED;
+ }
+
+ String conftype=conference.getConftype();
+ if(ConferenceConstant.CONFTYPE_LIST.equals(conftype)){
+ TConfPeople people=new TConfPeople();
+
+ people.setAttstatus(attstatus);
+ // people.setCardno(dtl.getCardno());
+ people.setConfid(conference.getConfid());
+ people.setCustid(postData.getPhone());
+ people.setAtttime(atttime);
+ people.setCustname(postData.getCustname());
+ people.setAtttype(ConferenceConstant.ATTTYPE_TEMP);
+ people.setLastsaved(DateUtil.getNow());
+ people.setRemark(postData.getDeptname());
+ conferenceService.saveConfPeople(people);
+ }else{
+ TNolistConfPeople people = new TNolistConfPeople();
+
+ people.setAttstatus(attstatus);
+ // people.setCardno(dtl.getCardno());
+ people.setConfid(conference.getConfid());
+ people.setCustid(postData.getPhone());
+ people.setAtttime(atttime);
+ people.setCustname(postData.getCustname());
+ people.setAtttype(ConferenceConstant.ATTTYPE_TEMP);
+ people.setLastsaved(DateUtil.getNow());
+ people.setRemark(postData.getDeptname());
+ conferenceService.saveNolistConfPeople(people);
+ }
+ map.put("errcode","0");
+ return map;
+ }
+
@RequestMapping(value = "/test", method = RequestMethod.POST)
@ResponseBody
public ApiResponse test() {
diff --git a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
index 2e18caa..5dbeb2e 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/controller/ConfReportController.java
@@ -61,7 +61,10 @@
TOperator oper = (TOperator) operUser;
String deptcode = oper.getDeptcode();
String status = ConferenceConstant.CONFSTATUS_OVER;
- String date=DateUtil.reformatDatetime(confdate,"yyyy-MM-dd","yyyyMMdd");
+ String date="";
+ if(!StringUtil.isEmpty(confdate)){
+ date=DateUtil.reformatDatetime(confdate,"yyyy-MM-dd","yyyyMMdd");
+ }
return conferenceService.getConfReportPage(confname, conftype, deptcode, date, status, pageNo, pageSize);
} catch (Exception e) {
diff --git a/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java b/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java
index 7410233..7493fe2 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/dao/ConfPeopleDao.java
@@ -26,4 +26,6 @@
int countByConfidAndAttstatusIn(Integer confid, List<String> attstatus);
int countByConfidAndAttstatusNotIn(Integer confid, List<String> attstatus);
+
+ int countByConfidAndAttstatusNotInAndAtttypeNot(Integer confid, List<String> attstatus,String atttype);
}
diff --git a/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java b/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
index a2ce07f..ff13979 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/service/impl/ConferenceServiceImpl.java
@@ -557,14 +557,18 @@
"left join t_customer c on b.custid=c.custid " +
"left join tb_dept d on c.deptcode=d.deptcode " +
"left join t_customer e on b.insteadcustid=e.custid " +
- "where b.confid=:confid ");
+ "where b.confid=:confid and b.atttype!='temp' " +
+ "union " +
+ "select a.confid,a.confname,b.custname,b.cardno,b.remark as deptname,b.attstatus,b.atttime,b.custid,b.pid,'临时人员' as remark,'' as insteadcustid,a.conftype,'' as insteadcustname,b.atttype from "+table+" b " +
+ "left join tb_conference a on a.confid=b.confid " +
+ "where b.confid=:confid and b.atttype='temp' " );
StringBuffer countSql = new StringBuffer("select count(*) from "+table+" b " +
"left join tb_conference a on a.confid=b.confid " +
"left join t_customer c on b.custid=c.custid " +
"left join tb_dept d on c.deptcode=d.deptcode " +
"left join t_customer e on b.insteadcustid=e.custid " +
- "where b.confid=:confid");
+ "where b.confid=:confid ");
if (!StringUtil.isEmpty(attstatus)) {
@@ -575,7 +579,7 @@
querySql.append("and b.atttype=:atttype ");
countSql.append("and b.atttype=:atttype ");
}
- querySql.append(" order by b.cardno ");
+ querySql.append(" order by cardno ");
Query query = entityManager.createNativeQuery(querySql.toString());
Query countQuery = entityManager.createNativeQuery(countSql.toString());
@@ -610,7 +614,12 @@
"left join t_customer c on b.custid=c.custid " +
"left join tb_dept d on c.deptcode=d.deptcode " +
"left join t_customer e on b.insteadcustid=e.custid " +
- "where b.confid=:confid and b.atttime is "+attflag +" null ");
+ "where b.confid=:confid and b.atttime is "+attflag +" null and b.atttype !='temp' " );
+ if(!StringUtil.isEmpty(attflag)){
+ querySql.append("union " +
+ "select b.custname,b.attstatus,b.atttime,b.remark as deptname,'' as remark,'' as insteadcustname,b.atttype from "+table+" b " +
+ "where b.confid=:confid and b.atttype ='temp' ");
+ }
if (!StringUtil.isEmpty(attstatus)) {
querySql.append(" and b.attstatus=:attstatus ");
}
@@ -623,7 +632,7 @@
if(!StringUtil.isEmpty(searchkey)){
querySql.append("and b.custname=:searchkey");
}
- querySql.append(" order by b.atttime ");
+ querySql.append(" order by atttime ");
@@ -662,7 +671,7 @@
@Override
public Integer getConfPeopleCountNotIn(Integer confid,List<String> status) {
- return confPeopleDao.countByConfidAndAttstatusNotIn(confid,status);
+ return confPeopleDao.countByConfidAndAttstatusNotInAndAtttypeNot(confid,status,ConferenceConstant.ATTTYPE_TEMP);
}
@Override
@@ -703,7 +712,11 @@
"left join t_customer b on a.custid=b.custid " +
"left join tb_dept c on b.deptcode=c.deptcode " +
"left join tb_custtype d on b.custtypeid=d.custtypeid "+
- "where a.atttime is not null and confid=:confid ");
+ "where a.atttime is not null and a.atttype != 'temp' and a.confid=:confid " +
+ "UNION "+
+ "select a.custname,a.attstatus,a.atttime,a.remark as deptname," +
+ "'临时人员' as custtypename from "+table+" a "+
+ "where confid=:confid and a.atttype='temp'");
Query query = entityManager.createNativeQuery(querySql.toString());
query.setParameter("confid",confid);
query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(ConfPeopleApiBean.class));
diff --git a/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
index c12d668..6a05535 100644
--- a/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
+++ b/src/main/java/com/supwisdom/dlpay/conference/util/ConferenceConstant.java
@@ -22,6 +22,7 @@
public static final String ATTTYPE_SELF="self";
public static final String ATTTYPE_INSTEAD="instead";
+ public static final String ATTTYPE_TEMP="temp";
public static final String DEVICETYPE_CONFERENCE="H";
public static final Integer CONFDTL_STATUS_UPDATED=1;
diff --git a/src/main/resources/templates/apph5/tempattend.html b/src/main/resources/templates/apph5/tempattend.html
index 52f1fbd..066743d 100644
--- a/src/main/resources/templates/apph5/tempattend.html
+++ b/src/main/resources/templates/apph5/tempattend.html
@@ -27,60 +27,98 @@
<body>
<div id="app">
- <el-dialog :title="confName" center="true" top="10%" size="tiny" :modal-append-to-body='false' >
- <el-form ref="tempform" :model="tempform" :rules="rules" size="mini" label-width="36%">
- <el-form-item label="客户名称:" prop="custname">
- <div class="el-col el-col-18">
- <div class="el-input" style="width: 187px;">
- <el-input v-model="d.custname">
- </el-input>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="所属部门:" prop="deptname">
- <div class="el-col el-col-18">
- <div class="el-input" style="width: 187px;">
- <el-input v-model="d.deptname">
- </el-input>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="客户名称:" prop="custname">
- <div class="el-col el-col-18">
- <div class="el-input" style="width: 187px;">
- <el-input v-model="d.custname">
- </el-input>
- </div>
- </div>
- </el-form-item>
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">请登记访客信息</div><br>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="saveDev('devUpform')">登 记</el-button>
- </div>
- </el-dialog>
+ <el-form ref="tempform" :model="tempform" :rules="rules" size="mini" label-width="36%" style="margin-top:7%">
+ <el-form-item label="客户名称:" prop="custname">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.custname">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="所属部门:" prop="deptname">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.deptname">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="手机:" prop="phone">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="tempform.phone">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" style="text-align:center; ">
+ <el-button type="primary" @click="saveTemp('tempform')">登 记</el-button>
+ </div>
</div>
</body>
<script>
+ var validatePhone = function (rule, value, callback) {
+ if (value == "") {
+ callback(new Error("请输入手机号"));
+ } else if (!isCellPhone(value)) {//引入methods中封装的检查手机格式的方法
+ callback(new Error("请输入正确的手机号!"));
+ } else {
+ callback();
+ }
+ }
+
var app_vue = new Vue({
el: '#app',
data: {
- devNameList: [],
- devIdList: [],
- selectDevName: '',
- selectDevId: '',
- // 图片父容器高度
+ dialogFormVisible: true,
+ confName: '1234',
+ tempform: {
+ deptname: '',
+ custname: '',
+ phone: '',
+ confid:''
+ },
bannerHeight: 1000,
- // 浏览器宽度
screenWidth: 0,
- userId: ''
+ userId: '',
+ rules: {
+ deptname: [
+ {required: true, message: '请输入部门', trigger: 'blur'},
+ ],
+ custname: [
+ {required: true, message: '请输入姓名', trigger: 'blur'}
+ ],
+ phone: [
+ {required: true,validator: validatePhone, trigger: 'blur'}
+ ]
+ },
},
methods: {
+ saveTemp : function (formName) {
+ var _that = this;
+ var vali = false;
+ this.$refs[formName].validate(
+ function (valid) {
+ if (valid) {
+ vali = true;
+ } else {
+ vali = false;
+ }
+ });
+ if (vali == true) {
+ saveTempCustomer(_that, _that.tempform, formName);
+ }
+ },
+
indexChange: function (pre, next) {
var _self = this;
var devIdListTmp = _self.devIdList;
@@ -88,10 +126,6 @@
// console.log(_self.selectDevId)
},
- openDoor: function () {
- var devId = app_vue.selectDevId;
- app_openDoor(devId);
- },
setSize: function () {
// 通过浏览器宽度(图片宽度)计算高度
this.bannerHeight = this.screenWidth;
@@ -102,65 +136,50 @@
// 首次加载时,需要调用一次
_self.screenWidth = window.innerWidth;
_self.setSize();
+ var confid = '[[${confid}]]';
+ console.log(confid);
+ _self.tempform.confid = confid;
- var userId = '[[${userId}]]';
- _self.userId = userId;
-
- $.ajax({
- type: "get",
- dataType: "json",
- url: "[[@{/app/loadAppDevList?userId=}]]" + userId,
- success: function (ret) {
- var ut = ret.devList;
- if (ut == null) {
- confirm("不具有开门权限");
- }
- var names = [];
- var ids = [];
- for (var i = 0; i < ut.length; i++) {
- names.push(ut[i].devname);
- ids.push(ut[i].deviceid);
- }
- _self.devNameList = names;
- _self.devIdList = ids;
-
- }
- })
}
-
})
- function app_openDoor(devId) {
- var userId = app_vue.userId;
- console.log(userId);
- layer.confirm('你确定要开启此门吗?', {icon: 3, title: '请确认', offset: '30%'}, function (index) {
- $.ajax({
- type: "get",
- dataType: "json",
- url: encodeURI("[[@{/app/openDoorById?devId=}]]" + devId + "&userId=" + userId),
- success: function (ret) {
- if (ret.message == undefined) {
- layer.msg('用户认证已过期,请重新登录', {icon: 2, time: 1000});
- window.location = "[[@{/login}]]";
- return;
- }
- if (ret.message != "") {
- layer.msg(ret.message, {icon: 2, time: 2000});
- } else {
- layer.msg('开门成功', {icon: 1, time: 2000});
- }
- }
- })
- });
-
- }
-
// 窗口大小发生改变时,调用一次
window.onresize = function () {
app_vue.screenWidth = window.innerWidth;
app_vue.setSize();
}
+ function saveTempCustomer(_that, formdata, formName) {
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/api/conference/savetempcust}]]"),
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ data: JSON.stringify(formdata),
+ success: function (data) {
+
+ if (data.errcode != "0") {
+ layer.msg(data.errStr, {icon: 2, time: 2000});
+ } else {
+ layer.msg('登记成功!', {icon: 1, time: 1000});
+ }
+ }
+ });
+ }
+
+
+ function isCellPhone(val) {
+ if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
</script>
diff --git a/src/main/resources/templates/confpeople/index.html b/src/main/resources/templates/confpeople/index.html
index fe46124..da17eb2 100644
--- a/src/main/resources/templates/confpeople/index.html
+++ b/src/main/resources/templates/confpeople/index.html
@@ -97,7 +97,10 @@
field: 'atttype', title: '签到方式', align: 'center', sort: true, templet: function (d) {
if ('instead' == d.atttype) {
return '<span class="layui-badge layui-bg-orange">代签</span>'
- } else if ('self' == d.atttype) {
+ } if ('temp' == d.atttype) {
+ return '<span class="layui-badge layui-bg-orange">临时</span>'
+ }
+ else if ('self' == d.atttype) {
return '<span class="layui-badge layui-bg-green">实签</span>';
} else {
return d.atttype;
diff --git a/src/main/resources/templates/confreport/detail.html b/src/main/resources/templates/confreport/detail.html
index 1bb129e..7d94f42 100644
--- a/src/main/resources/templates/confreport/detail.html
+++ b/src/main/resources/templates/confreport/detail.html
@@ -165,7 +165,10 @@
return '<span class="layui-badge layui-bg-orange">代签</span>'
} else if ('self' == d.atttype) {
return '<span class="layui-badge layui-bg-green">实签</span>';
- } else {
+ }else if ('temp' == d.atttype) {
+ return '<span class="layui-badge layui-bg-orange">临时</span>';
+ }
+ else {
return '<span class="layui-badge layui-bg-green">实签</span>';
}
@@ -213,7 +216,9 @@
return '<span class="layui-badge layui-bg-orange">代签</span>'
} else if ('self' == d.atttype) {
return '<span class="layui-badge layui-bg-green">实签</span>';
- } else {
+ } else if ('temp' == d.atttype) {
+ return '<span class="layui-badge layui-bg-orange">临时</span>';
+ }else {
return '<span class="layui-badge layui-bg-green">实签</span>';
}
diff --git a/src/main/resources/templates/system/operator.html b/src/main/resources/templates/system/operator.html
index 9e70c0d..68b6fdb 100644
--- a/src/main/resources/templates/system/operator.html
+++ b/src/main/resources/templates/system/operator.html
@@ -106,11 +106,11 @@
label="联系电话"
width="180">
</el-table-column>
- <el-table-column
+ <!-- <el-table-column
prop="companyname"
label="所属公司"
width="180">
- </el-table-column>
+ </el-table-column>-->
<el-table-column
prop="deptname"
label="所属部门"
@@ -268,7 +268,7 @@
</el-col>
</el-form-item>
- <el-form-item label="所属公司:" prop="companyId">
+ <!--<el-form-item label="所属公司:" prop="companyId">
<el-col :span="18">
<el-select v-model="operatorDiaForm.companyId" style="width: 187px;"
filterable
@@ -281,7 +281,7 @@
</el-option>
</el-select>
</el-col>
- </el-form-item>
+ </el-form-item>-->
<el-form-item label="所属部门:" prop="deptcode">
<el-col :span="18">
@@ -389,7 +389,7 @@
dialogFormVisible: false,
regions: [],
opertypes: [],
- companys: [],
+ // companys: [],
depts: [],
operatorDiaForm: {
operid: '',
@@ -401,7 +401,7 @@
mobile: '',
email: '',
realname: '',
- companyId: '',
+ // companyId: '',
deptcode: ''
},
buildingTitle: '',
@@ -445,9 +445,9 @@
email: [
{validator: oper_validateEmail, trigger: 'blur'}
],
- companyId: [
+ /* companyId: [
{required: true, message: '请选择所属公司', trigger: 'blur'}
- ],
+ ],*/
deptcode: [
{required: true, message: '请选择所属部门', trigger: 'blur'}
]
@@ -657,7 +657,7 @@
_self.operatorDiaForm.email = ret.operator.email;
_self.operatorDiaForm.realname = ret.operator.realname;
_self.operatorDiaForm.regionid = ret.operator.regionid;
- _self.operatorDiaForm.companyId = ret.operator.companyId;
+ // _self.operatorDiaForm.companyId = ret.operator.companyId;
_self.operatorDiaForm.deptcode = ret.operator.deptcode;
if (ret.operator.opertype == 'H') {
_self.regionDis = false;
@@ -685,7 +685,7 @@
_self.regions = regionlist;
- var companylist = [];
+ /* var companylist = [];
var companys = ret.companys;
for (var k = 0; k < companys.length; k++) {
companylist.push({
@@ -693,7 +693,7 @@
label: companys[k]["companyName"]
});
}
- _self.companys = companylist;
+ _self.companys = companylist;*/
var deptlist = [];
var depts = ret.depts;