Commit 1a0aebd0 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 299c1335 d682e5d7
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-col :span="6" :xs="12"> <el-col :span="6" :xs="12">
<el-card> <el-card>
<div class="data_left"> <div class="data_left">
<div class="title" style="margin-bottom:40px">本月数据洞察</div> <div class="title" style="margin-bottom:40px">昨日数据洞察</div>
<div class="cell1"> <div class="cell1">
<div class="title">人事数据</div> <div class="title">人事数据</div>
<div <div
......
...@@ -221,7 +221,6 @@ export default { ...@@ -221,7 +221,6 @@ export default {
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
if(this.isExport==true) { if(this.isExport==true) {
console.log("isExport:",this.isExport)
this.$message.info("考勤数据正在导出中,请勿重复点击!") this.$message.info("考勤数据正在导出中,请勿重复点击!")
return false; return false;
} }
......
...@@ -24,15 +24,15 @@ export default { ...@@ -24,15 +24,15 @@ export default {
this.$message.error(error.message || '请登录'); this.$message.error(error.message || '请登录');
console.log("href:"+process.env.VUE_APP_PORTAL_URL) console.log("href:"+process.env.VUE_APP_PORTAL_URL)
// window.location.href=process.env.VUE_APP_PORTAL_URL=='undefined'?'http://192.168.0.98:11072':process.env.VUE_APP_PORTAL_URL //window.location.href=process.env.VUE_APP_PORTAL_URL=='undefined'?'http://192.168.0.98:11072':process.env.VUE_APP_PORTAL_URL
// window.location.href=process.env.VUE_APP_PORTAL_URL window.location.href=process.env.VUE_APP_PORTAL_URL
this.$router.replace({ /* this.$router.replace({
path: '/login', path: '/login',
query: { query: {
redirect: this.redirect, redirect: this.redirect,
} }
}); });*/
} }
}, },
computed: { computed: {
......
...@@ -55,13 +55,17 @@ import { createSocket } from "@/assets/utils/websocket"; ...@@ -55,13 +55,17 @@ import { createSocket } from "@/assets/utils/websocket";
export default { export default {
name: "login", name: "login",
created() { created() {
localStorage.removeItem("sysName");
localStorage.removeItem("sysLogo");
this.$route.query.sysName this.$route.query.sysName
? localStorage.setItem("sysName", this.$route.query.sysName) ? localStorage.setItem("sysName", this.$route.query.sysName)
: ""; : "";
this.$route.query.sysName this.$route.query.sysName
? (document.title = this.$route.query.sysName) ? (document.title = this.$route.query.sysName)
: ""; : "";
localStorage.setItem("sysLogo", this.$route.query.sysLogo); this.$route.query.sysLogo
? localStorage.setItem("sysLogo", this.$route.query.sysLogo)
: "";
}, },
methods: { methods: {
login() { login() {
......
...@@ -48,33 +48,28 @@ ...@@ -48,33 +48,28 @@
}, },
{ {
name: "gender", name: "gender",
type: "text", type: "select",
label: "性别1男2女", label: "性别"
fuzzy: true
}, },
{ {
name: "politicalstatus", name: "politicalstatus",
type: "select", type: "select",
label: "政治面貌 ", label: "政治面貌"
fuzzy: true
}, },
{ {
name: "staffType", name: "staffType",
type: "text", type: "select",
label: "员工类型1全职2兼职3实习", label: "员工类型"
fuzzy: true
}, },
{ {
name: "status", name: "status",
type: "text", type: "select",
label: "员工状态1正式2试用3离职", label: "员工状态"
fuzzy: true
}, },
{ {
name: "auditStatus", name: "auditStatus",
type: "text", type: "select",
label: "审核状态0待审核1通过2拒绝", label: "审核状态"
fuzzy: true
}, },
], ],
columns: [ columns: [
...@@ -83,19 +78,18 @@ ...@@ -83,19 +78,18 @@
{label: "员工姓名", prop: "fullName"}, {label: "员工姓名", prop: "fullName"},
{label: "性别1男2女", prop: "gender",formatter: this.formatter}, {label: "性别", prop: "gender",formatter: this.formatter},
{label: "政治面貌 ", prop: "politicalstatus",formatter: this.formatter}, {label: "政治面貌 ", prop: "politicalstatus",formatter: this.formatter},
{label: "员工类型1全职2兼职3实习", prop: "staffType",formatter: this.formatter}, {label: "员工类型", prop: "staffType",formatter: this.formatter},
{label: "员工状态1正式2试用3离职", prop: "status",formatter: this.formatter}, {label: "员工状态", prop: "status",formatter: this.formatter},
{label: "入职时间", prop: "entryDate", formatter: this.formatterDate}, {label: "入职时间", prop: "entryDate", formatter: this.formatterDate},
{label: "审核状态0待审核1通过2拒绝", prop: "auditStatus",formatter: this.formatter}, {label: "审核状态", prop: "auditStatus",formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{ {
label: "操作", label: "操作",
width: 240, width: 240,
......
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
{ {
name: "deptId", name: "deptId",
type: "select", type: "select",
label: "全部部门", label: "所属部门",
fuzzy: false, fuzzy: false,
}, },
......
...@@ -44,7 +44,7 @@ fi ...@@ -44,7 +44,7 @@ fi
if [ -e "$BASEDIR" ] if [ -e "$BASEDIR" ]
then then
JAVA_OPTS="-Xms256M -Xmx512M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH" JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi fi
CLASSPATH=$CLASSPATH_PREFIX: CLASSPATH=$CLASSPATH_PREFIX:
......
...@@ -193,30 +193,45 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -193,30 +193,45 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
StaffQuery staffQuery = new StaffQuery(); StaffQuery staffQuery = new StaffQuery();
staffQuery.setSource(1);
int totalPersonNum = staffService.count(staffQuery, this.getContext()); int totalPersonNum = staffService.count(staffQuery, this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum); homeStatInfo.setTotalPersonNum(totalPersonNum);
staffQuery.setSource(1);
Integer totalAttendPersonNum = staffService.count(staffQuery, this.getContext());
int totalDeptNum = deptService.count(new DeptQuery(), getContext()); int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum); homeStatInfo.setTotalDeptNum(totalDeptNum);
AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery(); AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery();
hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr()); /* hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today()); hikQuery.setAttendanceDateEnd(DateUtil.today()); */
hikQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
AttendanceRecordQuery attendanceRecordQuery = new AttendanceRecordQuery(); AttendanceRecordQuery attendanceRecordQuery = new AttendanceRecordQuery();
attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr()); // attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today()); //attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today());
attendanceRecordQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
List<AttendanceRecordEntity> attendanceRecordEntities = recordService.find(attendanceRecordQuery); List<AttendanceRecordEntity> attendanceRecordEntities = recordService.find(attendanceRecordQuery);
//获取当月打卡人数,如果存在 //获取当月打卡人数,如果存在
Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), Long.class); /* Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), Long.class);
if (ObjectUtils.isEmpty(totalCache)) { if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count(); totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache); cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache);
} }*/
/* Long totalCache = cacheService.hget(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), Long.class);
if (ObjectUtils.isEmpty(totalCache)) {
totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.yesterday().toDateStr(), totalCache);
}*/
//迟到次数 //迟到次数
long beLate = attendanceRecordEntities.parallelStream() long beLate = attendanceRecordEntities.parallelStream()
...@@ -249,25 +264,29 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -249,25 +264,29 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
int levealPersonNum = vacationRecordService.count(vacationRecordQuery, getContext());*/ int levealPersonNum = vacationRecordService.count(vacationRecordQuery, getContext());*/
AttendanceLeaveRecordQuery leaveRecordQuery = new AttendanceLeaveRecordQuery(); AttendanceLeaveRecordQuery leaveRecordQuery = new AttendanceLeaveRecordQuery();
leaveRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr()); /* leaveRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.today()); leaveRecordQuery.setCreateTimeEnd(DateUtil.today());*/
leaveRecordQuery.setCreateTimeStart(DateUtil.yesterday().toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.yesterday().toDateStr());
leaveRecordQuery.setProcessStatus(ProcessStatusEnum.已处理.getValue()); leaveRecordQuery.setProcessStatus(ProcessStatusEnum.已处理.getValue());
int levealPersonNum = leaveRecordService.count(leaveRecordQuery, getContext()); int levealPersonNum = leaveRecordService.count(leaveRecordQuery, getContext());
//总打卡记录 //总打卡记录
long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().stream()).count(); /* long totalAttend = attendanceRecordEntities.parallelStream().flatMap(item -> item.getAttendanceRecordDetailList().parallelStream()).count();
long lackOfCardsAttend = attendanceRecordEntities.parallelStream() long lackOfCardsAttend = attendanceRecordEntities.parallelStream()
.flatMap(item -> item.getAttendanceRecordDetailList().stream()) .flatMap(item -> item.getAttendanceRecordDetailList().stream())
.filter(f -> GoWorkResultEnum.缺卡.getValue() == f.getGoWorkResult() || OffWorkResultEnum.缺卡.getValue() == f.getOffWorkResult()) .filter(f -> GoWorkResultEnum.缺卡.getValue() == f.getGoWorkResult() || OffWorkResultEnum.缺卡.getValue() == f.getOffWorkResult())
.count(); .count();*/
//异常考勤记录 //异常考勤记录
//未考勤 //未考勤
// long noAtt=lackOfCards; // long noAtt=lackOfCards;
long att = totalAttend - lackOfCardsAttend - levealPersonNum; long att = totalAttendPersonNum - lackOfCards;
// long att = totalAttend - lackOfCardsAttend;
if (att != 0L) { if (att != 0L) {
BigDecimal bigDecimal = new BigDecimal(att).divide(new BigDecimal(totalAttend), 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_CEILING);
BigDecimal bigDecimal = new BigDecimal(att).divide(new BigDecimal(totalAttendPersonNum), 4, BigDecimal.ROUND_CEILING).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_CEILING);
homeStatInfo.setAttendRadio(bigDecimal.toString() + "%"); homeStatInfo.setAttendRadio(bigDecimal.toString() + "%");
} else { } else {
homeStatInfo.setAttendRadio("0%"); homeStatInfo.setAttendRadio("0%");
...@@ -277,7 +296,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -277,7 +296,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo.setLatePersonNum(beLate); homeStatInfo.setLatePersonNum(beLate);
homeStatInfo.setLeftEarlyPersonNum(leaveEarly); homeStatInfo.setLeftEarlyPersonNum(leaveEarly);
homeStatInfo.setMissCardPersonNum(lackOfCards); homeStatInfo.setMissCardPersonNum(lackOfCards);
homeStatInfo.setAttendPersonNum(totalCache); homeStatInfo.setAttendPersonNum(totalAttendPersonNum);
data.put("homeStat", homeStatInfo); data.put("homeStat", homeStatInfo);
data.put("token", token); data.put("token", token);
......
...@@ -17,7 +17,7 @@ public class HomeStatInfo { ...@@ -17,7 +17,7 @@ public class HomeStatInfo {
private Integer totalDeptNum; private Integer totalDeptNum;
private Long attendPersonNum=0L; private Integer attendPersonNum=0;
private String attendRadio; private String attendRadio;
/** /**
......
...@@ -50,9 +50,18 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService { ...@@ -50,9 +50,18 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
syncDoorEvents(); // syncDoorEvents();
//判断时间段 不在时间段的 不做计算
//早上9点 子晚上8点 计算
Date beginDateTime=DateUtil.parseDateTime(DateUtil.today()+" 09:00:00");
Date endDateTime=DateUtil.parseDateTime(DateUtil.today()+" 20:30:00");
boolean in = DateUtil.isIn(new Date(), beginDateTime, endDateTime);
if(in){
calculateAttendByDay();
}
calculateAttendByDay();
} }
private void calculateAttendByDay() { private void calculateAttendByDay() {
......
...@@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSON; ...@@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils; import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery; import com.mortals.xhx.module.attendance.model.AttendanceRecordHikQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService; import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
...@@ -22,6 +24,7 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService; ...@@ -22,6 +24,7 @@ import com.mortals.xhx.module.hik.door.service.IHikDoorService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -49,6 +52,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -49,6 +52,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
private IHikDoorService hikDoorService; private IHikDoorService hikDoorService;
private Integer day; private Integer day;
@Autowired
private ICacheService cacheService;
@Override @Override
...@@ -60,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -60,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
} else { } else {
day = 0; day = 0;
} }
syncDoorEvents();
Date beginDateTime=DateUtil.parseDateTime(DateUtil.today()+" 08:00:00");
Date endDateTime=DateUtil.parseDateTime(DateUtil.today()+" 20:30:00");
boolean in = DateUtil.isIn(new Date(), beginDateTime, endDateTime);
if(in){
syncDoorEvents();
}
//calculateAttendByDay(); //calculateAttendByDay();
} }
...@@ -179,6 +191,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService { ...@@ -179,6 +191,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
// recordHikService.save(saveRecordList); // recordHikService.save(saveRecordList);
} }
log.info("saveRecordList size:{}", saveRecordList.size()); log.info("saveRecordList size:{}", saveRecordList.size());
AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery();
hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today());
Long totalCache = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
cacheService.hset(RedisKey.KEY_ATTENC_TOTOAL_CACHE, DateUtil.format(new Date(), "yyyy-MM"), totalCache);
} }
......
...@@ -177,7 +177,7 @@ public class FixWorkAttendance extends AttendanceWorkAbstract { ...@@ -177,7 +177,7 @@ public class FixWorkAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内 //判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter); boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) { if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate())); // log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue; continue;
} }
if (goInTime) { if (goInTime) {
......
...@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract { ...@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内 //判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter); boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) { if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate())); // log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue; continue;
} }
if (goInTime) { if (goInTime) {
......
...@@ -295,6 +295,11 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle ...@@ -295,6 +295,11 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
query.setAttendanceGroupId(query.getGroupId()); query.setAttendanceGroupId(query.getGroupId());
} }
if (ObjectUtils.isEmpty(query.getAttendanceDateStart())) {
query.setAttendanceDateStart(DateUtil.today());
query.setAttendanceDateEnd(DateUtil.today());
}
if (ObjectUtils.isEmpty(query.getOrderColList())) { if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(Arrays.asList(new OrderCol("attendanceDate", OrderCol.DESCENDING), new OrderCol("staffName", OrderCol.DESCENDING))); query.setOrderColList(Arrays.asList(new OrderCol("attendanceDate", OrderCol.DESCENDING), new OrderCol("staffName", OrderCol.DESCENDING)));
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment