Commit 025c8f14 authored by 赵啸非's avatar 赵啸非

修改导出动态列

parent 8c36d1db
......@@ -23,14 +23,13 @@ import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.code.GoWorkResultEnum;
import com.mortals.xhx.common.code.OffWorkResultEnum;
import com.mortals.xhx.common.code.SourceType;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.common.pdu.user.UserPdu;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.attendance.model.AttendanceRecordEntity;
import com.mortals.xhx.module.attendance.model.AttendanceRecordQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationBalanceQuery;
import com.mortals.xhx.module.attendance.model.AttendanceVacationRecordQuery;
import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.AttendanceRecordHikService;
import com.mortals.xhx.module.attendance.service.AttendanceRecordService;
import com.mortals.xhx.module.attendance.service.AttendanceVacationRecordService;
import com.mortals.xhx.module.dept.model.DeptQuery;
......@@ -75,6 +74,9 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
private IAuthTokenService authTokenService;
@Autowired
private AttendanceRecordService recordService;
@Autowired
private AttendanceRecordHikService recordHikService;
@Autowired
private AttendanceVacationRecordService vacationRecordService;
......@@ -184,18 +186,27 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
HomeStatInfo homeStatInfo = new HomeStatInfo();
int totalPersonNum = staffService.count(new StaffQuery(), this.getContext());
StaffQuery staffQuery = new StaffQuery();
staffQuery.setSource(1);
int totalPersonNum = staffService.count(staffQuery, this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum);
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());
AttendanceRecordQuery attendanceRecordQuery = new AttendanceRecordQuery();
attendanceRecordQuery.setAttendanceDateStart(DateUtil.beginOfMonth(new Date()).toDateStr());
attendanceRecordQuery.setAttendanceDateEnd(DateUtil.today());
List<AttendanceRecordEntity> attendanceRecordEntities = recordService.find(attendanceRecordQuery);
//总打卡人次
long total = attendanceRecordEntities.parallelStream().map(item -> item.getStaffId()).distinct().count();
long total = recordHikService.find(hikQuery).parallelStream().map(item -> item.getStaffId()).distinct().count();
//long total = attendanceRecordEntities.parallelStream().map(item -> item.getStaffId()).distinct().count();
//迟到次数
long beLate = attendanceRecordEntities.parallelStream()
......@@ -238,7 +249,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
//未考勤
// long noAtt=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);
homeStatInfo.setAttendRadio(bigDecimal.toString()+"%");
......
......@@ -79,6 +79,10 @@ public class StaffController extends BaseCRUDJsonBodyMappingController<StaffServ
return super.doListAfter(query, model, context);
}
@Override
protected void saveBefore(StaffEntity entity, Map<String, Object> model, Context context) throws AppException {
entity.setSource(2);
}
@Override
protected int infoAfter(Long id, Map<String, Object> model, StaffEntity entity, Context context) throws AppException {
......
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