大理H5补打卡功能
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/ClockInfo.java b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockInfo.java
new file mode 100644
index 0000000..7426dbb
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockInfo.java
@@ -0,0 +1,40 @@
+package com.supwisdom.dlpay.atte.bean;
+
+public class ClockInfo {
+ private String custid;
+ private Integer timeid;
+ private String timename;
+ private String attedate;
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public Integer getTimeid() {
+ return timeid;
+ }
+
+ public void setTimeid(Integer timeid) {
+ this.timeid = timeid;
+ }
+
+ public String getTimename() {
+ return timename;
+ }
+
+ public void setTimename(String timename) {
+ this.timename = timename;
+ }
+
+ public String getAttedate() {
+ return attedate;
+ }
+
+ public void setAttedate(String attedate) {
+ this.attedate = attedate;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/ClockSearchBean.java b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockSearchBean.java
new file mode 100644
index 0000000..f6ccf0b
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockSearchBean.java
@@ -0,0 +1,40 @@
+package com.supwisdom.dlpay.atte.bean;
+
+public class ClockSearchBean {
+ private String attedate;
+ private Integer custtypeid;
+ private String deptcode;
+ private Integer status;
+
+ public String getAttedate() {
+ return attedate;
+ }
+
+ public void setAttedate(String attedate) {
+ this.attedate = attedate;
+ }
+
+ public Integer getCusttypeid() {
+ return custtypeid;
+ }
+
+ public void setCusttypeid(Integer custtypeid) {
+ this.custtypeid = custtypeid;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/ClockShowBean.java b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockShowBean.java
new file mode 100644
index 0000000..cf86983
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/ClockShowBean.java
@@ -0,0 +1,113 @@
+package com.supwisdom.dlpay.atte.bean;
+
+public class ClockShowBean {
+ private Integer id;
+ private String custid;
+ private String custname;
+ private String attedate;
+ private Integer timeid;
+ private String timename;
+ private String deptname;
+ private String deptcode;
+ private Integer custtypeid;
+ private String custtypename;
+ private String remark;
+ private Integer status;
+
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public String getAttedate() {
+ return attedate;
+ }
+
+ public void setAttedate(String attedate) {
+ this.attedate = attedate;
+ }
+
+ public Integer getTimeid() {
+ return timeid;
+ }
+
+ public void setTimeid(Integer timeid) {
+ this.timeid = timeid;
+ }
+
+ public String getTimename() {
+ return timename;
+ }
+
+ public void setTimename(String timename) {
+ this.timename = timename;
+ }
+
+ public String getDeptname() {
+ return deptname;
+ }
+
+ public void setDeptname(String deptname) {
+ this.deptname = deptname;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public Integer getCusttypeid() {
+ return custtypeid;
+ }
+
+ public void setCusttypeid(Integer custtypeid) {
+ this.custtypeid = custtypeid;
+ }
+
+ public String getCusttypename() {
+ return custtypename;
+ }
+
+ public void setCusttypename(String custtypename) {
+ this.custtypename = custtypename;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java b/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
index 41080ed..d39236d 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
@@ -1,6 +1,9 @@
package com.supwisdom.dlpay.atte.controller;
+import com.supwisdom.dlpay.atte.bean.ClockInfo;
+import com.supwisdom.dlpay.atte.bean.ClockSearchBean;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
+import com.supwisdom.dlpay.atte.domain.TAtteClock;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
import com.supwisdom.dlpay.atte.service.AtteClassService;
import com.supwisdom.dlpay.atte.service.AtteRestService;
@@ -253,4 +256,156 @@
}
+ /**
+ * 补打卡页面
+ */
+ @GetMapping("/atte/clockindex")
+ public ModelAndView clockindex(@RequestParam(value = "custid")String custid){
+ ModelAndView model=new ModelAndView();
+ model.addObject("custid",custid);
+ model.setViewName("apph5/doclock");
+ return model;
+ }
+
+ /**
+ * 查询补卡时段
+ */
+ @RequestMapping("/atte/getclocklist")
+ @ResponseBody
+ public Map getclocklist(@RequestParam("custid") String custid,
+ @RequestParam("attedate") String attedate){
+ Map map=new HashMap();
+
+ try {
+ if(StringUtil.isEmpty(custid)||StringUtil.isEmpty(attedate)){
+ map.put("errStr","查询错误!");
+ return map;
+ }
+ List<ClockInfo> list=atteRestService.getClockList(attedate,custid);
+ map.put("infolist",list);
+ map.put("errStr","");
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("errStr",e.getMessage());
+ }
+
+ return map;
+
+ }
+
+
+ /**
+ * 补打卡
+ * @param
+ */
+ @RequestMapping(value = "/atte/saveClock", method = {RequestMethod.POST})
+ @ResponseBody
+ public Map saveClock(@RequestParam("custid") String custid,
+ @RequestParam("attedate") String attedate,
+ @RequestParam("timeid") Integer timeid,
+ @RequestParam("remark") String remark,
+ HttpServletRequest request){
+ Map map=new HashMap();
+ if(StringUtil.isEmpty(custid)||timeid==null||StringUtil.isEmpty(attedate)){
+ map.put("errStr","参数不能为空!");
+ return map;
+ }
+ if(atteRestService.canClock(attedate,custid,timeid)){
+ TAtteClock clock=new TAtteClock();
+ clock.setAttedate(attedate);
+ clock.setCustid(custid);
+ clock.setRemark(remark);
+ clock.setStatus(0);
+ clock.setTimeid(timeid);
+ clock.setUpdatetime(DateUtil.getNow());
+ if(!atteRestService.saveClock(clock)){
+ map.put("errStr","添加数据失败!");
+ }else{
+ map.put("errStr","");
+ }
+ }else {
+ map.put("errStr","所选日期时段已申请!");
+ }
+
+ return map;
+ }
+ /**
+ * 补打卡审核
+ */
+ @GetMapping("/atte/reviewClock")
+ public ModelAndView reviewClock(@RequestParam(value = "custid")String custid){
+ ModelAndView model=new ModelAndView();
+ model.addObject("custid",custid);
+ model.setViewName("apph5/reviewclock");
+
+ return model;
+ }
+
+ /**
+ * 补打卡审核列表
+ */
+ @RequestMapping(value = "/atte/getreviewclock")
+ @ResponseBody
+ public Map getreviewclock(@RequestParam("attedate") String attedate,
+ @RequestParam("custid") String custid,
+ @RequestParam(value="status", required = false, defaultValue = "") Integer status,
+ @RequestParam(value = "custtypeid", required = false, defaultValue = "") Integer custtypeid,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
+ HttpServletRequest request){
+
+ Map map=new HashMap();
+ ClockSearchBean searchBean=new ClockSearchBean();
+ searchBean.setAttedate(attedate);
+ searchBean.setCusttypeid(custtypeid);
+ searchBean.setStatus(status);
+ TCustomer cust=webInterfaceService.findCustomerById(custid);
+ if(StringUtil.isEmpty(cust.getDeptcode())){
+ searchBean.setDeptcode("99");
+ }else {
+ searchBean.setDeptcode(cust.getDeptcode());
+ }
+ Pagination page=atteRestService.getClockPage(searchBean,pageNo,pageSize);
+ map.put("page",page);
+ return map;
+ }
+
+ /**
+ * 审核补打卡
+ */
+ @RequestMapping(value = "/atte/reviewclock")
+ @ResponseBody
+ public Map reviewclock(
+ @RequestParam("status") Integer status,
+ @RequestParam("id") Integer id,
+ HttpServletRequest request){
+ Map map=new HashMap();
+
+ try {
+ if(status==null || id==null){
+ map.put("errStr","参数错误");
+ return map;
+ }
+ TAtteClock clock=atteRestService.getClockById(id);
+ if(clock!=null&&clock.getStatus()==0){
+ clock.setUpdatetime(DateUtil.getNow());
+ clock.setStatus(status);
+ atteRestService.updateClock(clock);
+ if(status==1){
+ atteRestService.updateAtteDtl(clock.getCustid(),clock.getAttedate(),clock.getTimeid(),clock.getRemark());
+ }
+ map.put("errStr","");
+ }else {
+ map.put("errStr","参数错误!");
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ map.put("errStr",e.getMessage());
+ }
+
+ return map;
+
+ }
+
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClassDao.java b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClassDao.java
index 6896e79..b7f4c35 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClassDao.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClassDao.java
@@ -74,4 +74,6 @@
//辅警干警报表
public Pagination getPReportWithPage(AttedtlSearchBean searchBean,int pageNo,int pageSize);
public List<AtteReport> getPReportList(AttedtlSearchBean searchBean);
+
+ public TAtteDtl getDtl(Integer timeid,String attedate,String custid);
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClockDao.java b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClockDao.java
new file mode 100644
index 0000000..4989fe8
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteClockDao.java
@@ -0,0 +1,20 @@
+package com.supwisdom.dlpay.atte.dao;
+
+import com.supwisdom.dlpay.atte.bean.ClockSearchBean;
+import com.supwisdom.dlpay.atte.domain.TAtteClock;
+import com.supwisdom.dlpay.system.page.Pagination;
+
+public interface AtteClockDao {
+
+ public boolean saveClock(TAtteClock bean);
+
+ public boolean updateClock(TAtteClock bean);
+
+ public boolean canClock(String attedate,Integer timeid,String custid);
+
+ public Pagination getClockPage(ClockSearchBean searchBean,int pageNo,int pageSize);
+
+ public TAtteClock getClockById(Integer id);
+
+ public boolean isClock(String custid,Integer timeid,String attedate);
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteRestDao.java b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteRestDao.java
index 2b7a4bf..7ec31b5 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteRestDao.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteRestDao.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.atte.dao;
import com.supwisdom.dlpay.atte.bean.AtteRestInfo;
+import com.supwisdom.dlpay.atte.bean.ClockInfo;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
import com.supwisdom.dlpay.system.page.Pagination;
@@ -22,4 +23,7 @@
//是否审核人
public boolean isreview(String custid);
+
+ //补卡信息
+ public List<ClockInfo> getClockList(String attedate,String custid);
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClassDaoImpl.java b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClassDaoImpl.java
index 4ee8c12..2a0c88c 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClassDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClassDaoImpl.java
@@ -824,4 +824,22 @@
List<AtteReport> list=query.getResultList();
return list;
}
+
+ @Transactional
+ @Override
+ public TAtteDtl getDtl(Integer timeid, String attedate, String custid) {
+ if(StringUtil.isEmpty(attedate)||StringUtil.isEmpty(custid)||timeid==null){
+ return null;
+ }
+ String sql=" select bean from TAtteDtl bean where bean.custid=:cid and bean.attedate=:adate and bean.timeid=:tid ";
+ TypedQuery<TAtteDtl> query=entityManager.createQuery(sql,TAtteDtl.class);
+ query.setParameter("tid",timeid);
+ query.setParameter("adate",attedate);
+ query.setParameter("cid",custid);
+ List<TAtteDtl> list=query.getResultList();
+ if(list!=null&&list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClockDaoImpl.java b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClockDaoImpl.java
new file mode 100644
index 0000000..4726afa
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClockDaoImpl.java
@@ -0,0 +1,198 @@
+package com.supwisdom.dlpay.atte.dao.impl;
+
+import com.supwisdom.dlpay.atte.bean.AtteRestInfo;
+import com.supwisdom.dlpay.atte.bean.ClockSearchBean;
+import com.supwisdom.dlpay.atte.bean.ClockShowBean;
+import com.supwisdom.dlpay.atte.dao.AtteClockDao;
+import com.supwisdom.dlpay.atte.dao.AtteRestDao;
+import com.supwisdom.dlpay.atte.domain.TAtteClock;
+import com.supwisdom.dlpay.atte.domain.TAtteRest;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.system.page.Pagination;
+import org.apache.poi.ss.formula.functions.T;
+import org.hibernate.query.internal.NativeQueryImpl;
+import org.hibernate.transform.Transformers;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+@Service
+public class AtteClockDaoImpl implements AtteClockDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+ @Transactional
+ @Override
+ public boolean saveClock(TAtteClock bean) {
+
+ boolean flag=false;
+ try {
+ entityManager.persist(bean);
+ flag=true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return flag;
+ }
+
+ @Transactional
+ @Override
+ public boolean updateClock(TAtteClock bean) {
+ boolean flag=false;
+ try {
+ entityManager.merge(bean);
+ flag=true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return flag;
+ }
+
+ @Transactional
+ @Override
+ public boolean canClock(String attedate, Integer timeid, String custid) {
+ if(StringUtil.isEmpty(attedate)||timeid==null||StringUtil.isEmpty(custid)){
+ return false;
+ }
+ String sql=" select a from TAtteClock a where a.attedate=:adate and a.timeid=:tid and a.custid=:cid and a.status=0 ";
+ TypedQuery<TAtteClock> query=entityManager.createQuery(sql,TAtteClock.class);
+ query.setParameter("adate",attedate);
+ query.setParameter("tid",timeid);
+ query.setParameter("cid",custid);
+ List<TAtteClock> list=query.getResultList();
+ if(list!=null&&list.size()>0){
+ return false;
+ }
+ return true;
+ }
+
+ @Transactional
+ @Override
+ public Pagination getClockPage(ClockSearchBean searchBean, int pageNo, int pageSize) {
+ StringBuffer sql=new StringBuffer();
+ sql.append(" select t.id,t.custid,c.custname,t.attedate,t.timeid,nc.timename,t.status,t.remark,ct.custtypeid,ct.custtypename,td.deptcode,td.deptname ")
+ .append(" from t_atte_clock t left join t_nc_time nc on t.timeid=nc.timeid ")
+ .append(" left join t_customer c on t.custid=c.custid ")
+ .append(" left join tb_custtype ct on c.custtypeid=ct.custtypeid ")
+ .append(" left join tb_dept td on c.deptcode=td.deptcode ")
+ .append(" where c.status='1' ");
+ if(!StringUtil.isEmpty(searchBean.getAttedate())){
+ sql.append(" and t.attedate=:adate");
+ }
+ if(!StringUtil.isEmpty(searchBean.getDeptcode())){
+ sql.append(" and td.deptcode=:dcode ");
+ }
+ if(searchBean.getStatus()!=null){
+ sql.append(" and t.status=:stat ");
+ }
+ if(searchBean.getCusttypeid()!=null){
+ sql.append(" and ct.custtypeid=:ctypeid ");
+ }
+ Query query=entityManager.createNativeQuery(sql.toString());
+ if(!StringUtil.isEmpty(searchBean.getAttedate())){
+ query.setParameter("adate",searchBean.getAttedate());
+ }
+ if(!StringUtil.isEmpty(searchBean.getDeptcode())){
+ query.setParameter("dcode",searchBean.getDeptcode());
+ }
+ if(searchBean.getStatus()!=null){
+ query.setParameter("stat",searchBean.getStatus());
+ }
+ if(searchBean.getCusttypeid()!=null){
+ query.setParameter("ctypeid",searchBean.getCusttypeid());
+ }
+ pageNo = pageNo <= 0 ? 1 : pageNo;
+ query.setFirstResult((pageNo - 1) * pageSize);
+ query.setMaxResults(pageSize);
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(ClockShowBean.class));
+ Pagination page = new Pagination();
+ page.setPageNo(pageNo);
+ page.setPageSize(pageSize);
+ List<ClockShowBean> list=query.getResultList();
+ page.setList(list);
+ int totalCount= getClockCount(searchBean);
+ page.setTotalCount(totalCount);
+ return page;
+ }
+
+ public int getClockCount(ClockSearchBean searchBean){
+ StringBuffer sql=new StringBuffer();
+ sql.append(" select count(t.id) ")
+ .append(" from t_atte_clock t left join t_nc_time nc on t.timeid=nc.timeid ")
+ .append(" left join t_customer c on t.custid=c.custid ")
+ .append(" left join tb_custtype ct on c.custtypeid=ct.custtypeid ")
+ .append(" left join tb_dept td on c.deptcode=td.deptcode ")
+ .append(" where c.status='1' ");
+ if(!StringUtil.isEmpty(searchBean.getAttedate())){
+ sql.append(" and t.attedate=:adate");
+ }
+ if(!StringUtil.isEmpty(searchBean.getDeptcode())){
+ sql.append(" and td.deptcode=:dcode ");
+ }
+ if(searchBean.getStatus()!=null){
+ sql.append(" and t.status=:stat ");
+ }
+ if(searchBean.getCusttypeid()!=null){
+ sql.append(" and ct.custtypeid=:ctypeid ");
+ }
+ Query query=entityManager.createNativeQuery(sql.toString());
+ if(!StringUtil.isEmpty(searchBean.getAttedate())){
+ query.setParameter("adate",searchBean.getAttedate());
+ }
+ if(!StringUtil.isEmpty(searchBean.getDeptcode())){
+ query.setParameter("dcode",searchBean.getDeptcode());
+ }
+ if(searchBean.getStatus()!=null){
+ query.setParameter("stat",searchBean.getStatus());
+ }
+ if(searchBean.getCusttypeid()!=null){
+ query.setParameter("ctypeid",searchBean.getCusttypeid());
+ }
+ int cnt=0;
+ Object obj=query.getSingleResult();
+ if(obj!=null){
+ cnt=Integer.parseInt(obj.toString());
+ }
+ return cnt;
+ }
+
+ @Transactional
+ @Override
+ public TAtteClock getClockById(Integer id) {
+ String sql=" select bean from TAtteClock bean ";
+ if(id!=null){
+ sql+=" where bean.id = :sid ";
+ TypedQuery<TAtteClock> query=entityManager.createQuery(sql,TAtteClock.class);
+ query.setParameter("sid",id);
+ List<TAtteClock> list=query.getResultList();
+ if(list!=null&&list.size()>0){
+ return list.get(0);
+ }
+ }
+ return null;
+ }
+
+ @Transactional
+ @Override
+ public boolean isClock(String custid, Integer timeid, String attedate) {
+ if(StringUtil.isEmpty(custid)||StringUtil.isEmpty(attedate)||timeid==null){
+ return false;
+ }
+ String sql=" select bean from TAtteClock bean where bean.status=1 and bean.attedate=:adate and bean.timeid=:tid and bean.custid=:cid ";
+ TypedQuery<TAtteClock> query=entityManager.createQuery(sql,TAtteClock.class);
+ query.setParameter("cid",custid);
+ query.setParameter("adate",attedate);
+ query.setParameter("tid",timeid);
+ List<TAtteClock> list=query.getResultList();
+ if(list!=null&&list.size()>0){
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
index 63e43d7..b247f7b 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.atte.dao.impl;
import com.supwisdom.dlpay.atte.bean.AtteRestInfo;
+import com.supwisdom.dlpay.atte.bean.ClockInfo;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
import com.supwisdom.dlpay.atte.dao.AtteRestDao;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
@@ -37,6 +38,7 @@
return flag;
}
+ @Transactional
@Override
public boolean updateAtteRest(TAtteRest bean) {
boolean flag=false;
@@ -49,6 +51,7 @@
return flag;
}
+ @Transactional
@Override
public TAtteRest getAtteRestById(Integer id) {
String sql=" select bean from TAtteRest bean ";
@@ -245,4 +248,22 @@
}
return false;
}
+
+ @Transactional
+ @Override
+ public List<ClockInfo> getClockList(String attedate, String custid) {
+ if(StringUtil.isEmpty(attedate)||StringUtil.isEmpty(custid)){
+ return null;
+ }
+ String sql=" select d.custid,d.attedate,d.timeid,t.timename ";
+ sql+=" from t_atte_dtl d left join t_nc_time t on d.timeid=t.timeid where state=0 and d.custid=:cid and d.attedate=:adate ";
+ sql+=" and d.timeid not in (select timeid from t_atte_clock where attedate=:adate and custid=:cid and status=0 ) ";
+ sql+=" order by d.timeid ";
+ Query query=entityManager.createNativeQuery(sql);
+ query.setParameter("cid",custid);
+ query.setParameter("adate",attedate);
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(ClockInfo.class));
+ List<ClockInfo> list=query.getResultList();
+ return list;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteClock.java b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteClock.java
new file mode 100644
index 0000000..438ef1b
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteClock.java
@@ -0,0 +1,79 @@
+package com.supwisdom.dlpay.atte.domain;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name="t_atte_clock")
+public class TAtteClock {
+ @Id
+ @Column(name = "ID", unique = true, nullable = false, length = 32)
+ @GeneratedValue( strategy = GenerationType.AUTO)
+ private Integer id;
+ @Column(name="custid",length = 32)
+ private String custid;
+ @Column(name="attedate", length = 8)
+ private String attedate;
+ @Column(name = "TIMEID",nullable = false, precision = 9, scale = 0)
+ private Integer timeid;@Column(name="updatetime",length = 14)
+ private String updatetime;
+ @Column(name="status",length = 4)
+ private Integer status; // 0-未审核 1-已通过 2-未通过
+ @Column(name="remark",length = 60 )
+ private String remark;
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+
+ public String getAttedate() {
+ return attedate;
+ }
+
+ public void setAttedate(String attedate) {
+ this.attedate = attedate;
+ }
+
+ public Integer getTimeid() {
+ return timeid;
+ }
+
+ public void setTimeid(Integer timeid) {
+ this.timeid = timeid;
+ }
+
+ public String getUpdatetime() {
+ return updatetime;
+ }
+
+ public void setUpdatetime(String updatetime) {
+ this.updatetime = updatetime;
+ }
+
+ public Integer getStatus() {
+ return status;
+ }
+
+ public void setStatus(Integer status) {
+ this.status = status;
+ }
+
+ public String getRemark() {
+ return remark;
+ }
+
+ public void setRemark(String remark) {
+ this.remark = remark;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/service/AtteRestService.java b/src/main/java/com/supwisdom/dlpay/atte/service/AtteRestService.java
index 262b902..f4d8ed2 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/service/AtteRestService.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/service/AtteRestService.java
@@ -1,12 +1,18 @@
package com.supwisdom.dlpay.atte.service;
+import com.supwisdom.dlpay.atte.bean.ClockInfo;
+import com.supwisdom.dlpay.atte.bean.ClockSearchBean;
+import com.supwisdom.dlpay.atte.bean.ClockShowBean;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
+import com.supwisdom.dlpay.atte.domain.TAtteClock;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
import com.supwisdom.dlpay.system.page.Pagination;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+
public interface AtteRestService {
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public boolean saveAtteRest(TAtteRest bean);
@@ -26,4 +32,26 @@
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
public boolean isreview(String custid);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public List<ClockInfo> getClockList(String attedate,String custid);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean canClock(String attedate,String custid,Integer timeid);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean saveClock(TAtteClock bean);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean updateClock(TAtteClock bean);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public Pagination getClockPage(ClockSearchBean searchBean, int pageNO, int pageSize);
+
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public TAtteClock getClockById(Integer id);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean updateAtteDtl(String custid,String attedate,Integer timeid,String remark);
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteClassServiceImpl.java b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteClassServiceImpl.java
index 6707c73..54d71c2 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteClassServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteClassServiceImpl.java
@@ -4,10 +4,7 @@
import com.supwisdom.dlpay.atte.bean.AtteReport;
import com.supwisdom.dlpay.atte.bean.AttedtlSearchBean;
import com.supwisdom.dlpay.atte.bean.CustSearchBean;
-import com.supwisdom.dlpay.atte.dao.AtteClassDao;
-import com.supwisdom.dlpay.atte.dao.AtteRestDao;
-import com.supwisdom.dlpay.atte.dao.CustseaDao;
-import com.supwisdom.dlpay.atte.dao.SeasonDao;
+import com.supwisdom.dlpay.atte.dao.*;
import com.supwisdom.dlpay.atte.domain.*;
import com.supwisdom.dlpay.atte.service.AtteClassService;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
@@ -54,6 +51,8 @@
private SystemService systemService;
@Autowired
private BusinessparaDao businessparaDao;
+ @Autowired
+ AtteClockDao atteClockDao;
@Override
public Pagination getClassWithPage(String classname,String deptcode, int pageNo, int pageSize) {
@@ -216,6 +215,10 @@
}else{
dtl.setState(0);
}
+ //判断有无补打卡
+ if(dtl.getState()==0&&atteClockDao.isClock(cust.getCustid(),timeid,attedate)){
+ dtl.setState(1);
+ }
dtl.setStatus(1);
dtl.setTimeid(timeid);
dtl.setUpdatetime(DateUtil.getNow());
diff --git a/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteRestServiceImpl.java b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteRestServiceImpl.java
index 7acdd40..2e6ba17 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteRestServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteRestServiceImpl.java
@@ -1,17 +1,32 @@
package com.supwisdom.dlpay.atte.service.impl;
+import com.supwisdom.dlpay.atte.bean.ClockInfo;
+import com.supwisdom.dlpay.atte.bean.ClockSearchBean;
+import com.supwisdom.dlpay.atte.bean.ClockShowBean;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
+import com.supwisdom.dlpay.atte.dao.AtteClassDao;
+import com.supwisdom.dlpay.atte.dao.AtteClockDao;
import com.supwisdom.dlpay.atte.dao.AtteRestDao;
+import com.supwisdom.dlpay.atte.domain.TAtteClock;
+import com.supwisdom.dlpay.atte.domain.TAtteDtl;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
import com.supwisdom.dlpay.atte.service.AtteRestService;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.system.page.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.List;
+
@Service
public class AtteRestServiceImpl implements AtteRestService {
@Autowired
AtteRestDao atteRestDao;
+ @Autowired
+ AtteClockDao atteClockDao;
+ @Autowired
+ AtteClassDao atteClassDao;
@Override
public boolean saveAtteRest(TAtteRest bean) {
@@ -42,4 +57,49 @@
public boolean isreview(String custid) {
return atteRestDao.isreview(custid);
}
+
+ @Override
+ public List<ClockInfo> getClockList(String attedate, String custid) {
+ return atteRestDao.getClockList(attedate,custid);
+ }
+
+ @Override
+ public boolean canClock(String attedate, String custid, Integer timeid) {
+ return atteClockDao.canClock(attedate,timeid,custid);
+ }
+
+ @Override
+ public boolean saveClock(TAtteClock bean) {
+ return atteClockDao.saveClock(bean);
+ }
+
+ @Override
+ public boolean updateClock(TAtteClock bean) {
+ return atteClockDao.updateClock(bean);
+ }
+
+
+ @Override
+ public Pagination getClockPage(ClockSearchBean searchBean, int pageNO, int pageSize) {
+ return atteClockDao.getClockPage(searchBean,pageNO,pageSize);
+ }
+
+ @Override
+ public TAtteClock getClockById(Integer id) {
+ return atteClockDao.getClockById(id);
+ }
+
+ @Override
+ public boolean updateAtteDtl(String custid, String attedate, Integer timeid,String remark) {
+ TAtteDtl dtl=atteClassDao.getDtl(timeid,attedate,custid);
+ if(dtl!=null&&dtl.getState()==0){
+ dtl.setState(1);
+ dtl.setUpdatetime(DateUtil.getNow());
+ if(StringUtil.isEmpty(dtl.getRemark())){
+ dtl.setRemark(remark);
+ }
+ atteClassDao.updateAtteDtl(dtl);
+ }
+ return true;
+ }
}
diff --git a/src/main/resources/templates/apph5/doclock.html b/src/main/resources/templates/apph5/doclock.html
new file mode 100644
index 0000000..a383f5f
--- /dev/null
+++ b/src/main/resources/templates/apph5/doclock.html
@@ -0,0 +1,348 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<body>
+
+<div id="app1">
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">补打卡</div>
+ <br>
+
+ <el-form ref="tempform" :model="tempform" :rules="rules" size="mini" label-width="36%" style="margin-top:7%">
+
+ <el-form-item label="日期:" prop="attedate">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-date-picker type="date" v-model="tempform.attedate" id="time"
+ :picker-options="pickerOptions0" :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+
+ </el-form>
+ <div style="text-align:center; ">
+ <el-button type="primary" @click="searchDtl">查询</el-button>
+ </div>
+ <div class="row">
+ <div class="col-md-12" style="padding-left: 0px;padding-right: 0px">
+ <div class="box box-primary" style="margin-bottom: 15px">
+ <div class="box-body box-profile">
+ <template>
+ <el-table
+ ref="singleTable"
+ :data="tableData"
+ highlight-current-row
+ stripe
+ border>
+ <el-table-column
+ align="center">
+ <template scope="scope">
+ <div class="weui-panel__bd">
+ <div class="weui-media-box weui-media-box_text">
+ <p class="weui-media-box__desc">
+ <div class="weui-cell__bd">
+ <span style="font-size:14px;color:#999; "></span>
+ </div>
+ <div style="display: flex;">
+
+ <div style="font-size:14px;color:#999;flex: 1">
+ {{scope.row.timename}}
+ </div>
+ <div style="font-size:14px;color:#999;margin-left:10px">
+ <el-button
+ type="success"
+ @click="addclock(scope.row)">申请</el-button>
+
+ </div>
+
+ </div>
+ </p>
+ </div>
+ </div>
+ </template>
+ </el-table-column>
+
+ </el-table>
+
+ </template>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <el-dialog :title="applytitle" :visible.sync="dialogFormVisible" size="large"
+ :modal-append-to-body='false' @close="closeDialog('applyform')">
+ <el-form ref="applyform" class="el-form-item " :model="applyform"
+ :rules="rules" label-width="36%">
+ <el-form-item label="打卡时段:" prop="timename">
+ <el-col :span="18">
+ <el-input v-model="applyform.timename" readonly style="width: 90%;" maxlength="20">
+ </el-input>
+ </el-col>
+ </el-form-item>
+ <el-form-item label="备注:" prop="remark">
+ <el-col :span="18">
+ <el-input type="textarea" style="width: 90%;" v-model="applyform.remark" placeholder="填写备注"
+ >
+ </el-input>
+ </el-col>
+ </el-form-item>
+
+
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <!--<el-button @click="resetForm('applyform') ">取 消</el-button>-->
+ <el-button type="primary" @click="apply('applyform')">申请</el-button>
+
+
+ </div>
+ </el-dialog>
+
+</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: '#app1',
+ data: {
+ dialogFormVisible: false,
+ confName: '1234',
+ tempform: {
+ attedate: '',
+ },
+ applyform:{
+ remark:'',
+ custid:'',
+ attedate:'',
+ timeid:'',
+ timename:''
+ },
+ applytitle:'申请',
+ tableData:[],
+ rtypelist: [],
+ bannerHeight: 1000,
+ screenWidth: 0,
+ userId: '',
+ pickerOptions0: {
+ disabledDate: function (time) {
+ return false;
+ }
+ },pickerOptions1: {
+ disabledDate:function(time) {
+ if(app_vue.tempform.startdate !=''){
+
+ return time.getTime() < app_vue.tempform.startdate.getTime();
+ }else {
+ return time.getTime() > Date.now();
+ }
+ }
+ },
+ rules: {
+ remark: [
+ {required: true, message: '请输入备注', trigger: 'blur'}
+ ]
+ },
+ },
+
+ methods: {
+ apply: function (formName) {
+ var _that = this;
+ var vali = false;
+ this.$refs[formName].validate(
+ function (valid) {
+ if (valid) {
+ vali = true;
+ } else {
+ vali = false;
+ }
+ });
+ if (vali == true) {
+ saveTemp(_that, formName);
+ }
+ },
+ closeDialog:function(formName) {
+ this.$refs[formName].resetFields();
+ this.dialogFormVisible = false
+ },
+ searchDtl:function(){
+ var that=this;
+ searchDtl(that);
+ },
+ indexChange: function (pre, next) {
+ var _self = this;
+ var devIdListTmp = _self.devIdList;
+ _self.selectDevId = devIdListTmp[pre];
+ // console.log(_self.selectDevId)
+
+ },
+ setSize: function () {
+ // 通过浏览器宽度(图片宽度)计算高度
+ this.bannerHeight = this.screenWidth;
+ },
+ addclock:function (row){
+ getFillData(this, row);
+ this.dialogFormVisible = true;
+ }
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+
+ }
+ })
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ app_vue.screenWidth = window.innerWidth;
+ app_vue.setSize();
+ }
+ function getFillData(_self, row) {
+ _self.applyform.custid=row.custid;
+ _self.applyform.attedate=row.attedate;
+ _self.applyform.timeid=row.timeid;
+ _self.applyform.timename=row.timename;
+
+ }
+
+ function saveTemp(that, formName) {
+ var token = $("meta[name='_csrf_token']").attr("value");
+ var attedate=that.applyform.attedate;
+ var timeid=that.applyform.timeid;
+ var remark=that.applyform.remark;
+ var custid=that.applyform.custid;
+
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/app/atte/saveClock?attedate=}]]"+attedate+"&timeid="+timeid+"&remark="+remark+"&custid="+custid),
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ success: function (data) {
+
+ if (data.errStr != "") {
+ layer.msg(data.errStr, {icon: 2, time: 2000});
+ } else {
+ layer.msg('申请成功!', {icon: 1, time: 1000});
+ that.dialogFormVisible = false;
+ searchDtl(that);
+ }
+ }
+ });
+ }
+
+
+ function isCellPhone(val) {
+ if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ function class_Formatdate(date){
+ if(date==null||date==''){
+ return '';
+ }
+ var d=new Date(date);
+ var month=d.getMonth() + 1+'';
+ var date=d.getDate()+'';
+ if(month.length==1){
+ month='0'+month;
+ }
+ if(date.length==1){
+ date='0'+date;
+ }
+ var formated=d.getFullYear() + '' + month + '' +date;
+
+ return formated;
+ }
+ function searchDtl(that){
+ var custid='[[${custid}]]';
+ var attedate=class_Formatdate(that.tempform.attedate);
+ if(attedate==''||attedate==undefined){
+ layer.msg("请选择日期!", {icon: 2, time: 2000});
+ return ;
+ }
+ $.ajax({
+ type:"get",
+ dataType:"json",
+ url:"[[@{/app/atte/getclocklist?attedate=}]]"+attedate+"&custid="+custid,
+ success:function(ret){
+ if(ret.errStr != ''){
+ layer.msg(ret.errStr, {icon: 2, time: 2000});
+ }
+ that.tableData=ret.infolist;
+ }
+ })
+ }
+
+
+</script>
+
+<style>
+
+ .el-carousel__item h3 {
+ color: #ff3366;
+ font-size: 14px;
+ opacity: 0.75;
+ line-height: 300px;
+ margin: 0;
+ /*background-color:#66cccc;
+ border: 0px solid #e5e5e5;
+ width: 50%;
+ left: 10%;
+ height: 100%;*/
+ }
+
+ .el-carousel__item:nth-child(2n) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item:nth-child(2n+1) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item .Carousel {
+ border-bottom: 1px solid #f1f4f8;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/apph5/leavehistory.html b/src/main/resources/templates/apph5/leavehistory.html
index 9978c12..8253be8 100644
--- a/src/main/resources/templates/apph5/leavehistory.html
+++ b/src/main/resources/templates/apph5/leavehistory.html
@@ -253,7 +253,7 @@
</el-form>
<div slot="footer" style="text-align:center; ">
<el-button type="primary" @click="saveTemp('tempform')">查 询</el-button>
- <el-button type="primary" @click="closediv()">取 消</el-button>
+ <!--<el-button type="primary" @click="closediv()">取 消</el-button>-->
</div>
</el-dialog>
</div>
diff --git a/src/main/resources/templates/apph5/reviewclock.html b/src/main/resources/templates/apph5/reviewclock.html
new file mode 100644
index 0000000..f411658
--- /dev/null
+++ b/src/main/resources/templates/apph5/reviewclock.html
@@ -0,0 +1,546 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+
+<head>
+ <title>首页</title>
+ <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+ <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+ <meta charset="utf-8"/>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="/static/libs/layui/css/layui.css" th:href="@{/static/libs/layui/css/layui.css}"/>
+
+ <link rel="stylesheet" href="/static/res/assets/plugins/element-ui/theme-default/index.css"
+ th:href="@{/static/res/assets/plugins/element-ui/theme-default/index.css}"/>
+ <link rel="stylesheet" href="/static/res/assets/css/wxpage.css"
+ th:href="@{/static/res/assets/css/wxpage.css}"/>
+ <!--<script type="text/javascript" th:src="@{/static/libs/jquery/jquery-3.2.1.min.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+ <!--<script type="text/javascript" th:src="@{/static/libs/layui/layui.js}"></script>-->
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.form.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/js/vue.min.js}"></script>
+ <script type="text/javascript" th:src="@{/static/res/assets/plugins/element-ui/index.js}"></script>
+
+
+</head>
+
+<body>
+
+<div id="app2">
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">补打卡审核</div><br>
+
+ <el-button type="primary" @click="showdiv()" style="float: right">筛 选</el-button>
+
+
+ <div class="row">
+ <div class="col-md-12" style="padding-left: 0px;padding-right: 0px">
+ <div class="box box-primary" style="margin-bottom: 15px">
+ <div class="box-body box-profile">
+ <template>
+ <el-table
+ ref="singleTable"
+ :data="tableData"
+ highlight-current-row
+ @current-change="currRowChange"
+ stripe
+ border>
+ <el-table-column
+ prop="custid"
+ align="center"
+ v-show="false">
+ <template scope="scope">
+ <div class="weui-panel__bd">
+ <div class="weui-media-box weui-media-box_text">
+ <h4 class="weui-media-box__title" style="display: flex">
+ <div style="flex: 1">{{scope.row.custname}}</div>
+ <div>{{scope.row.deptname}}</div>
+ </h4>
+ <p class="weui-media-box__desc">
+ <div class="weui-cell__bd">
+ <span style="font-size:14px;color:#999; "></span>
+ </div>
+ <div style="display: flex;">
+
+ <div style="font-size:14px;color:#999;flex: 1">
+ 补打卡时间{{scope.row.attedate}}--{{scope.row.timename}}
+ </div>
+ <div style="font-size:14px;color:#999;margin-left:10px">
+ <span v-if="scope.row.status== '0'"><el-button
+ type="warning"
+ @click="editDtl(scope.row)">未审核</el-button></span>
+ <span v-if="scope.row.status== '1'"><el-button
+ type="success"
+ @click="editDtl(scope.row)">已通过</el-button></span>
+ <span v-if="scope.row.status== '2'"><el-button
+ type="success"
+ @click="editDtl(scope.row)">未通过</el-button></span>
+
+ </div>
+
+ </div>
+ </p>
+ </div>
+ </div>
+
+ </template>
+ </el-table-column>
+
+
+ </el-table>
+ <div class="clearfix"></div>
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="currPageChange"
+ :current-page="currPage"
+ :page-sizes="[10, 20, 50, 100]"
+ :page-size="pageSize"
+ layout="prev, pager, next,sizes, jumper,total"
+ :total="totSize">
+ </el-pagination>
+
+ </template>
+ </div>
+ </div>
+ </div>
+ </div>
+ <el-dialog :title="updatetitle2" :visible.sync="dialogFormVisible2" size="large"
+ :modal-append-to-body='false' @close="closeDialog('historyform')">
+ <el-form ref="historyform" class="el-form-item " :model="historyform"
+ :rules="rules" label-width="36%">
+ <el-form-item label="姓名:" prop="custname">
+ <el-col :span="18">
+ <el-input v-model="historyform.custname" readonly style="width: 90%;" maxlength="20">
+ </el-input>
+ </el-col>
+ </el-form-item>
+ <el-form-item label="人员类别:" prop="custtypename">
+ <el-col :span="18">
+ <el-input v-model="historyform.custtypename" readonly style="width: 90%;" maxlength="20">
+ </el-input>
+ </el-col>
+ </el-form-item>
+
+ <el-form-item label="状态:" prop="statusname">
+ <el-col :span="18">
+ <el-input v-model="historyform.statusname" readonly style="width: 90%;" maxlength="20">
+ </el-input>
+ </el-col>
+ </el-form-item>
+ <el-form-item label="备注:" prop="remark">
+ <el-col :span="18">
+ <el-input type="textarea" style="width: 90%;" v-model="historyform.remark" placeholder="填写备注"
+ readonly>
+ </el-input>
+ </el-col>
+ </el-form-item>
+
+
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <!--<el-button @click="resetForm('historyform') ">取 消</el-button>-->
+ <el-button type="primary" v-if="historyform.status== '0'" @click="review('historyform')">通过</el-button>
+ <el-button type="primary" v-if="historyform.status== '0'" @click="unreview('historyform')">不通过</el-button>
+
+
+ </div>
+ </el-dialog>
+ <el-dialog :title="updatetitle" :visible.sync="dialogFormVisible" style="width: 100%" :modal-append-to-body='false'
+ @close="closeDialog('tempform')" size="large">
+ <el-form ref="tempform" :model="tempform" data-parsley-validate
+ class="el-form-item" style="width: 100%">
+ <el-form-item prop="attedate">
+ <label slot="label">日 期:</label>
+ <div class="el-col el-col-17">
+ <div class="el-input" style="width: 90%;">
+ <el-date-picker type="date" v-model="tempform.attedate" id="time"
+ :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item prop="status">
+ <label slot="label">状 态:</label>
+ <div class="el-col el-col-17">
+ <div class="el-input" style="width: 90%;">
+ <el-select v-model="tempform.status" id="status">
+ <el-option
+ v-for="status in statuslist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="人员类型:" prop="custtype">
+ <div class="el-col el-col-17">
+ <div class="el-input" style="width: 90%;">
+ <el-select v-model="tempform.custtypeid" id="custtype">
+ <el-option
+ v-for="status in custtypelist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+
+ </el-form>
+ <div slot="footer" style="text-align:center; ">
+ <el-button type="primary" @click="saveTemp('tempform')">查 询</el-button>
+ </div>
+ </el-dialog>
+</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: '#app2',
+ data: {
+ tableData: [],
+ confName: '1234',
+ currPage: 1,
+ pageSize: 20,
+ totSize: 0,
+ currentRow: null,
+ tempform: {
+ attedate: '',
+ custtypeid: '',
+ status: '',
+ custid:''
+ },
+ historyform: {
+ custid: '',
+ custname: '',
+ startdate: '',
+ enddate: '',
+ remark: '',
+ rtype: '',
+ status: '',
+ custtype: '',
+ id: ''
+ },
+ sexlist: [],
+ rtypelist: [],
+ custtypelist: [],
+ statuslist: [],
+ bannerHeight: 1000,
+ screenWidth: 0,
+ userId: '',
+ dialogFormVisible: false,
+ dialogFormVisible2: false,
+ dlgAllotDevVisible: false,
+ updatetitle: '筛选',
+ updatetitle2: '详情',
+ rules: {
+ /*visitorname: [
+ {required: true, message: '请输入访客姓名', trigger: 'blur'},
+ ],
+ idno: [
+ {required: true, message: '请输入访客身份证号', trigger: 'blur'}
+ ],
+ sex: [
+ {required: true, message: '请输入访客性别', trigger: 'blur'}
+ ],
+ remarks: [
+ {required: true, message: '请输入备注', trigger: 'blur'}
+ ],
+ phone: [
+ {required: true, validator: validatePhone, trigger: 'blur'}
+ ]*/
+ },
+ },
+
+ methods: {
+ saveTemp: function (formName) {
+ var _that = this;
+ this.pagesize = 10;
+ this.currPage = 1;
+ if(this.tempform.attedate==''||this.tempform.attedate==undefined){
+ layer.msg("请选择日期!", {icon: 2, time: 2000});
+ return ;
+ }
+ this.dialogFormVisible = false;
+ commonQuery(this, this.currPage, this.pageSize);
+ },
+ resetForm:function(formName) {
+ this.$refs[formName].resetFields();
+ this.dialogFormVisible = false;
+ this.dialogFormVisible2 = false;
+ },
+ review: function (formName) {
+ this.dialogFormVisible2 = false;
+
+ var _that = this;
+ this.pagesize = 10;
+ this.currPage = 1;
+ reviewupdate(this, 1,this.historyform.id);
+
+ },unreview: function (formName) {
+ this.dialogFormVisible2 = false;
+
+ var _that = this;
+ this.pagesize = 10;
+ this.currPage = 1;
+ reviewupdate(this, 2,this.historyform.id);
+
+ },
+ showdiv: function (row) {
+ this.dialogFormVisible = true;
+ this.updatetitle = "筛选"
+ },
+ editDtl: function (row) {
+ dtl_getFillData(this, row);
+ this.dialogFormVisible2 = true;
+ this.updatetitle2 = "详情"
+ },
+ closediv: function () {
+ this.dialogFormVisible2 = true;
+
+ },
+ closeDialog:function(formName) {
+ // this.$refs[formName].resetFields();
+ this.dialogFormVisible = false
+ },
+ currRowChange: function (val) {
+ this.currentRow = val;
+ },
+ indexChange: function (pre, next) {
+ var _self = this;
+ var devIdListTmp = _self.devIdList;
+ _self.selectDevId = devIdListTmp[pre];
+ // console.log(_self.selectDevId)
+
+ },
+ setSize: function () {
+ // 通过浏览器宽度(图片宽度)计算高度
+ this.bannerHeight = this.screenWidth;
+ }, handleSizeChange: function (val) {
+ this.pageSize = val;
+ commonQuery(this,this.currPage, this.pageSize);
+ //console.log('每页条'+val);
+ }, currPageChange: function (val) {
+ this.currPage = val;
+ commonQuery(this, this.currPage, this.pageSize);
+ //console.log('当前页:'+val);
+ }
+
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+ var confid = '[[${custid}]]';
+ console.log(confid);
+ _self.tempform.custid = confid;
+
+ var statl = [];
+ statl.push({
+ value: '',
+ label: '请选择'
+ });
+ statl.push({
+ value: '0',
+ label: '未审核'
+ });
+ statl.push({
+ value: '1',
+ label: '已通过'
+ });
+ statl.push({
+ value: '2',
+ label: '未通过'
+ });
+
+
+ _self.statuslist = statl;
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: encodeURI("[[@{/app/atte/getcusttypelist}]]"),
+ success: function (ret) {
+
+ var custtypes=ret.custtypelist;
+ var custtypelist=[];
+ for (var i = 0; i < custtypes.length; i++) {
+ custtypelist.push({
+ value: custtypes[i].custtypeid,
+ label: custtypes[i].custtypename
+ });
+ }
+ _self.custtypelist=custtypelist;
+
+ }
+ })
+
+ }
+ })
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ app_vue.screenWidth = window.innerWidth;
+ app_vue.setSize();
+ }
+
+ function showsearchform() {
+ $("#sear").show();
+ }
+
+ function closesearchform() {
+ $("#sear").hide();
+ }
+
+ function dtl_getFillData(_self, row) {
+ _self.historyform.custname = row.custname;
+ _self.historyform.custtype = row.custtype;
+ _self.historyform.custtypename = row.custtypename;
+ _self.historyform.status = row.status;
+ _self.historyform.id = row.id;
+ if (row.status == "0") {
+ _self.historyform.statusname = "未审核"
+ } else if (row.status == "1") {
+ _self.historyform.statusname = "已通过"
+ } else if (row.status == "2") {
+ _self.historyform.statusname = "未通过"
+ } else if (row.status == "3") {
+ _self.historyform.statusname = "取消"
+ } else {
+ _self.historyform.statusname = "删除"
+ }
+
+ _self.historyform.remark = row.remark;
+ }
+ function class_Formatdate(date){
+ if(date==null||date==''){
+ return '';
+ }
+ var d=new Date(date);
+ var month=d.getMonth() + 1+'';
+ var date=d.getDate()+'';
+ if(month.length==1){
+ month='0'+month;
+ }
+ if(date.length==1){
+ date='0'+date;
+ }
+ var formated=d.getFullYear() + '' + month + '' +date;
+
+ return formated;
+ }
+ function saveTempCustomer(_that, formdata, formName) {
+ var token = $("meta[name='_csrf_token']").attr("value");
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/app/atte/getreviewlist}]]"),
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN': token,
+ },
+ data: JSON.stringify(formdata),
+ success: function (data) {
+
+ if (data.retcode != "0") {
+ layer.msg(data.retmsg, {icon: 2, time: 2000});
+ window.location = "[[@{/app/getapplyqrcode?visitorid=}]]" + data.visitorid;
+ } else {
+ layer.msg('登记成功!', {icon: 1, time: 1000});
+ }
+ }
+ });
+ }
+
+ function commonQuery(_self, pageno, pagesize) {
+ var attedate=class_Formatdate(_self.tempform.attedate);
+ var custtypeid=_self.tempform.custtypeid;
+ var status=_self.tempform.status;
+ var custid=_self.tempform.custid;
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: "[[@{/app/atte/getreviewclock?attedate=}]]" + attedate + "&custtypeid=" + custtypeid + "&status=" + status + "&custid=" + custid + "&pageNo=" + pageno + "&pageSize=" + pagesize,
+ success: function (info) {
+ console.log(info)
+
+ _self.tableData = info.page.list;
+ _self.totSize = info.page.totalCount;
+ }
+ })
+ }
+
+ function reviewupdate(_self, status,id) {
+ $.ajax({
+ type: "get",
+ dataType: "json",
+ url: "[[@{/app/atte/reviewclock?id=}]]" + id + "&status=" + status,
+ success: function (info) {
+ console.log(info)
+ if (info.errStr != "") {
+ layer.msg(info.errStr, {icon: 2, time: 2000});
+ } else {
+ layer.msg('审核成功!', {icon: 1, time: 1000});
+ }
+ commonQuery(_self,_self.currPage, _self.pageSize);
+
+ }
+ })
+ }
+
+ function isCellPhone(val) {
+ if (!/^1(3|4|5|6|7|8)\d{9}$/.test(val)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+
+</script>
+
+<style>
+
+ .el-carousel__item h3 {
+ color: #ff3366;
+ font-size: 14px;
+ opacity: 0.75;
+ line-height: 300px;
+ margin: 0;
+ /*background-color:#66cccc;
+ border: 0px solid #e5e5e5;
+ width: 50%;
+ left: 10%;
+ height: 100%;*/
+ }
+
+ .el-carousel__item:nth-child(2n) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item:nth-child(2n+1) {
+ background-color: #ffffff;
+ }
+
+ .el-carousel__item .Carousel {
+ border-bottom: 1px solid #f1f4f8;
+ }
+</style>
\ No newline at end of file
diff --git a/src/main/resources/templates/atte/app/index.html b/src/main/resources/templates/atte/app/index.html
index 2ed64f1..5318c23 100644
--- a/src/main/resources/templates/atte/app/index.html
+++ b/src/main/resources/templates/atte/app/index.html
@@ -49,6 +49,16 @@
</a>
</div>
+<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" th:href="@{'/app/atte/clockindex?custid='+${custid}}" >
+ <div class="weui-cell__bd">
+ <p>补打卡</p>
+ </div>
+ <div class="weui-cell__ft">
+ </div>
+ </a>
+
+</div>
@@ -59,42 +69,7 @@
$(function () {
});
- function add() {
- var custid=[[${custid}]];
- alert('ok');
- $.ajax({
- type: "get",
- url: "[[@{/app/atte/addindex?custid=}]]"+custid,
- dataType: "json",
- success: function (data) {
- }
- });
- }
- function search(){
- var custid=[[${custid}]];
- $.ajax({
- type: "get",
- url: "[[@{app/atte/searchindex?custid=}]]"+custid,
- dataType: "json",
- success: function (data) {
-
-
- }
- });
- }
- function review() {
- var custid=[[${custid}]];
- $.ajax({
- type: "get",
- url: "[[@{app/atte/reviewindex?custid=}]]"+custid,
- dataType: "json",
- success: function (data) {
-
-
- }
- });
- }
</script>
diff --git a/src/main/resources/templates/atte/app/re_index.html b/src/main/resources/templates/atte/app/re_index.html
index 3e838d7..3dd8f97 100644
--- a/src/main/resources/templates/atte/app/re_index.html
+++ b/src/main/resources/templates/atte/app/re_index.html
@@ -50,6 +50,16 @@
</div>
<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" th:href="@{'/app/atte/clockindex?custid='+${custid}}" >
+ <div class="weui-cell__bd">
+ <p>补打卡</p>
+ </div>
+ <div class="weui-cell__ft">
+ </div>
+ </a>
+
+</div>
+<div class="weui-cells">
<a class="weui-cell weui-cell_access" th:href="@{'/app/atte/reviewindex?custid='+${custid}}" >
<div class="weui-cell__bd">
<p>审核假条</p>
@@ -59,6 +69,16 @@
</a>
</div>
+<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" th:href="@{'/app/atte/reviewClock?custid='+${custid}}" >
+ <div class="weui-cell__bd">
+ <p>补打卡审核</p>
+ </div>
+ <div class="weui-cell__ft">
+ </div>
+ </a>
+
+</div>
</body>