|
|
@@ -23,6 +23,8 @@ import com.ruoyi.project.mapper.ProjectStaffRecordLogMapper;
|
|
|
import com.ruoyi.project.mapper.ProjectStaffRecordMapper;
|
|
|
import com.ruoyi.project.mapper.ProjectTaskMapper;
|
|
|
import com.ruoyi.project.service.ProjectStaffRecordService;
|
|
|
+import com.ruoyi.system.domain.LegalHolidays;
|
|
|
+import com.ruoyi.system.mapper.LegalHolidaysMapper;
|
|
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
import com.ruoyi.system.service.impl.SysConfigServiceImpl;
|
|
|
@@ -69,6 +71,8 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
|
|
|
@Autowired
|
|
|
private SysConfigServiceImpl configService;
|
|
|
+ @Autowired
|
|
|
+ private LegalHolidaysMapper legalHolidaysMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -181,25 +185,69 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
* @param maxDuration 最大工时
|
|
|
*/
|
|
|
private void pushMyMonthDay(List<MyMonthDays> myMonthDays, ProjectTask projectTask, String date, BigDecimal maxDuration) {
|
|
|
+ List<LegalHolidays> legalHolidays = legalHolidaysMapper.selectAll();
|
|
|
+
|
|
|
for (MyMonthDays myMonthDay : myMonthDays) {
|
|
|
DateUtils.getWeeks(myMonthDay.getDates());
|
|
|
-// 0 =未到时限 1=满工时,2=未打卡,3=未满工时,4=不属于打卡区间
|
|
|
+// status 0=未打卡,1=未满工时,2=满工时
|
|
|
+// daystatus 0=正常,1=不属于打卡区间,2=未到时限,3=补班,4=法定节假日
|
|
|
+ pushLeaglHolidays(legalHolidays,myMonthDay);
|
|
|
if (compareTo(projectTask.getStartTime(),myMonthDay.getDates(),0)||compareTo(projectTask.getEndTime(),myMonthDay.getDates(),1)){
|
|
|
- myMonthDay.setStatus(4);
|
|
|
+ myMonthDay.setDayStatus(1);
|
|
|
myMonthDay.setDuration("0");
|
|
|
}else if (compareTo(date,myMonthDay.getDates())){
|
|
|
- myMonthDay.setStatus(0);
|
|
|
+ myMonthDay.setDayStatus(2);
|
|
|
}else if (myMonthDay.getDuration().equals("0")) {
|
|
|
- myMonthDay.setStatus(2);
|
|
|
+ myMonthDay.setStatus(0);
|
|
|
}else if (new BigDecimal(myMonthDay.getDuration()).compareTo(maxDuration)<0){
|
|
|
- myMonthDay.setStatus(3);
|
|
|
- }else if (new BigDecimal(myMonthDay.getDuration()).compareTo(maxDuration)>=0){
|
|
|
myMonthDay.setStatus(1);
|
|
|
- }else {
|
|
|
- myMonthDay.setStatus(5);
|
|
|
+ }else if (new BigDecimal(myMonthDay.getDuration()).compareTo(maxDuration)>=0){
|
|
|
+ myMonthDay.setStatus(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void pushLeaglHolidays(List<LegalHolidays> list, MyMonthDays myMonthDay) {
|
|
|
+ String dates = myMonthDay.getDates();
|
|
|
+ myMonthDay.setDayStatus(0);
|
|
|
+ List<HolidaysBo> boList=new ArrayList<>();
|
|
|
+ for (LegalHolidays e : list) {
|
|
|
+ String parseStr = DateUtils.parseStrYYYYnMMyDD(e.getHolidays());
|
|
|
+ HolidaysBo holidaysBo=new HolidaysBo();
|
|
|
+ holidaysBo.setDays(parseStr);
|
|
|
+ holidaysBo.setStatus(e.getStatus());
|
|
|
+ boList.add(holidaysBo);
|
|
|
+ }
|
|
|
+ for (HolidaysBo e : boList) {
|
|
|
+ if (dates.equals(e.getDays())){
|
|
|
+ if (e.getStatus()==1){
|
|
|
+ myMonthDay.setDayStatus(4);
|
|
|
+ }else if (e.getStatus()==2) {
|
|
|
+ myMonthDay.setDayStatus(3);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ class HolidaysBo{
|
|
|
+ private String days;
|
|
|
+ private Integer status;
|
|
|
+
|
|
|
+ public String getDays() {
|
|
|
+ return days;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setDays(String days) {
|
|
|
+ this.days = days;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer getStatus() {
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setStatus(Integer status) {
|
|
|
+ this.status = status;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@Override
|