|
|
@@ -36,11 +36,11 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Validator;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.File;
|
|
|
-import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
+import java.util.stream.Collectors;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
@@ -150,14 +150,16 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AjaxResult myDurationMonth(Long id) {
|
|
|
+ public AjaxResult myDurationMonth(Long id,Integer year,Integer month) {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
ProjectTask projectTask = projectTaskMapper.selectByPrimaryKey(id);
|
|
|
BigDecimal maxDuration= new BigDecimal(loginUser.getUser().getDept().getMaxDuration());
|
|
|
String date=DateUtils.getDate();
|
|
|
+ String firsDayOfMonth=DateUtils.firsDayOfMonth(year,month);
|
|
|
+ String lastDayOfMonth=DateUtils.lastDayOfMonth(year,month);
|
|
|
Long aid=loginUser.getUserId();
|
|
|
- List<MyMonthDays> myMonthDays = projectStaffRecordMapper.myDurationMonth(id, aid, DateUtils.firsDayOfMonth(), DateUtils.lastDayOfMonth() + " 23:59:59");
|
|
|
- supplementMyMonthDays(myMonthDays);
|
|
|
+ List<MyMonthDays> myMonthDays = projectStaffRecordMapper.myDurationMonth(id, aid,firsDayOfMonth,lastDayOfMonth + " 23:59:59");
|
|
|
+ supplementMyMonthDays(myMonthDays,firsDayOfMonth,lastDayOfMonth);
|
|
|
for (MyMonthDays myMonthDay : myMonthDays) {
|
|
|
DateUtils.getWeeks(myMonthDay.getDates());
|
|
|
// 0 =未到时限 1=满工时,2=未打卡,3=未满工时,4=不属于打卡区间
|
|
|
@@ -285,14 +287,16 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private void supplementMyMonthDays(List<MyMonthDays> myMonthDays) {
|
|
|
- List<Map<String,Object>> monthDays = getMonthDays();
|
|
|
+ private void supplementMyMonthDays(List<MyMonthDays> myMonthDays, String firsDayOfMonth, String lastDayOfMonth) {
|
|
|
+ List<Map<String,Object>> monthDays = getMonthDays(firsDayOfMonth,lastDayOfMonth);
|
|
|
+ List<MyMonthDays> list=new ArrayList<MyMonthDays>();
|
|
|
for ( Map<String,Object> map : monthDays) {
|
|
|
boolean flag= true;
|
|
|
for (MyMonthDays myMonthDay : myMonthDays) {
|
|
|
if (map.get("days").equals(myMonthDay.getDates())){
|
|
|
flag=false;
|
|
|
myMonthDay.setWeek((Integer) map.get("week"));
|
|
|
+ list.add(myMonthDay);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -302,18 +306,16 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
mmd.setWeek((Integer) map.get("week"));
|
|
|
mmd.setDuration("0");
|
|
|
mmd.setStatus(0);
|
|
|
- myMonthDays.add(mmd);
|
|
|
+ list.add(mmd);
|
|
|
}
|
|
|
}
|
|
|
+ myMonthDays.clear();
|
|
|
+ myMonthDays.addAll(list);
|
|
|
}
|
|
|
|
|
|
- private static List<Map<String,Object>> getMonthDays() {
|
|
|
- String firsDayOfMonth = DateUtils.firsDayOfMonth();
|
|
|
- String lastDayOfMonth = DateUtils.lastDayOfMonth();
|
|
|
+ private static List<Map<String,Object>> getMonthDays(String firsDayOfMonth, String lastDayOfMonth) {
|
|
|
List<Map<String,Object>> dates=new ArrayList<>();
|
|
|
-
|
|
|
String str=firsDayOfMonth.substring(0,firsDayOfMonth.lastIndexOf("-"));
|
|
|
-
|
|
|
for (int i=1; i<32;i++){
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
String res;
|