|
@@ -11,6 +11,7 @@ import com.chuanghai.attendance.service.*;
|
|
|
import com.chuanghai.attendance.utils.DateUtil;
|
|
import com.chuanghai.attendance.utils.DateUtil;
|
|
|
import com.chuanghai.attendance.utils.excel.ExcelImportXLSXUtil;
|
|
import com.chuanghai.attendance.utils.excel.ExcelImportXLSXUtil;
|
|
|
import com.chuanghai.attendance.vo.ClockTimeVo;
|
|
import com.chuanghai.attendance.vo.ClockTimeVo;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
@@ -28,6 +29,7 @@ import static com.alibaba.excel.util.DateUtils.format;
|
|
|
* @Description: com.chuanghai.attendance.service.impl
|
|
* @Description: com.chuanghai.attendance.service.impl
|
|
|
* @Version: 1.0
|
|
* @Version: 1.0
|
|
|
*/
|
|
*/
|
|
|
|
|
+@Slf4j
|
|
|
@Service("monthlySummaryService")
|
|
@Service("monthlySummaryService")
|
|
|
public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, MonthlySummary> implements MonthlySummaryService {
|
|
public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, MonthlySummary> implements MonthlySummaryService {
|
|
|
|
|
|
|
@@ -285,16 +287,16 @@ public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, Mo
|
|
|
// List<OriginalData> originalDataByDateList = originalDataService.queryByTimeAndUserId(date, "2328214111684948", null);
|
|
// List<OriginalData> originalDataByDateList = originalDataService.queryByTimeAndUserId(date, "2328214111684948", null);
|
|
|
List<OriginalData> originalDataByDateList = originalDataService.queryByTimeAndUserId(date, monthlySummary.getUserId(), monthlySummary.getWorkNum());
|
|
List<OriginalData> originalDataByDateList = originalDataService.queryByTimeAndUserId(date, monthlySummary.getUserId(), monthlySummary.getWorkNum());
|
|
|
|
|
|
|
|
- String idCard = workerIdentityService.queryByuserId(monthlySummary.getUserId(), monthlySummary.getWorkNum());
|
|
|
|
|
|
|
+ String idCard = workerIdentityService.queryByuserId(monthlySummary.getUserId(), monthlySummary.getWorkNum(), monthlySummary.getWorkName());
|
|
|
// String idCard = workerIdentityService.queryByuserId("2328214111684948", null);
|
|
// String idCard = workerIdentityService.queryByuserId("2328214111684948", null);
|
|
|
//查询该员工当日有打卡记录则记录出勤天数
|
|
//查询该员工当日有打卡记录则记录出勤天数
|
|
|
Boolean attendanceStatu = originalDataByDateList.size() > 0 ? Boolean.TRUE : Boolean.FALSE;
|
|
Boolean attendanceStatu = originalDataByDateList.size() > 0 ? Boolean.TRUE : Boolean.FALSE;
|
|
|
//如果对应校区的打卡次数超过规定次数,则去除多余的打卡数据,保留对应的打卡机会
|
|
//如果对应校区的打卡次数超过规定次数,则去除多余的打卡数据,保留对应的打卡机会
|
|
|
- if (originalDataByDateList.get(0).getClockAddress().contains(HJH)) {
|
|
|
|
|
|
|
+ if (!originalDataByDateList.get(0).getClockAddress().contains(MXH)) { //标识黄家湖打卡记录
|
|
|
if (originalDataByDateList.size() > clockNameHJHList.size()) {
|
|
if (originalDataByDateList.size() > clockNameHJHList.size()) {
|
|
|
originalDataByDateList = originalDataByDateList.subList(0, countHJH);
|
|
originalDataByDateList = originalDataByDateList.subList(0, countHJH);
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else { //墨轩湖打卡记录
|
|
|
if (originalDataByDateList.size() > clockNameMXHList.size()) {
|
|
if (originalDataByDateList.size() > clockNameMXHList.size()) {
|
|
|
originalDataByDateList = originalDataByDateList.subList(0, countMXH);
|
|
originalDataByDateList = originalDataByDateList.subList(0, countMXH);
|
|
|
}
|
|
}
|
|
@@ -305,11 +307,12 @@ public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, Mo
|
|
|
List<String> clockTimeList = new ArrayList<>();
|
|
List<String> clockTimeList = new ArrayList<>();
|
|
|
for (OriginalData originalData1 : originalDataByDateList) {
|
|
for (OriginalData originalData1 : originalDataByDateList) {
|
|
|
// if (originalData1.getClockAddress().contains(HJH) || originalData1.getClockEquipment().contains("手机")) {
|
|
// if (originalData1.getClockAddress().contains(HJH) || originalData1.getClockEquipment().contains("手机")) {
|
|
|
- if (originalData1.getClockAddress().contains(HJH)) {
|
|
|
|
|
|
|
+ if (!originalData1.getClockAddress().contains(MXH)) {
|
|
|
// campusStr += HJH;
|
|
// campusStr += HJH;
|
|
|
campusStr += HJH + ",";
|
|
campusStr += HJH + ",";
|
|
|
clockTimeList.add(originalData1.getClockTime() + ":00");
|
|
clockTimeList.add(originalData1.getClockTime() + ":00");
|
|
|
- } else if (originalData1.getClockAddress().contains(MXH)) {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+// } else if (originalData1.getClockAddress().contains(MXH)) {
|
|
|
// campusStr += MXH;
|
|
// campusStr += MXH;
|
|
|
campusStr += MXH + ",";
|
|
campusStr += MXH + ",";
|
|
|
clockTimeList.add(originalData1.getClockTime() + ":00");
|
|
clockTimeList.add(originalData1.getClockTime() + ":00");
|
|
@@ -325,16 +328,18 @@ public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, Mo
|
|
|
OriginalData originalData = originalDataByDateList.get(m);
|
|
OriginalData originalData = originalDataByDateList.get(m);
|
|
|
//获取第一次打卡的校区位置
|
|
//获取第一次打卡的校区位置
|
|
|
String campus = "";
|
|
String campus = "";
|
|
|
- if (originalDataByDateList.get(0).getClockAddress().contains(HJH)) {
|
|
|
|
|
|
|
+ if (!originalDataByDateList.get(0).getClockAddress().contains(MXH)) {
|
|
|
campus = HJH;
|
|
campus = HJH;
|
|
|
- } else if (originalDataByDateList.get(0).getClockAddress().contains(MXH)) {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+// } else if (originalDataByDateList.get(0).getClockAddress().contains(MXH)) {
|
|
|
campus = MXH;
|
|
campus = MXH;
|
|
|
}
|
|
}
|
|
|
//获取当前的打卡校区地址
|
|
//获取当前的打卡校区地址
|
|
|
String campusNow = "";
|
|
String campusNow = "";
|
|
|
- if (originalDataByDateList.get(m).getClockAddress().contains(HJH)) {
|
|
|
|
|
|
|
+ if (!originalDataByDateList.get(m).getClockAddress().contains(MXH)) {
|
|
|
campusNow = HJH;
|
|
campusNow = HJH;
|
|
|
- } else if (originalDataByDateList.get(m).getClockAddress().contains(MXH)) {
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+// } else if (originalDataByDateList.get(m).getClockAddress().contains(MXH)) {
|
|
|
campusNow = MXH;
|
|
campusNow = MXH;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -414,6 +419,7 @@ public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, Mo
|
|
|
for (int w = 0; w < clockCount; w++) {
|
|
for (int w = 0; w < clockCount; w++) {
|
|
|
if (qw > 0) {
|
|
if (qw > 0) {
|
|
|
recondOfHJHStr += date.substring(3) + " " + clockNameHJHList.get(w+clockIndex+1) + "缺卡\r\n";
|
|
recondOfHJHStr += date.substring(3) + " " + clockNameHJHList.get(w+clockIndex+1) + "缺卡\r\n";
|
|
|
|
|
+// recondOfHJHStr += date.substring(3) + " " + clockNameHJHList.get(w+clockIndex) + "缺卡\r\n";
|
|
|
}else {
|
|
}else {
|
|
|
recondOfHJHStr += date.substring(3) + " " + clockNameHJHList.get(w+clockIndex) + "缺卡\r\n";
|
|
recondOfHJHStr += date.substring(3) + " " + clockNameHJHList.get(w+clockIndex) + "缺卡\r\n";
|
|
|
}
|
|
}
|
|
@@ -559,8 +565,9 @@ public class MonthlySummaryServiceImpl extends ServiceImpl<MonthlySummaryDao, Mo
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
monthlyDtoList.add(monthlyDto);
|
|
monthlyDtoList.add(monthlyDto);
|
|
|
- //System.out.println(monthlyDto);
|
|
|
|
|
|
|
+// System.out.println("sss"+monthlyDtoList.get(0));
|
|
|
}
|
|
}
|
|
|
return monthlyDtoList;
|
|
return monthlyDtoList;
|
|
|
}
|
|
}
|