|
@@ -291,7 +291,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|
|
|
|
|
JSONObject commitData = new JSONObject();
|
|
JSONObject commitData = new JSONObject();
|
|
commitData.put(ATTENDANCE_USER_NAME, SecurityUtils.getUsername());
|
|
commitData.put(ATTENDANCE_USER_NAME, SecurityUtils.getUsername());
|
|
- commitData.put(ATTENDANCE_TABLE_TODAYTIME, Lists.newArrayList(DateUtils.getDate()));
|
|
|
|
|
|
+ commitData.put(ATTENDANCE_TABLE_TODAYTIME, DateUtils.getDate());
|
|
commitData.put(ATTENDANCE_TABLE_LONGITUDE, dto.getLongitude());
|
|
commitData.put(ATTENDANCE_TABLE_LONGITUDE, dto.getLongitude());
|
|
commitData.put(ATTENDANCE_TABLE_LATITUDE, dto.getLatitude());
|
|
commitData.put(ATTENDANCE_TABLE_LATITUDE, dto.getLatitude());
|
|
commitData.put(ATTENDANCE_USER_ID, SecurityUtils.getUserId());
|
|
commitData.put(ATTENDANCE_USER_ID, SecurityUtils.getUserId());
|
|
@@ -300,34 +300,40 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|
if (checkIsLeave()) {
|
|
if (checkIsLeave()) {
|
|
//
|
|
//
|
|
}
|
|
}
|
|
- if (checkIsLate(currentTime,type)) {
|
|
|
|
- commitData.put(ATTENDANCE_ABNORMAL, Y);
|
|
|
|
- commitData.put(ATTENDANCE_TABLE_LATE, Y);
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
UpdateDto updateDto = new UpdateDto();
|
|
UpdateDto updateDto = new UpdateDto();
|
|
JSONObject commitDataUpdate = new JSONObject();
|
|
JSONObject commitDataUpdate = new JSONObject();
|
|
if (GO_TO_WORK_TYPE == type) {
|
|
if (GO_TO_WORK_TYPE == type) {
|
|
|
|
+ if (checkIsLate(currentTime,type)) {
|
|
|
|
+ commitData.put(ATTENDANCE_ABNORMAL, Y);
|
|
|
|
+ commitData.put(ATTENDANCE_TABLE_LATE, Y);
|
|
|
|
+ }
|
|
commitData.put(ATTENDANCE_TABLE_WORK, currentTime);
|
|
commitData.put(ATTENDANCE_TABLE_WORK, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_WORK, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_WORK, currentTime);
|
|
} else if (GO_OFF_WORK_TYPE == type) {
|
|
} else if (GO_OFF_WORK_TYPE == type) {
|
|
commitData.put(ATTENDANCE_TABLE_OFFWORK, currentTime);
|
|
commitData.put(ATTENDANCE_TABLE_OFFWORK, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_OFFWORK, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_OFFWORK, currentTime);
|
|
}else if(GO_TO_WORK_TYPE_PM == type){
|
|
}else if(GO_TO_WORK_TYPE_PM == type){
|
|
|
|
+ if (checkIsLate(currentTime,type)) {
|
|
|
|
+ commitData.put(ATTENDANCE_ABNORMAL, Y);
|
|
|
|
+ commitData.put(ATTENDANCE_TABLE_LATE, Y);
|
|
|
|
+ }
|
|
commitData.put(ATTENDANCE_TABLE_WORK_PM, currentTime);
|
|
commitData.put(ATTENDANCE_TABLE_WORK_PM, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_WORK_PM, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_WORK_PM, currentTime);
|
|
}else if(GO_OFF_WORK_TYPE_PM == type){
|
|
}else if(GO_OFF_WORK_TYPE_PM == type){
|
|
commitData.put(ATTENDANCE_TABLE_OFFWORK_PM, currentTime);
|
|
commitData.put(ATTENDANCE_TABLE_OFFWORK_PM, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_OFFWORK_PM, currentTime);
|
|
commitDataUpdate.put(ATTENDANCE_TABLE_OFFWORK_PM, currentTime);
|
|
}
|
|
}
|
|
- JSONObject jsonObject = JSONObjectUtils.putValue(ATTENDANCE_USER_NAME, SecurityUtils.getUsername(), ATTENDANCE_TABLE_TODAYTIME, Lists.newArrayList(DateUtils.getDate()));
|
|
|
|
|
|
+ JSONObject jsonObject = JSONObjectUtils.putValue(ATTENDANCE_USER_NAME, SecurityUtils.getUsername(), ATTENDANCE_TABLE_TODAYTIME, DateUtils.getDate());
|
|
JSONObject oneByMap = commonService.getOneByMap(tableName, jsonObject);
|
|
JSONObject oneByMap = commonService.getOneByMap(tableName, jsonObject);
|
|
if (MapUtils.isEmpty(oneByMap)){
|
|
if (MapUtils.isEmpty(oneByMap)){
|
|
saveClockOn(tableName, commitData);
|
|
saveClockOn(tableName, commitData);
|
|
}else {
|
|
}else {
|
|
Long id = oneByMap.getLong("id");
|
|
Long id = oneByMap.getLong("id");
|
|
updateDto.setCommitData(commitDataUpdate);
|
|
updateDto.setCommitData(commitDataUpdate);
|
|
- JSONObjectUtils.putValue("id",id);
|
|
|
|
|
|
+ JSONObject condition = JSONObjectUtils.putValue("id", id);
|
|
updateDto.setTableName(tableName);
|
|
updateDto.setTableName(tableName);
|
|
|
|
+ updateDto.setCondition(condition);
|
|
commonService.update(updateDto);
|
|
commonService.update(updateDto);
|
|
}
|
|
}
|
|
return commitData;
|
|
return commitData;
|
|
@@ -342,10 +348,11 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|
@Override
|
|
@Override
|
|
public AjaxResult statisticsByMonth(Map<String, Object> map) {
|
|
public AjaxResult statisticsByMonth(Map<String, Object> map) {
|
|
String date = String.valueOf(map.get("date"));
|
|
String date = String.valueOf(map.get("date"));
|
|
|
|
+ String name = String.valueOf(map.get("name"));
|
|
int page = ((Integer) map.get("page"));
|
|
int page = ((Integer) map.get("page"));
|
|
int pageSize = ((Integer) map.get("pageSize"));
|
|
int pageSize = ((Integer) map.get("pageSize"));
|
|
int pageNo = (page - 1) * pageSize;
|
|
int pageNo = (page - 1) * pageSize;
|
|
- List<JSONObject> jsonObjects = standardlyMapper.statisticsByMonth(date, pageNo, pageSize);
|
|
|
|
|
|
+ List<JSONObject> jsonObjects = standardlyMapper.statisticsByMonth(date, name, pageNo, pageSize);
|
|
return AjaxResult.success(jsonObjects);
|
|
return AjaxResult.success(jsonObjects);
|
|
}
|
|
}
|
|
|
|
|