|
|
@@ -39,9 +39,7 @@ import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
@@ -160,6 +158,7 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
List<MyMonthDays> myMonthDays = projectStaffRecordMapper.myDurationMonth(id, aid, DateUtils.firsDayOfMonth(), DateUtils.lastDayOfMonth() + " 23:59:59");
|
|
|
supplementMyMonthDays(myMonthDays);
|
|
|
for (MyMonthDays myMonthDay : myMonthDays) {
|
|
|
+ DateUtils.getWeeks(myMonthDay.getDates());
|
|
|
// 0 =未到时限 1=满工时,2=未打卡,3=未满工时
|
|
|
if (compareTo(date,myMonthDay.getDates())){
|
|
|
myMonthDay.setStatus(0);
|
|
|
@@ -258,18 +257,20 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
}
|
|
|
|
|
|
private void supplementMyMonthDays(List<MyMonthDays> myMonthDays) {
|
|
|
- List<String> monthDays = getMonthDays();
|
|
|
- for (String monthDay : monthDays) {
|
|
|
+ List<Map<String,Object>> monthDays = getMonthDays();
|
|
|
+ for ( Map<String,Object> map : monthDays) {
|
|
|
boolean flag= true;
|
|
|
for (MyMonthDays myMonthDay : myMonthDays) {
|
|
|
- if (monthDay.equals(myMonthDay.getDates())){
|
|
|
+ if (map.get("days").equals(myMonthDay.getDates())){
|
|
|
flag=false;
|
|
|
+ myMonthDay.setWeek((Integer) map.get("week"));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (flag){
|
|
|
MyMonthDays mmd=new MyMonthDays();
|
|
|
- mmd.setDates(monthDay);
|
|
|
+ mmd.setDates((String) map.get("days"));
|
|
|
+ mmd.setWeek((Integer) map.get("week"));
|
|
|
mmd.setDuration("0");
|
|
|
mmd.setStatus(0);
|
|
|
myMonthDays.add(mmd);
|
|
|
@@ -277,21 +278,25 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static List<String> getMonthDays() {
|
|
|
+ private static List<Map<String,Object>> getMonthDays() {
|
|
|
String firsDayOfMonth = DateUtils.firsDayOfMonth();
|
|
|
String lastDayOfMonth = DateUtils.lastDayOfMonth();
|
|
|
- List<String> dates=new ArrayList<>();
|
|
|
+ List<Map<String,Object>> dates=new ArrayList<>();
|
|
|
|
|
|
String str=firsDayOfMonth.substring(0,firsDayOfMonth.lastIndexOf("-"));
|
|
|
- System.out.println(str);
|
|
|
+
|
|
|
for (int i=1; i<32;i++){
|
|
|
+ Map<String,Object> map=new HashMap<>();
|
|
|
String res;
|
|
|
if (i<10){
|
|
|
res=str+"-0"+i;
|
|
|
+
|
|
|
}else {
|
|
|
res=str+"-"+i;
|
|
|
}
|
|
|
- dates.add(res);
|
|
|
+ map.put("days",res);
|
|
|
+ map.put("week",DateUtils.getWeeks(res));
|
|
|
+ dates.add(map);
|
|
|
if (res.equals(lastDayOfMonth)){
|
|
|
break;
|
|
|
}
|