大理 功能修改
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/AtteReport.java b/src/main/java/com/supwisdom/dlpay/atte/bean/AtteReport.java
index e5f2f3a..23e3623 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/bean/AtteReport.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/AtteReport.java
@@ -17,6 +17,9 @@
private float cnt4; //旷工
private float cnts;//
private float cnt5;//迟到或早退
+ private float cnt7;//补休
+ private float cnt8;//外出办案
+ private float cnt9;//出差
private String custtypename;
private String deptname;
@@ -123,4 +126,28 @@
public void setCnt5(float cnt5) {
this.cnt5 = cnt5;
}
+
+ public float getCnt7() {
+ return cnt7;
+ }
+
+ public void setCnt7(float cnt7) {
+ this.cnt7 = cnt7;
+ }
+
+ public float getCnt8() {
+ return cnt8;
+ }
+
+ public void setCnt8(float cnt8) {
+ this.cnt8 = cnt8;
+ }
+
+ public float getCnt9() {
+ return cnt9;
+ }
+
+ public void setCnt9(float cnt9) {
+ this.cnt9 = cnt9;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/AttedtlSearchBean.java b/src/main/java/com/supwisdom/dlpay/atte/bean/AttedtlSearchBean.java
index aba9081..c319093 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/bean/AttedtlSearchBean.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/AttedtlSearchBean.java
@@ -8,6 +8,7 @@
private String cardno;
private String deptcode;
private String devname;
+ private String dtcode;
public String getStartdate() {
return startdate;
@@ -64,4 +65,12 @@
public void setDevname(String devname) {
this.devname = devname;
}
+
+ public String getDtcode() {
+ return dtcode;
+ }
+
+ public void setDtcode(String dtcode) {
+ this.dtcode = dtcode;
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/ReportInfo.java b/src/main/java/com/supwisdom/dlpay/atte/bean/ReportInfo.java
new file mode 100644
index 0000000..4a59b23
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/ReportInfo.java
@@ -0,0 +1,67 @@
+package com.supwisdom.dlpay.atte.bean;
+
+public class ReportInfo {
+ private String custid;
+ private String attedate;
+ private Integer state;
+ private String custname;
+ private String deptcode;
+ private Integer apflag;
+ private Integer custtypeid;
+
+ 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 getState() {
+ return state;
+ }
+
+ public void setState(Integer state) {
+ this.state = state;
+ }
+
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+
+ public Integer getApflag() {
+ return apflag;
+ }
+
+ public void setApflag(Integer apflag) {
+ this.apflag = apflag;
+ }
+
+ public Integer getCusttypeid() {
+ return custtypeid;
+ }
+
+ public void setCusttypeid(Integer custtypeid) {
+ this.custtypeid = custtypeid;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/Sum.java b/src/main/java/com/supwisdom/dlpay/atte/bean/Sum.java
index 254ca65..a28dd5a 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/bean/Sum.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/Sum.java
@@ -7,6 +7,9 @@
private float cnt4;
private float cnts;
private float cnt5;
+ private float cnt7;
+ private float cnt8;
+ private float cnt9;
public Sum() {
this.cnt1=0;
@@ -15,6 +18,9 @@
this.cnt4=0;
this.cnts=0;
this.cnt5=0;
+ this.cnt7=0;
+ this.cnt8=0;
+ this.cnt9=0;
}
public float getCnt1() {
@@ -64,4 +70,28 @@
public void setCnt5(float cnt5) {
this.cnt5 = cnt5;
}
+
+ public float getCnt7() {
+ return cnt7;
+ }
+
+ public void setCnt7(float cnt7) {
+ this.cnt7 = cnt7;
+ }
+
+ public float getCnt8() {
+ return cnt8;
+ }
+
+ public void setCnt8(float cnt8) {
+ this.cnt8 = cnt8;
+ }
+
+ public float getCnt9() {
+ return cnt9;
+ }
+
+ public void setCnt9(float cnt9) {
+ this.cnt9 = cnt9;
+ }
}
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 d6f55b9..ac936d7 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
@@ -6,6 +6,7 @@
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.AtteReportService;
import com.supwisdom.dlpay.atte.service.AtteRestService;
import com.supwisdom.dlpay.customer.bean.CustomerSearchBean;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
@@ -40,6 +41,8 @@
private WebInterfaceService webInterfaceService;
@Autowired
private AtteClassService atteClassService;
+ @Autowired
+ private AtteReportService atteReportService;
/**
* 菜单
* @param
@@ -212,7 +215,10 @@
rest.setStatus(status);
atteRestService.updateAtteRest(rest);
if(status==1){
+ //修改考勤状态
atteClassService.updateRestDtl(rest.getStartdate(),rest.getEnddate(),rest.getCustid(),rest.getRtype());
+ //修改报表
+ atteReportService.updateReport(rest.getStartdate(),rest.getEnddate(),rest.getCustid());
}
map.put("errStr","");
}else {
@@ -393,6 +399,8 @@
atteRestService.updateClock(clock);
if(status==1){
atteRestService.updateAtteDtl(clock.getCustid(),clock.getAttedate(),clock.getTimeid(),clock.getRemark());
+
+ atteReportService.updateReport(clock.getAttedate(),clock.getAttedate(),clock.getCustid());
}
map.put("errStr","");
}else {
@@ -408,4 +416,21 @@
}
+ /**
+ * 外出申请页面
+ */
+ @RequestMapping("/atte/askoutindex")
+ public String askoutindex(@RequestParam(value = "custid") String custid, Model model) {
+ model.addAttribute("custid", custid);
+ return "apph5/askforout";
+ }
+
+
+ @RequestMapping("/refreshattereport")
+ public String refresh(@RequestParam(value = "startdate") String startdate,
+ @RequestParam(value = "enddate") String enddate,Model model) {
+ atteReportService.refreshReport(null,startdate,enddate);
+ return "1";
+ }
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java b/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
index b6c9631..805bead 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
@@ -4,11 +4,9 @@
import com.supwisdom.dlpay.atte.bean.AttedtlSearchBean;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
import com.supwisdom.dlpay.atte.bean.Sum;
+import com.supwisdom.dlpay.atte.dao.AtteReportDao;
import com.supwisdom.dlpay.atte.domain.*;
-import com.supwisdom.dlpay.atte.service.AtteClassService;
-import com.supwisdom.dlpay.atte.service.AtteRestService;
-import com.supwisdom.dlpay.atte.service.CustseaService;
-import com.supwisdom.dlpay.atte.service.SeasonService;
+import com.supwisdom.dlpay.atte.service.*;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.domain.TOperator;
import com.supwisdom.dlpay.framework.service.SystemUtilService;
@@ -64,6 +62,8 @@
private ManagerService managerService;
@Autowired
private AtteRestService atteRestService;
+ @Autowired
+ private AtteReportService atteReportService;
@GetMapping("/rule/index")
public String seasonindex(){
@@ -647,6 +647,8 @@
}
}
atteClassService.addBatchDtl(startdate,enddate,deptcode);
+ String sdate=startdate;
+ String edate=enddate;
Integer start=Integer.parseInt(startdate);
Integer end=Integer.parseInt(enddate);
while (start<=end){
@@ -654,6 +656,7 @@
startdate= DateUtil.getNewDay(startdate,1);
start=Integer.parseInt(startdate);
}
+ atteReportService.refreshReport(deptcode,sdate,edate);
return map;
}
@@ -793,6 +796,8 @@
dtl.setState(state);
dtl.setRemark(remark);
atteClassService.updateAtteDtl(dtl);
+ //修改报表
+ atteReportService.updateReport(dtl.getAttedate(),dtl.getAttedate(),dtl.getCustid());
map.put("errStr","");
} catch (Exception e) {
e.printStackTrace();
@@ -1019,6 +1024,9 @@
sum.setCnt4(sum.getCnt4()+report.getCnt4());
sum.setCnts(sum.getCnts()+report.getCnts());
sum.setCnt5(sum.getCnt5()+report.getCnt5());
+ sum.setCnt7(sum.getCnt7()+report.getCnt7());
+ sum.setCnt8(sum.getCnt8()+report.getCnt8());
+ sum.setCnt9(sum.getCnt9()+report.getCnt9());
}
map.addAttribute("sum",sum);
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/AtteReportDao.java b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteReportDao.java
new file mode 100644
index 0000000..cd422d3
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/AtteReportDao.java
@@ -0,0 +1,22 @@
+package com.supwisdom.dlpay.atte.dao;
+
+import com.supwisdom.dlpay.atte.bean.ReportInfo;
+import com.supwisdom.dlpay.atte.domain.TAtteReport;
+import org.apache.poi.ss.formula.functions.T;
+
+import java.util.List;
+
+public interface AtteReportDao {
+
+ public boolean delAtteReport(String attedate,String deptcode);
+
+ public boolean addReport(TAtteReport bean);
+
+ public TAtteReport findReportById(String custid,String attedate,Integer apflag);
+
+ public List<ReportInfo> getreportfromView(String deptcode,String attedate);
+
+ public List<ReportInfo> getfromView(String deptcode,String attedate,String custid);
+
+ public boolean updateReport(TAtteReport bean);
+}
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 eba37a7..97781e0 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
@@ -296,6 +296,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql.append(" and c.deptcode = :dcode ");
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql.append(" and c.deptcode = :dtcode ");
+ }
sql.append(" order by t.atteno desc ");
Query query=entityManager.createNativeQuery(sql.toString(), AtteDetailInfo.class);
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
@@ -314,6 +317,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
query.setParameter("dcode",searchBean.getDeptcode());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
pageNo = pageNo <= 0 ? 1 : pageNo;
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
@@ -348,6 +354,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql.append(" and c.deptcode = :dcode");
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql.append(" and c.deptcode = :dtcode ");
+ }
Query query=entityManager.createNativeQuery(sql.toString());
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
query.setParameter("sdate",searchBean.getStartdate());
@@ -365,6 +374,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
query.setParameter("dcode",searchBean.getDeptcode());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
Object object=query.getSingleResult();
if(object!=null){
result= Integer.parseInt(object.toString());
@@ -444,6 +456,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql+=" and c.deptcode = :dcode ";
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql+=" and c.deptcode = :dtcode ";
+ }
if(!StringUtil.isEmpty(searchBean.getDevname())){
sql+=" and d.devname like :dname";
}
@@ -471,6 +486,9 @@
if(!StringUtil.isEmpty(searchBean.getCardno())){
query.setParameter("cno",searchBean.getCardno());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
pageNo = pageNo <= 0 ? 1 : pageNo;
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
@@ -499,6 +517,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql+=" and c.deptcode = :dcode ";
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql+=" and c.deptcode = :dtcode ";
+ }
if(!StringUtil.isEmpty(searchBean.getDevname())){
sql+=" and d.devname like :dname";
}
@@ -526,6 +547,9 @@
if(!StringUtil.isEmpty(searchBean.getCardno())){
query.setParameter("cno",searchBean.getCardno());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
List<AtteDtl> list=query.getResultList();
if(list!=null){
return list.size();
@@ -533,6 +557,7 @@
return 0;
}
+ @Transactional
@Override
public boolean delAtteDtl(String attedate, String deptcode) {
if(!StringUtil.isEmpty(attedate)){
@@ -674,7 +699,7 @@
@Override
public Pagination getPReportWithPage(AttedtlSearchBean searchBean, int pageNo, int pageSize) {
StringBuffer sql=new StringBuffer();
- sql.append(" with a as ( select v.*,c.cardno,ct.custtypename,d.deptname from v_atte_info v left join t_card c on v. custid=c.custid left join tb_custtype ct on v.custtypeid=ct.custtypeid left join tb_dept d on v.deptcode=d.deptcode ")
+ sql.append(" with a as ( select v.*,c.cardno,ct.custtypename,d.deptname from t_atte_report v left join t_card c on v. custid=c.custid left join tb_custtype ct on v.custtypeid=ct.custtypeid left join tb_dept d on v.deptcode=d.deptcode ")
.append(" where c.status='normal' and c.transtatus='normal' ");
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
sql.append(" and v.attedate between :sdate and :edate ");
@@ -688,6 +713,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql.append(" and v.deptcode = :dcode ");
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql.append(" and v.deptcode = :dtcode ");
+ }
if(!StringUtil.isEmpty(searchBean.getCardno())){
sql.append(" and c.cardno like :cno ");
}
@@ -696,7 +724,10 @@
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=1) cnt1,")
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=2) cnt2,")
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=3) cnt3,")
- .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=0) cnt4 ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=0) cnt4, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=7) cnt7, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=8) cnt8, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=9) cnt9 ")
.append(" from a group by a.custname,a.cardno,a.custtypeid,a.deptcode,a.custid,a.deptname,a.custtypename ")
.append(" order by a.deptcode desc ,a.custtypeid desc ");
Query query=entityManager.createNativeQuery(sql.toString(), AtteReport.class);
@@ -716,6 +747,9 @@
if(!StringUtil.isEmpty(searchBean.getCardno())){
query.setParameter("cno",searchBean.getCardno());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
pageNo = pageNo <= 0 ? 1 : pageNo;
query.setFirstResult((pageNo - 1) * pageSize);
query.setMaxResults(pageSize);
@@ -745,6 +779,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql.append(" and v.deptcode = :dcode ");
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql.append(" and v.deptcode = :dtcode ");
+ }
if(!StringUtil.isEmpty(searchBean.getCardno())){
sql.append(" and c.cardno like :cno ");
}
@@ -767,6 +804,9 @@
if(!StringUtil.isEmpty(searchBean.getCardno())){
query.setParameter("cno",searchBean.getCardno());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
int result=0;
Object object=query.getSingleResult();
if(object!=null){
@@ -778,7 +818,7 @@
@Override
public List<AtteReport> getPReportList(AttedtlSearchBean searchBean) {
StringBuffer sql=new StringBuffer();
- sql.append(" with a as ( select v.*,c.cardno,ct.custtypename,d.deptname from v_atte_info v left join t_card c on v. custid=c.custid left join tb_custtype ct on v.custtypeid=ct.custtypeid left join tb_dept d on v.deptcode=d.deptcode ")
+ sql.append(" with a as ( select v.*,c.cardno,ct.custtypename,d.deptname from t_atte_report v left join t_card c on v. custid=c.custid left join tb_custtype ct on v.custtypeid=ct.custtypeid left join tb_dept d on v.deptcode=d.deptcode ")
.append(" where c.status='normal' and c.transtatus='normal' ");
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
sql.append(" and v.attedate between :sdate and :edate ");
@@ -792,6 +832,9 @@
if(!StringUtil.isEmpty(searchBean.getDeptcode())){
sql.append(" and v.deptcode = :dcode ");
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ sql.append(" and v.deptcode = :dtcode ");
+ }
if(!StringUtil.isEmpty(searchBean.getCardno())){
sql.append(" and c.cardno like :cno ");
}
@@ -800,7 +843,10 @@
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=1) cnt1,")
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=2) cnt2,")
.append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=3) cnt3,")
- .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=0) cnt4 ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=0) cnt4, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=7) cnt7, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=8) cnt8, ")
+ .append(" (select count(*)/2.0 from a aa where aa.custid=a.custid and aa.state=9) cnt9 ")
.append(" from a group by a.custname,a.cardno,a.custtypeid,a.deptcode,a.custid,a.custtypename,a.deptname ")
.append(" order by a.deptcode desc ,a.custtypeid desc ");
Query query=entityManager.createNativeQuery(sql.toString(), AtteReport.class);
@@ -821,6 +867,9 @@
if(!StringUtil.isEmpty(searchBean.getCardno())){
query.setParameter("cno",searchBean.getCardno());
}
+ if(!StringUtil.isEmpty(searchBean.getDtcode())){
+ query.setParameter("dtcode",searchBean.getDtcode());
+ }
List<AtteReport> list=query.getResultList();
return list;
}
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
index 4726afa..bb3e0dd 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClockDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteClockDaoImpl.java
@@ -94,6 +94,7 @@
if(searchBean.getCusttypeid()!=null){
sql.append(" and ct.custtypeid=:ctypeid ");
}
+ sql.append(" order by t.attedate desc ");
Query query=entityManager.createNativeQuery(sql.toString());
if(!StringUtil.isEmpty(searchBean.getAttedate())){
query.setParameter("adate",searchBean.getAttedate());
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteReportDaoImpl.java b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteReportDaoImpl.java
new file mode 100644
index 0000000..7a18ef3
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteReportDaoImpl.java
@@ -0,0 +1,136 @@
+package com.supwisdom.dlpay.atte.dao.impl;
+
+import com.supwisdom.dlpay.atte.bean.ReportInfo;
+import com.supwisdom.dlpay.atte.dao.AtteReportDao;
+import com.supwisdom.dlpay.atte.domain.TAtteReport;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import org.hibernate.query.internal.NativeQueryImpl;
+import org.hibernate.transform.Transformers;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+@Service
+public class AtteReportDaoImpl implements AtteReportDao {
+ @PersistenceContext
+ EntityManager entityManager;
+
+
+ @Transactional
+ @Override
+ public boolean delAtteReport(String attedate, String deptcode) {
+ if(!StringUtil.isEmpty(attedate)){
+ String sql=" delete from t_atte_report t where t.attedate=:adate ";
+ if(!StringUtil.isEmpty(deptcode)){
+ sql+=" and t.custid in (select c.custid from t_customer c where c.deptcode = :dcode )";
+ }
+ try {
+ Query query=entityManager.createNativeQuery(sql);
+ if(!StringUtil.isEmpty(deptcode)){
+ query.setParameter("dcode",deptcode);
+ }
+ query.setParameter("adate",attedate);
+ query.executeUpdate();
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ @Transactional
+ @Override
+ public boolean addReport(TAtteReport bean) {
+ boolean flag=false;
+ try {
+ entityManager.persist(bean);
+ flag=true;
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ return flag;
+ }
+
+
+ @Override
+ public TAtteReport findReportById(String custid, String attedate, Integer apflag) {
+ if(StringUtil.isEmpty(custid)||StringUtil.isEmpty(attedate)||apflag==null){
+ return null;
+ }
+ String sql=" select bean from TAtteReport bean where bean.id.custid = :cid and bean.id.attedate = :adate and bean.id.apflag = :aflag ";
+ TypedQuery<TAtteReport> query=entityManager.createQuery(sql,TAtteReport.class);
+ query.setParameter("cid",custid);
+ query.setParameter("adate",attedate);
+ query.setParameter("aflag",apflag);
+ List<TAtteReport> list=query.getResultList();
+ if(list!=null&&list.size()>0){
+ return list.get(0);
+ }
+ return null;
+ }
+
+ @Override
+ public List<ReportInfo> getreportfromView(String deptcode, String attedate) {
+ if(StringUtil.isEmpty(attedate)){
+ return null;
+ }
+ String sql=" select v.* from v_atte_info v where v.attedate = :adate ";
+ if(!StringUtil.isEmpty(deptcode)){
+ sql+=" and v.custid in ( select c.custid from t_customer c where c.deptcode = :dcode ) ";
+ }
+ Query query=entityManager.createNativeQuery(sql);
+ query.setParameter("adate",attedate);
+ if(!StringUtil.isEmpty(deptcode)){
+ query.setParameter("dcode",deptcode);
+ }
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(ReportInfo.class));
+ List<ReportInfo> list=query.getResultList();
+ return list;
+ }
+
+
+ @Override
+ public List<ReportInfo> getfromView(String deptcode, String attedate, String custid) {
+ if(StringUtil.isEmpty(attedate)){
+ return null;
+ }
+ String sql=" select v.* from v_atte_info v where v.attedate = :adate ";
+ if(!StringUtil.isEmpty(deptcode)){
+ sql+=" and v.custid in ( select c.custid from t_customer c where c.deptcode = :dcode ) ";
+ }
+ if(!StringUtil.isEmpty(custid)){
+ sql+=" and v.custid = :cid ";
+ }
+ Query query=entityManager.createNativeQuery(sql);
+ query.setParameter("adate",attedate);
+ if(!StringUtil.isEmpty(deptcode)){
+ query.setParameter("dcode",deptcode);
+ }
+ if(!StringUtil.isEmpty(custid)){
+ query.setParameter("cid",custid);
+ }
+ query.unwrap(NativeQueryImpl.class).setResultTransformer(Transformers.aliasToBean(ReportInfo.class));
+ List<ReportInfo> list=query.getResultList();
+ return list;
+ }
+
+ @Transactional
+ @Override
+ public boolean updateReport(TAtteReport bean) {
+ boolean flag=false;
+
+ try {
+ entityManager.merge(bean);
+ flag=true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return flag;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/domain/TAReportId.java b/src/main/java/com/supwisdom/dlpay/atte/domain/TAReportId.java
new file mode 100644
index 0000000..a9032b1
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/domain/TAReportId.java
@@ -0,0 +1,37 @@
+package com.supwisdom.dlpay.atte.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import java.io.Serializable;
+
+@Embeddable
+public class TAReportId implements Serializable {
+ private String custid;
+ private String attedate;
+ private Integer apflag;
+
+ @Column(name = "custid", nullable = false, length = 32)
+ public String getCustid() {
+ return custid;
+ }
+
+ public void setCustid(String custid) {
+ this.custid = custid;
+ }
+ @Column(name = "attedate", nullable = false, length = 8)
+ public String getAttedate() {
+ return attedate;
+ }
+
+ public void setAttedate(String attedate) {
+ this.attedate = attedate;
+ }
+ @Column(name = "apflag",nullable = false,precision = 4, scale = 0)
+ public Integer getApflag() {
+ return apflag;
+ }
+
+ public void setApflag(Integer apflag) {
+ this.apflag = apflag;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteReport.java b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteReport.java
new file mode 100644
index 0000000..6462e77
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteReport.java
@@ -0,0 +1,61 @@
+package com.supwisdom.dlpay.atte.domain;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "t_atte_report",
+ indexes = {@Index(name = "idx_ar_custid", columnList = "custid"),
+ @Index(name="idx_ar_attedate",columnList = "attedate"),
+ @Index(name="idx_ar_apflag",columnList = "apflag")})
+public class TAtteReport {
+ private TAReportId id;
+ private Integer state;
+ private String custname;
+ private String deptcode;
+ private Integer custtypeid;
+
+ @EmbeddedId
+ @AttributeOverrides({
+ @AttributeOverride(name = "custid", column = @Column(name = "custid", nullable = false, length = 32)),
+ @AttributeOverride(name = "attedate", column = @Column(name = "attedate", nullable = false, length = 8)),
+ @AttributeOverride(name = "apflag", column = @Column(name = "apflag", nullable = false, precision = 4, scale = 0)) })
+ public TAReportId getId() {
+ return id;
+ }
+
+ public void setId(TAReportId id) {
+ this.id = id;
+ }
+ @Column(name = "state",precision = 4, scale = 0)
+ public Integer getState() {
+ return state;
+ }
+
+ public void setState(Integer state) {
+ this.state = state;
+ }
+ @Column(name = "custname", length = 64)
+ public String getCustname() {
+ return custname;
+ }
+
+ public void setCustname(String custname) {
+ this.custname = custname;
+ }
+ @Column(name = "deptcode", length = 64)
+ public String getDeptcode() {
+ return deptcode;
+ }
+
+ public void setDeptcode(String deptcode) {
+ this.deptcode = deptcode;
+ }
+ @Column(name = "custtypeid",precision = 9, scale = 0)
+ public Integer getCusttypeid() {
+ return custtypeid;
+ }
+
+ public void setCusttypeid(Integer custtypeid) {
+ this.custtypeid = custtypeid;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/service/AtteReportService.java b/src/main/java/com/supwisdom/dlpay/atte/service/AtteReportService.java
new file mode 100644
index 0000000..2bbb8ef
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/service/AtteReportService.java
@@ -0,0 +1,29 @@
+package com.supwisdom.dlpay.atte.service;
+
+import com.supwisdom.dlpay.atte.bean.ReportInfo;
+import com.supwisdom.dlpay.atte.domain.TAtteReport;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+public interface AtteReportService {
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean delAtteReport(String attedate,String deptcode);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean addReport(TAtteReport bean);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public TAtteReport findReportById(String custid,String attedate,Integer apflag);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public List<ReportInfo> getreportfromView(String deptcode, String attedate);
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean refreshReport(String deptcode,String startdate,String enddate);
+
+
+ @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class})
+ public boolean updateReport(String startdate,String enddate,String custid);
+}
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 123a115..e330734 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
@@ -9,7 +9,9 @@
import com.supwisdom.dlpay.atte.service.AtteClassService;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
import com.supwisdom.dlpay.framework.dao.BusinessparaDao;
+import com.supwisdom.dlpay.framework.dao.SysparaDao;
import com.supwisdom.dlpay.framework.domain.TBusinesspara;
+import com.supwisdom.dlpay.framework.domain.TSyspara;
import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.mainservice.dao.CustomerDao;
@@ -55,6 +57,7 @@
@Autowired
AtteClockDao atteClockDao;
+
@Override
public Pagination getClassWithPage(String classname,String deptcode, int pageNo, int pageSize) {
return atteClassDao.getClassWithPage(classname,deptcode,pageNo,pageSize);
@@ -225,7 +228,12 @@
dtl.setUpdatetime(DateUtil.getNow());
TNcTime time=ncTimeDao.findByTimeId(timeid);
String etime=time.getEtime().replace(":","")+"00";
- int diff=getDiffMin("130000",etime);
+ String divtime="130000";
+ TBusinesspara para=businessparaDao.findByParakey("divtime");
+ if(para!=null&&!StringUtil.isEmpty(para.getParaval())){
+ divtime=para.getParaval();
+ }
+ int diff=getDiffMin(divtime,etime);
if(diff>0){
dtl.setApflag(2);
}else{
@@ -362,7 +370,11 @@
}
int state= 0;
try {
- state = getState(detail.getTimeid(),dtl.getAttetime(),nextid);
+ if(details.size()==4){
+ state = getState(detail.getTimeid(),dtl.getAttetime(),nextid);
+ }else if(details.size()==2){
+ state = getStateNew(detail.getTimeid(),dtl.getAttetime());
+ }
} catch (Exception e) {
System.out.println(detail.getTimeid()+"=nextid:"+nextid);
System.out.println(dtl.getAttetime());
@@ -446,6 +458,53 @@
return flag;
}
+ public int getStateNew(Integer timeid,String attetime){
+ int flag=0;
+ TNcTime time=ncTimeDao.findByTimeId(timeid);
+ if(time==null){
+ return flag;
+ }
+ String btime=time.getBtime().replace(":","")+"00";
+ String etime=time.getEtime().replace(":","")+"00";
+ int bmin=getDiffMin(attetime,btime);
+ int emin=getDiffMin(attetime,etime);
+ int d_min=0;
+ String divtime="130000";
+ TBusinesspara para=businessparaDao.findByParakey("divtime");
+ if(para!=null&&!StringUtil.isEmpty(para.getParaval())){
+ divtime=para.getParaval();
+ }
+ d_min=getDiffMin(attetime,divtime);
+ if(time.getTimetype()==1){ //考到
+
+ if(d_min>0){
+ if(bmin<=0&&emin>=0){
+ flag=1;
+ }else{
+ flag=2;
+ }
+ }
+
+ }else if(time.getTimetype()==2){ //考离
+ if(d_min<=0){
+ if(bmin<=0&&emin>=0){
+ flag=1;
+ }else{
+ flag=2;
+ }
+ }
+
+ }else{
+
+ if(bmin<0&&emin>0){
+ flag=1;
+ }else{
+ flag=0;
+ }
+ }
+ return flag;
+ }
+
@Override
public List<TCustomerInfo> getReviewList(String deptcode) {
return atteClassDao.getReviewList(deptcode);
diff --git a/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteReportServiceImpl.java b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteReportServiceImpl.java
new file mode 100644
index 0000000..b9b3c4f
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/service/impl/AtteReportServiceImpl.java
@@ -0,0 +1,105 @@
+package com.supwisdom.dlpay.atte.service.impl;
+
+import com.supwisdom.dlpay.atte.bean.ReportInfo;
+import com.supwisdom.dlpay.atte.dao.AtteReportDao;
+import com.supwisdom.dlpay.atte.domain.TAReportId;
+import com.supwisdom.dlpay.atte.domain.TAtteReport;
+import com.supwisdom.dlpay.atte.service.AtteReportService;
+import com.supwisdom.dlpay.framework.util.DateUtil;
+import com.supwisdom.dlpay.framework.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class AtteReportServiceImpl implements AtteReportService {
+ @Autowired
+ private AtteReportDao atteReportDao;
+
+ @Override
+ public boolean delAtteReport(String attedate, String deptcode) {
+ return atteReportDao.delAtteReport(attedate,deptcode);
+ }
+
+ @Override
+ public boolean addReport(TAtteReport bean) {
+ return atteReportDao.addReport(bean);
+ }
+
+ @Override
+ public TAtteReport findReportById(String custid, String attedate, Integer apflag) {
+ return atteReportDao.findReportById(custid,attedate,apflag);
+ }
+
+ @Override
+ public List<ReportInfo> getreportfromView(String deptcode, String attedate) {
+ return atteReportDao.getreportfromView(deptcode,attedate);
+ }
+
+ @Override
+ public boolean refreshReport(String deptcode, String startdate, String enddate) {
+ if(StringUtil.isEmpty(startdate)||StringUtil.isEmpty(enddate)){
+ return false;
+ }
+ Integer start=Integer.parseInt(startdate);
+ Integer end=Integer.parseInt(enddate);
+ while (start<=end){
+ //
+ atteReportDao.delAtteReport(startdate,deptcode);
+
+ List<ReportInfo> list=atteReportDao.getreportfromView(deptcode,startdate);
+ if(list!=null&&list.size()>0){
+ for(ReportInfo info:list){
+ System.out.println(info.getCustid()+" "+info.getAttedate()+" "+info.getApflag());
+ TAtteReport report=atteReportDao.findReportById(info.getCustid(),info.getAttedate(),info.getApflag());
+ if(report==null){
+ report=new TAtteReport();
+ TAReportId id=new TAReportId();
+ id.setCustid(info.getCustid());
+ id.setAttedate(info.getAttedate());
+ id.setApflag(info.getApflag());
+ report.setId(id);
+ report.setCustname(info.getCustname());
+ report.setDeptcode(info.getDeptcode());
+ report.setState(info.getState());
+ report.setCusttypeid(info.getCusttypeid());
+ atteReportDao.addReport(report);
+ }
+ }
+ }
+
+
+ startdate= DateUtil.getNewDay(startdate,1);
+ start=Integer.parseInt(startdate);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean updateReport(String startdate, String enddate, String custid) {
+ if(StringUtil.isEmpty(startdate)||StringUtil.isEmpty(enddate)||StringUtil.isEmpty(custid)){
+ return false;
+ }
+ Integer start=Integer.parseInt(startdate);
+ Integer end=Integer.parseInt(enddate);
+ while (start<=end){
+ //查视图信息
+ List<ReportInfo> list=atteReportDao.getfromView(null,startdate,custid);
+ if(list!=null&&list.size()>0){
+ for(ReportInfo info:list){
+ TAtteReport report=atteReportDao.findReportById(info.getCustid(),info.getAttedate(),info.getApflag());
+ if(report!=null){
+ report.setState(info.getState());
+ atteReportDao.updateReport(report);
+ }
+ }
+ }
+
+
+ startdate= DateUtil.getNewDay(startdate,1);
+ start=Integer.parseInt(startdate);
+ }
+ return true;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/task/CreateAtteDtlTask.java b/src/main/java/com/supwisdom/dlpay/atte/task/CreateAtteDtlTask.java
index 626b098..0801656 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/task/CreateAtteDtlTask.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/task/CreateAtteDtlTask.java
@@ -1,6 +1,7 @@
package com.supwisdom.dlpay.atte.task;
import com.supwisdom.dlpay.atte.service.AtteClassService;
+import com.supwisdom.dlpay.atte.service.AtteReportService;
import com.supwisdom.dlpay.framework.util.DateUtil;
import com.supwisdom.dlpay.task.SyncCustomerTask;
import org.slf4j.Logger;
@@ -20,6 +21,8 @@
protected static Logger logger = LoggerFactory.getLogger(CreateAtteDtlTask.class);
@Autowired
AtteClassService atteClassService;
+ @Autowired
+ AtteReportService atteReportService;
@Override
public void run(ApplicationArguments args) throws Exception {
@@ -50,4 +53,23 @@
e.printStackTrace();
}
}
+
+ @Scheduled(cron = "${atte.create.dtl}")//每天一点生成前一天报表
+ public void createAtteReport(){
+
+ String attedate= null;
+ try {
+ String now = DateUtil.getNow();
+ logger.info("时间:" + now + "--生成前一天考勤报表");
+ String cdate=DateUtil.getNow("yyyyMMdd");
+ attedate=DateUtil.getNewDay(cdate,-1);
+ atteReportService.refreshReport(null,attedate,attedate);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args) {
+ System.out.println(DateUtil.getNewDay("20200617",-1));
+ }
}
diff --git a/src/main/resources/templates/apph5/askforleave.html b/src/main/resources/templates/apph5/askforleave.html
index 1a6dcd7..6c451d9 100644
--- a/src/main/resources/templates/apph5/askforleave.html
+++ b/src/main/resources/templates/apph5/askforleave.html
@@ -195,6 +195,10 @@
label: '调休'
});
sexl.push({
+ value: '7',
+ label: '补休'
+ });
+ sexl.push({
value: '15',
label: '其他'
});
diff --git a/src/main/resources/templates/apph5/askforout.html b/src/main/resources/templates/apph5/askforout.html
new file mode 100644
index 0000000..32cea98
--- /dev/null
+++ b/src/main/resources/templates/apph5/askforout.html
@@ -0,0 +1,287 @@
+<!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="app_out">
+ <div class="page-title" style="text-align:center; font-size: 24px;color: #FF8247;margin-top:7%">外出申请</div>
+ <br>
+
+ <el-form ref="outtempform" :model="outtempform" :rules="rules" size="mini" label-width="36%" style="margin-top:7%">
+ <el-form-item label="申请类型:" prop="rtype">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-select v-model="outtempform.rtype" id="rtype">
+ <el-option
+ v-for="status in rtypelist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="开始时间:" prop="startdate">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-date-picker type="date" v-model="outtempform.startdate" id="time"
+ :picker-options="pickerOptions0" :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+ <el-form-item label="结束时间:" prop="enddate">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-date-picker type="date" v-model="outtempform.enddate" id="time"
+ :picker-options="pickerOptions1" :editable="false"
+ value-format="yyyyMMdd"
+ style="width:100%;"></el-date-picker>
+ </div>
+ </div>
+ </el-form-item>
+
+
+ <el-form-item label="备注:" prop="remark">
+ <div class="el-col el-col-18">
+ <div class="el-input" style="width: 187px;">
+ <el-input v-model="outtempform.remark">
+ </el-input>
+ </div>
+ </div>
+ </el-form-item>
+
+ </el-form>
+ <div slot="footer" style="text-align:center; ">
+ <el-button type="primary" @click="saveTemp('outtempform')">申 请</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 askout_app_vue = new Vue({
+ el: '#app_out',
+ data: {
+ dialogFormVisible: true,
+ outtempform: {
+ rtype: '',
+
+ startdate: '',
+ enddate: '',
+
+ custid: '',
+
+ remark: '',
+ },
+ rtypelist: [],
+ bannerHeight: 1000,
+ screenWidth: 0,
+ userId: '',
+ pickerOptions0: {
+ disabledDate: function (time) {
+ return false;
+ }
+ },pickerOptions1: {
+ disabledDate:function(time) {
+ if(askout_app_vue.outtempform.startdate !=''){
+
+ return time.getTime() < askout_app_vue.outtempform.startdate.getTime();
+ }else {
+ return time.getTime() > Date.now();
+ }
+ }
+ },
+ rules: {
+ rtype: [
+ {required: true, message: '请选择请假类型', trigger: 'blur'},
+ ],
+ remark: [
+ {required: true, message: '请输入备注', 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, formName);
+ }
+ },
+
+ 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;
+ },
+ },
+ created: function () {
+ var _self = this;
+ // 首次加载时,需要调用一次
+ _self.screenWidth = window.innerWidth;
+ _self.setSize();
+ var confid = '[[${custid}]]';
+ console.log(confid);
+ _self.outtempform.custid = confid;
+ var sexl = [];
+ sexl.push({
+ value: '',
+ label: '请选择'
+ });
+ sexl.push({
+ value: '8',
+ label: '外出办案'
+ });sexl.push({
+ value: '9',
+ label: '出差'
+ });
+ _self.rtypelist = sexl;
+
+ }
+ })
+
+ // 窗口大小发生改变时,调用一次
+ window.onresize = function () {
+ askout_app_vue.screenWidth = window.innerWidth;
+ askout_app_vue.setSize();
+ }
+
+ function saveTempCustomer(_that, that, formName) {
+ var token = $("meta[name='_csrf_token']").attr("value");
+ console.log(that.outtempform.startdate)
+ console.log(that.outtempform.enddate)
+ var startdate=class_Formatdate(that.outtempform.startdate);
+ var enddate=class_Formatdate(that.outtempform.enddate);
+ var rtype=that.outtempform.rtype;
+ var remark=that.outtempform.remark;
+ var custid=that.outtempform.custid;
+ $.ajax({
+ type: "post",
+ url: encodeURI("[[@{/app/atte/savetempcust?startdate=}]]"+startdate+"&enddate="+enddate+"&rtype="+rtype+"&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});
+ }
+ }
+ });
+ }
+
+
+ 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;
+ }
+
+
+
+</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 8253be8..87fb2e1 100644
--- a/src/main/resources/templates/apph5/leavehistory.html
+++ b/src/main/resources/templates/apph5/leavehistory.html
@@ -410,6 +410,16 @@
label: '请选择'
});
sexl.push({
+ value: '8',
+ label: '外出办案'
+ });sexl.push({
+ value: '9',
+ label: '出差'
+ });sexl.push({
+ value: '7',
+ label: '补休'
+ });
+ sexl.push({
value: '11',
label: '事假'
});
@@ -479,6 +489,10 @@
}
})
+ this.pagesize = 10;
+ this.currPage = 1;
+ commonQuery(this, this.tempform.rtype, this.tempform.custtype, this.tempform.status, this.tempform.custid, this.currPage, this.pageSize);
+
}
})
@@ -523,6 +537,12 @@
_self.historyform.rtypename = "调休"
} else if (row.rtype == "15") {
_self.historyform.rtypename = "其他"
+ } else if (row.rtype == "8") {
+ _self.historyform.rtypename = "外出办案"
+ } else if (row.rtype == "9") {
+ _self.historyform.rtypename = "出差"
+ } else if (row.rtype == "7") {
+ _self.historyform.rtypename = "补休"
}
_self.historyform.remark = row.remark;
}
diff --git a/src/main/resources/templates/apph5/myleave.html b/src/main/resources/templates/apph5/myleave.html
index b4a0b2c..3af662c 100644
--- a/src/main/resources/templates/apph5/myleave.html
+++ b/src/main/resources/templates/apph5/myleave.html
@@ -385,6 +385,13 @@
label: '请选择'
});
sexl.push({
+ value: '8',
+ label: '外出办案'
+ });sexl.push({
+ value: '9',
+ label: '出差'
+ });
+ sexl.push({
value: '11',
label: '事假'
});
@@ -404,6 +411,10 @@
value: '15',
label: '其他'
});
+ sexl.push({
+ value: '7',
+ label: '补休'
+ });
_self.rtypelist = sexl;
var statl = [];
statl.push({
@@ -454,6 +465,11 @@
}
})
+ this.pagesize = 10;
+ this.currPage = 1;
+ commonQuery(this, this.tempform.rtype, this.tempform.status, this.tempform.custid, this.currPage, this.pageSize);
+
+
}
})
@@ -498,34 +514,16 @@
_self.historyform.rtypename = "调休"
} else if (row.rtype == "15") {
_self.historyform.rtypename = "其他"
+ } else if (row.rtype == "8") {
+ _self.historyform.rtypename = "外出办案"
+ } else if (row.rtype == "9") {
+ _self.historyform.rtypename = "出差"
+ } else if (row.rtype == "7") {
+ _self.historyform.rtypename = "补休"
}
_self.historyform.remark = row.remark;
}
- 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, rtype, status, custid, pageno, pagesize) {
$.ajax({
diff --git a/src/main/resources/templates/apph5/reviewclock.html b/src/main/resources/templates/apph5/reviewclock.html
index f411658..dddbe06 100644
--- a/src/main/resources/templates/apph5/reviewclock.html
+++ b/src/main/resources/templates/apph5/reviewclock.html
@@ -273,10 +273,10 @@
var _that = this;
this.pagesize = 10;
this.currPage = 1;
- if(this.tempform.attedate==''||this.tempform.attedate==undefined){
- layer.msg("请选择日期!", {icon: 2, time: 2000});
- return ;
- }
+ // if(this.tempform.attedate==''||this.tempform.attedate==undefined){
+ // layer.msg("请选择日期!", {icon: 2, time: 2000});
+ // return ;
+ // }
this.dialogFormVisible = false;
commonQuery(this, this.currPage, this.pageSize);
},
@@ -391,6 +391,10 @@
}
})
+ this.pagesize = 10;
+ this.currPage = 1;
+ commonQuery(this, this.currPage, this.pageSize);
+
}
})
@@ -445,30 +449,7 @@
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);
diff --git a/src/main/resources/templates/atte/app/index.html b/src/main/resources/templates/atte/app/index.html
index 5318c23..127a623 100644
--- a/src/main/resources/templates/atte/app/index.html
+++ b/src/main/resources/templates/atte/app/index.html
@@ -40,6 +40,16 @@
</div>
<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" th:href="@{'/app/atte/askoutindex?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/searchindex?custid='+${custid}}" >
<div class="weui-cell__bd">
<p>查看假条</p>
diff --git a/src/main/resources/templates/atte/app/re_index.html b/src/main/resources/templates/atte/app/re_index.html
index 3dd8f97..4e1cb48 100644
--- a/src/main/resources/templates/atte/app/re_index.html
+++ b/src/main/resources/templates/atte/app/re_index.html
@@ -40,6 +40,16 @@
</div>
<div class="weui-cells">
+ <a class="weui-cell weui-cell_access" th:href="@{'/app/atte/askoutindex?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/searchindex?custid='+${custid}}" >
<div class="weui-cell__bd">
<p>查看假条</p>
diff --git a/src/main/resources/templates/atte/dtl/index.html b/src/main/resources/templates/atte/dtl/index.html
index 51dc8d3..b5ce591 100644
--- a/src/main/resources/templates/atte/dtl/index.html
+++ b/src/main/resources/templates/atte/dtl/index.html
@@ -77,7 +77,22 @@
</div>
</div>
</div>
-
+ <div class="col-md-4">
+ <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="attedtlform.dtcode" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="dtcode in deptlist"
+ :key="dtcode.value"
+ :label="dtcode.label"
+ :value="dtcode.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
<div class="col-md-4">
<div class="form-group">
@@ -191,7 +206,8 @@
custname:'',
custtypeid:'',
deptcode:'',
- devname:''
+ devname:'',
+ dtcode:''
},
timegrplist:[],
typegrplist:[],
diff --git a/src/main/resources/templates/atte/report/p_index.html b/src/main/resources/templates/atte/report/p_index.html
index 3ebafe4..4844024 100644
--- a/src/main/resources/templates/atte/report/p_index.html
+++ b/src/main/resources/templates/atte/report/p_index.html
@@ -69,6 +69,22 @@
</div>
</div>
+ <div class="col-md-4">
+ <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="preportform.dtcode" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="dtcode in deptlist"
+ :key="dtcode.value"
+ :label="dtcode.label"
+ :value="dtcode.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
<div class="col-md-4">
<div class="form-group">
@@ -137,6 +153,21 @@
>
</el-table-column>
<el-table-column
+ prop="cnt7"
+ label="补休(天)"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="cnt8"
+ label="外出办案(天)"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="cnt9"
+ label="出差(天)"
+ >
+ </el-table-column>
+ <el-table-column
prop="cnts"
label="总考勤天数"
>
@@ -177,7 +208,8 @@
cardno:'',
custname:'',
custtypeid:'',
- deptcode:''
+ deptcode:'',
+ dtcode:''
},
timegrplist:[],
typegrplist:[],
@@ -386,7 +418,8 @@
var custname=that.preportform.custname;
var cardno=that.preportform.cardno;
var opercode=that.oper.opercode;
- var url = '/atte/print/printpreport?startdate=' + startdate + '&enddate=' + enddate + '&custtypeid=' + custtypeid + '&custname=' + custname+"&cardno="+cardno+"&opercode="+opercode;
+ var dtcode=that.preportform.dtcode;
+ var url = '/atte/print/printpreport?startdate=' + startdate + '&enddate=' + enddate + '&custtypeid=' + custtypeid + '&custname=' + custname+"&cardno="+cardno+"&opercode="+opercode+"&dtcode="+dtcode;
LODOP = getLodop();
LODOP.PRINT_INIT("考勤报表");
diff --git a/src/main/resources/templates/atte/report/print/p_printindex.html b/src/main/resources/templates/atte/report/print/p_printindex.html
index 98e2b78..d17e278 100644
--- a/src/main/resources/templates/atte/report/print/p_printindex.html
+++ b/src/main/resources/templates/atte/report/print/p_printindex.html
@@ -28,6 +28,9 @@
<th style="text-align: center;">异常(天)</th>
<th style="text-align: center;">请假(天)</th>
<th style="text-align: center;">旷工(天)</th>
+ <th style="text-align: center;">补休(天)</th>
+ <th style="text-align: center;">外出办案(天)</th>
+ <th style="text-align: center;">出差(天)</th>
<th style="text-align: center;">总考勤天数 </th>
</tr>
</thead>
@@ -47,6 +50,9 @@
<td th:text="${data.cnt2}"></td>
<td th:text="${data.cnt3}"></td>
<td th:text="${data.cnt4}"></td>
+ <td th:text="${data.cnt7}"></td>
+ <td th:text="${data.cnt8}"></td>
+ <td th:text="${data.cnt9}"></td>
<td th:text="${data.cnts}"></td>
</tr>
@@ -58,6 +64,9 @@
<td th:text="${sum.cnt2}"></td>
<td th:text="${sum.cnt3}"></td>
<td th:text="${sum.cnt4}"></td>
+ <td th:text="${sum.cnt7}"></td>
+ <td th:text="${sum.cnt8}"></td>
+ <td th:text="${sum.cnt9}"></td>
<td th:text="${sum.cnts}"></td>
</tr>
</div>
diff --git a/src/main/resources/templates/atte/rest/index.html b/src/main/resources/templates/atte/rest/index.html
index f9b6db6..b062858 100644
--- a/src/main/resources/templates/atte/rest/index.html
+++ b/src/main/resources/templates/atte/rest/index.html
@@ -205,7 +205,7 @@
pageSize:10,
totSize:0,
currentRow: null,
- rtypelist:[{value:11,label:'事假'},{value:12,label:'病假'},{value:13,label:'年假'},{value:14,label:'调休'},{value:15,label:'调休'}],
+ rtypelist:[{value:11,label:'事假'},{value:12,label:'病假'},{value:13,label:'年假'},{value:14,label:'调休'},{value:15,label:'其他'},{value:8,label:'外出办案'},{value:9,label:'出差'}],
statuslist:[{value:0,label:'未审核'},{value:1,label:'已通过'},{value:2,label:'未通过'},{value:3,label:'取消'}],
preportform:{
startdate:Date.now(),
diff --git a/src/main/resources/templates/atte/timedtl/index.html b/src/main/resources/templates/atte/timedtl/index.html
index d2082bc..de0f0c4 100644
--- a/src/main/resources/templates/atte/timedtl/index.html
+++ b/src/main/resources/templates/atte/timedtl/index.html
@@ -69,6 +69,23 @@
</div>
</div>
+ <div class="col-md-4">
+ <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="timedtlform.dtcode" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="dtcode in deptlist"
+ :key="dtcode.value"
+ :label="dtcode.label"
+ :value="dtcode.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
+
<div class="col-md-4">
<div class="form-group">
@@ -141,6 +158,9 @@
<span v-if="scope.row.state=='13'" class="layui-badge layui-bg-gray">年假</span>
<span v-if="scope.row.state=='14'" class="layui-badge layui-bg-gray">调休</span>
<span v-if="scope.row.state=='15'" class="layui-badge layui-bg-gray">其他</span>
+ <span v-if="scope.row.state=='8'" class="layui-badge layui-bg-gray">外出办案</span>
+ <span v-if="scope.row.state=='9'" class="layui-badge layui-bg-gray">出差</span>
+ <span v-if="scope.row.state=='7'" class="layui-badge layui-bg-gray">补休</span>
</template>
</el-table-column>
<el-table-column
@@ -155,6 +175,9 @@
<span v-if="scope.row.oldstate=='13'" class="layui-badge layui-bg-gray">年假</span>
<span v-if="scope.row.oldstate=='14'" class="layui-badge layui-bg-gray">调休</span>
<span v-if="scope.row.oldstate=='15'" class="layui-badge layui-bg-gray">其他</span>
+ <span v-if="scope.row.oldstate=='8'" class="layui-badge layui-bg-gray">外出办案</span>
+ <span v-if="scope.row.oldstate=='9'" class="layui-badge layui-bg-gray">出差</span>
+ <span v-if="scope.row.oldstate=='7'" class="layui-badge layui-bg-gray">补休</span>
</template>
</el-table-column>
<el-table-column
@@ -239,14 +262,15 @@
totSize:0,
currentRow: null,
stategrplist:[{value:0,label:'未打卡'},{value:1,label:'正常'},{value:2,label:'异常'},
- {value:11,label:'事假'},{value:12,label:'病假'},{value:13,label:'年假'},{value:14,label:'调休'},{value:15,label:'其他'},],
+ {value:7,label:'补休'},{value:8,label:'外出办案'},{value:9,label:'出差'},{value:11,label:'事假'},{value:12,label:'病假'},{value:13,label:'年假'},{value:14,label:'调休'},{value:15,label:'其他'},],
timedtlform:{
startdate:Date.now(),
enddate:Date.now(),
cardno:'',
custname:'',
custtypeid:'',
- deptcode:''
+ deptcode:'',
+ dtcode:''
},
refreshflag:'1',
timegrplist:[],