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

Merge remote-tracking branch 'origin/master'

parents 299c1335 d682e5d7
......@@ -5,7 +5,7 @@
<el-col :span="6" :xs="12">
<el-card>
<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="title">人事数据</div>
<div
......
......@@ -221,7 +221,6 @@ export default {
/** 导出Excel */
doExport() {
if(this.isExport==true) {
console.log("isExport:",this.isExport)
this.$message.info("考勤数据正在导出中,请勿重复点击!")
return false;
}
......
......@@ -24,15 +24,15 @@ export default {
this.$message.error(error.message || '请登录');
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
this.$router.replace({
window.location.href=process.env.VUE_APP_PORTAL_URL
/* this.$router.replace({
path: '/login',
query: {
redirect: this.redirect,
}
});
});*/
}
},
computed: {
......
......@@ -55,13 +55,17 @@ import { createSocket } from "@/assets/utils/websocket";
export default {
name: "login",
created() {
localStorage.removeItem("sysName");
localStorage.removeItem("sysLogo");
this.$route.query.sysName
? localStorage.setItem("sysName", this.$route.query.sysName)
: "";
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: {
login() {
......
......@@ -48,33 +48,28 @@
},
{
name: "gender",
type: "text",
label: "性别1男2女",
fuzzy: true
type: "select",
label: "性别"
},
{
name: "politicalstatus",
type: "select",
label: "政治面貌 ",
fuzzy: true
label: "政治面貌"
},
{
name: "staffType",
type: "text",
label: "员工类型1全职2兼职3实习",
fuzzy: true
type: "select",
label: "员工类型"
},
{
name: "status",
type: "text",
label: "员工状态1正式2试用3离职",
fuzzy: true
type: "select",
label: "员工状态"
},
{
name: "auditStatus",
type: "text",
label: "审核状态0待审核1通过2拒绝",
fuzzy: true
type: "select",
label: "审核状态"
},
],
columns: [
......@@ -83,19 +78,18 @@
{label: "员工姓名", prop: "fullName"},
{label: "性别1男2女", prop: "gender",formatter: this.formatter},
{label: "性别", prop: "gender",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: "审核状态0待审核1通过2拒绝", prop: "auditStatus",formatter: this.formatter},
{label: "审核状态", prop: "auditStatus",formatter: this.formatter},
{label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
......
......@@ -74,7 +74,7 @@ export default {
{
name: "deptId",
type: "select",
label: "全部部门",
label: "所属部门",
fuzzy: false,
},
......
......@@ -44,7 +44,7 @@ fi
if [ -e "$BASEDIR" ]
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
CLASSPATH=$CLASSPATH_PREFIX:
......
......@@ -193,30 +193,45 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
StaffQuery staffQuery = new StaffQuery();
staffQuery.setSource(1);
int totalPersonNum = staffService.count(staffQuery, this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum);
staffQuery.setSource(1);
Integer totalAttendPersonNum = staffService.count(staffQuery, this.getContext());
int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum);
AttendanceRecordHikQuery hikQuery = new AttendanceRecordHikQuery();
hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today());
/* hikQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.today()); */
hikQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
hikQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
AttendanceRecordQuery attendanceRecordQuery = new AttendanceRecordQuery();
attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today());
// attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
//attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today());
attendanceRecordQuery.setAttendanceDateStart(DateUtil.yesterday().toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.yesterday().toDateStr());
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)) {
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);
}
}*/
/* 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()
......@@ -249,25 +264,29 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
int levealPersonNum = vacationRecordService.count(vacationRecordQuery, getContext());*/
AttendanceLeaveRecordQuery leaveRecordQuery = new AttendanceLeaveRecordQuery();
leaveRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.today());
/* leaveRecordQuery.setCreateTimeStart(DateUtil.beginOfMonth(new Date()).toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.today());*/
leaveRecordQuery.setCreateTimeStart(DateUtil.yesterday().toDateStr());
leaveRecordQuery.setCreateTimeEnd(DateUtil.yesterday().toDateStr());
leaveRecordQuery.setProcessStatus(ProcessStatusEnum.已处理.getValue());
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()
.flatMap(item -> item.getAttendanceRecordDetailList().stream())
.filter(f -> GoWorkResultEnum.缺卡.getValue() == f.getGoWorkResult() || OffWorkResultEnum.缺卡.getValue() == f.getOffWorkResult())
.count();
.count();*/
//异常考勤记录
//未考勤
// long noAtt=lackOfCards;
long att = totalAttend - lackOfCardsAttend - levealPersonNum;
long att = totalAttendPersonNum - lackOfCards;
// long att = totalAttend - lackOfCardsAttend;
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() + "%");
} else {
homeStatInfo.setAttendRadio("0%");
......@@ -277,7 +296,7 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
homeStatInfo.setLatePersonNum(beLate);
homeStatInfo.setLeftEarlyPersonNum(leaveEarly);
homeStatInfo.setMissCardPersonNum(lackOfCards);
homeStatInfo.setAttendPersonNum(totalCache);
homeStatInfo.setAttendPersonNum(totalAttendPersonNum);
data.put("homeStat", homeStatInfo);
data.put("token", token);
......
......@@ -17,7 +17,7 @@ public class HomeStatInfo {
private Integer totalDeptNum;
private Long attendPersonNum=0L;
private Integer attendPersonNum=0;
private String attendRadio;
/**
......
......@@ -50,9 +50,18 @@ public class SyncDoorsEventAfterTaskImpl implements ITaskExcuteService {
@Override
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() {
......
......@@ -7,12 +7,14 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.user.model.UserEntity;
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.AttendanceRecordHikQuery;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
......@@ -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.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
......@@ -49,6 +52,8 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
private IHikDoorService hikDoorService;
private Integer day;
@Autowired
private ICacheService cacheService;
@Override
......@@ -60,7 +65,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
} else {
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();
}
......@@ -179,6 +191,14 @@ public class SyncDoorsEventTaskImpl implements ITaskExcuteService {
// recordHikService.save(saveRecordList);
}
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 {
//判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
// log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue;
}
if (goInTime) {
......
......@@ -183,7 +183,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
//判断考勤时间是否在下班打卡区间内
boolean offInTime = DateUtil.isIn(curDateTime, offWorkDateBefore, offWorkDateAfter);
if (goInTime == false && offInTime == false) {
log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
// log.info("考勤时间不在上班区间与下班区间中,不做处理!attendDate:{}", DateUtil.formatDateTime(commonData.getAttendanceDate()));
continue;
}
if (goInTime) {
......
......@@ -295,6 +295,11 @@ public class AttendanceRecordController extends BaseCRUDJsonBodyMappingControlle
query.setAttendanceGroupId(query.getGroupId());
}
if (ObjectUtils.isEmpty(query.getAttendanceDateStart())) {
query.setAttendanceDateStart(DateUtil.today());
query.setAttendanceDateEnd(DateUtil.today());
}
if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(Arrays.asList(new OrderCol("attendanceDate", OrderCol.DESCENDING), new OrderCol("staffName", OrderCol.DESCENDING)));
} 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