|
@@ -9,10 +9,8 @@ import com.boman.common.redis.RedisKey;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTable;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.GenTableColumn;
|
|
import com.boman.domain.constant.FormDataConstant;
|
|
import com.boman.domain.constant.FormDataConstant;
|
|
-import com.boman.domain.dto.AjaxResult;
|
|
|
|
-import com.boman.domain.dto.ClockOnDto;
|
|
|
|
-import com.boman.domain.dto.FormDataDto;
|
|
|
|
-import com.boman.domain.dto.UpdateDto;
|
|
|
|
|
|
+import com.boman.domain.dto.*;
|
|
|
|
+import com.boman.web.core.mapper.AttendanceMapper;
|
|
import com.boman.web.core.mapper.StandardlyMapper;
|
|
import com.boman.web.core.mapper.StandardlyMapper;
|
|
import com.boman.web.core.service.TableServiceCmdService;
|
|
import com.boman.web.core.service.TableServiceCmdService;
|
|
import com.boman.web.core.service.attendance.rules.AttendanceRulesService;
|
|
import com.boman.web.core.service.attendance.rules.AttendanceRulesService;
|
|
@@ -65,6 +63,8 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|
private IBaseSelectService selectService;
|
|
private IBaseSelectService selectService;
|
|
@Autowired
|
|
@Autowired
|
|
private StandardlyMapper standardlyMapper;
|
|
private StandardlyMapper standardlyMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AttendanceMapper attendanceMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 功能描述: 根据tableName和userId查找当月考勤
|
|
* 功能描述: 根据tableName和userId查找当月考勤
|
|
@@ -478,6 +478,42 @@ public class AttendanceServiceImpl implements AttendanceService {
|
|
return AjaxResult.success(jsonObjectList);
|
|
return AjaxResult.success(jsonObjectList);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public AjaxResult updateAttendance(FormDataDto dto) {
|
|
|
|
+ JSONObject condition = ifNullSetEmpty(dto.getFixedData().getJSONObject(CONDITION));
|
|
|
|
+ String tableName = "attendance_table";
|
|
|
|
+ GenTable genTable = cmdService.getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
|
|
|
|
+ List<GenTableColumn> columns = genTable.getColumns();
|
|
|
|
+ JSONObject packCondition = ifNullSetEmpty(selectService.packColCondition(columns, condition));
|
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
|
+ List<JSONObject> rows = attendanceMapper.selectByCondition(tableName);
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> detailedRecordList = new ArrayList<>();
|
|
|
|
+ if (isEmpty(rows)) {
|
|
|
|
+ result.put(FormDataConstant.PAGE_ROWS, rows);
|
|
|
|
+ return AjaxResult.success(result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (JSONObject jsonObject : rows) {
|
|
|
|
+ Map<String, Object> map = new HashMap<>(5);
|
|
|
|
+ Object attendanceTableWork = jsonObject.get("attendance_table_work");
|
|
|
|
+ Object attendanceTableOffWork = jsonObject.get("attendance_table_offwork");
|
|
|
|
+ map.put("attendanceTableWork", "未打卡");
|
|
|
|
+ map.put("attendanceTableOffWork", "未打卡");
|
|
|
|
+ if (isNotEmpty(attendanceTableWork)) {
|
|
|
|
+ map.put("attendanceTableWork", attendanceTableWork + "已打卡");
|
|
|
|
+ }
|
|
|
|
+ if (isNotEmpty(attendanceTableOffWork)) {
|
|
|
|
+ map.put("attendanceTableWork", attendanceTableOffWork + "已打卡");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ map.put("dateTime", jsonObject.get("attendance_table_week") + " " + jsonObject.get("attendance_table_todaytime"));
|
|
|
|
+ detailedRecordList.add(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|