|
|
@@ -1,5 +1,6 @@
|
|
1
|
1
|
package com.sundot.airport.web.controller.attendance;
|
|
2
|
2
|
|
|
|
3
|
+import cn.hutool.core.bean.BeanUtil;
|
|
3
|
4
|
import cn.hutool.core.collection.CollUtil;
|
|
4
|
5
|
import cn.hutool.core.collection.CollectionUtil;
|
|
5
|
6
|
import cn.hutool.core.date.DateUtil;
|
|
|
@@ -288,8 +289,6 @@ public class AttendancePostRecordController extends BaseController {
|
|
288
|
289
|
public AjaxResult add(@RequestBody AttendancePostRecord attendancePostRecord) {
|
|
289
|
290
|
// 处理部门信息
|
|
290
|
291
|
extracted(attendancePostRecord);
|
|
291
|
|
- UserInfo userInfo = userCache.getUserInfo(attendancePostRecord.getUserId());
|
|
292
|
|
- attendancePostRecord.setUserName(userInfo.getNickName());
|
|
293
|
292
|
attendancePostRecord.setRevision(1L);
|
|
294
|
293
|
attendancePostRecord.setWorkDuration((attendancePostRecord.getCheckOutTime().getTime() - attendancePostRecord.getCheckInTime().getTime()) / 1000 / 60);
|
|
295
|
294
|
attendancePostRecord.setAttendanceDate(DateUtil.date(attendancePostRecord.getCheckInTime()));
|
|
|
@@ -301,8 +300,16 @@ public class AttendancePostRecordController extends BaseController {
|
|
301
|
300
|
BasePosition positionParam = new BasePosition();
|
|
302
|
301
|
List<BasePosition> basePositions = basePositionService.selectBasePositionList(positionParam);
|
|
303
|
302
|
setChannel(attendancePostRecord, basePositions);
|
|
304
|
|
-
|
|
305
|
|
- return toAjax(attendancePostRecordService.insertAttendancePostRecord(attendancePostRecord));
|
|
|
303
|
+ attendancePostRecord.setLocked(false);
|
|
|
304
|
+ attendancePostRecord.getUserIdList().forEach(userId -> {
|
|
|
305
|
+ AttendancePostRecord item = new AttendancePostRecord();
|
|
|
306
|
+ BeanUtil.copyProperties(attendancePostRecord, item);
|
|
|
307
|
+ UserInfo userInfo = userCache.getUserInfo(userId);
|
|
|
308
|
+ item.setUserId(userId);
|
|
|
309
|
+ item.setUserName(userInfo.getNickName());
|
|
|
310
|
+ attendancePostRecordService.insertAttendancePostRecord(item);
|
|
|
311
|
+ });
|
|
|
312
|
+ return success("操作成功");
|
|
306
|
313
|
}
|
|
307
|
314
|
|
|
308
|
315
|
private void extracted(AttendancePostRecord attendancePostRecord) {
|