|
@@ -126,8 +126,14 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
@Override
|
|
|
public TuiCalendar getTuiCalendar(CheckJobDTO model) {
|
|
|
TuiCalendar tuiCalendar = new TuiCalendar();
|
|
|
- model.setSearchStartTime(DateUtils.getFirstDayOfThisMonth());
|
|
|
+ // model.setSearchStartTime(DateUtils.getFirstDayOfThisMonth());
|
|
|
model.setSearchEndTime(DateUtils.getLastDayOfThisMonth());
|
|
|
+
|
|
|
+ if(SecurityUtils.isRole(SysRoleCodeEnum.Opreator.name())|| SecurityUtils.isRole(SysRoleCodeEnum.Maintenance.name())){
|
|
|
+ model.setCheckUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ }else if(SecurityUtils.isRole(SysRoleCodeEnum.MM.name()) ){
|
|
|
+ // 默认维修主管看到是全部的,默认也是全部的
|
|
|
+ }
|
|
|
List<CheckJobVO> voList = mapper.selectList(model);
|
|
|
|
|
|
tuiCalendar.setCalendarList(TuiCalendarUtil.getCalendarInfoList());
|
|
@@ -658,12 +664,11 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
}
|
|
|
if (CheckPlanPeriodTypeEnum.DAY.getValue().equals(checkStandard.getPeriodType())) {
|
|
|
startDate = DateUtils.plus(localDateTime.toLocalDate(), checkStandard.getPeriod(), ChronoUnit.DAYS);
|
|
|
- endDate = DateUtils.plus(localDateTime.toLocalDate(), checkStandard.getPeriod() + 2, ChronoUnit.DAYS);
|
|
|
+ endDate = DateUtils.plus(startDate, checkStandard.getPeriod() + 2, ChronoUnit.DAYS);
|
|
|
}
|
|
|
if (CheckPlanPeriodTypeEnum.WEEK.getValue().equals(checkStandard.getPeriodType())) {
|
|
|
startDate = DateUtils.plus(localDateTime.toLocalDate(), checkStandard.getPeriod() * 7, ChronoUnit.DAYS);
|
|
|
- endDate = DateUtils.plus(localDateTime.toLocalDate(), checkStandard.getPeriod() * 7 + 2, ChronoUnit.DAYS);
|
|
|
-
|
|
|
+ endDate = DateUtils.plus(startDate, checkStandard.getPeriod() * 7 + 2, ChronoUnit.DAYS);
|
|
|
}
|
|
|
if (CheckPlanPeriodTypeEnum.MONTH.getValue().equals(checkStandard.getPeriodType())) {
|
|
|
startDate = DateUtils.plus(localDateTime.toLocalDate(), checkStandard.getPeriod(), ChronoUnit.MONTHS);
|
|
@@ -684,6 +689,26 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
checkStandard.setNextDate(endDate);
|
|
|
}
|
|
|
|
|
|
+ public LocalDate getCheckJobEndDate(LocalDate startDate, Integer period, Integer periodType){
|
|
|
+ LocalDate endDate = null;
|
|
|
+ if (CheckPlanPeriodTypeEnum.DAY.getValue().equals(periodType)) {
|
|
|
+ endDate = DateUtils.plus(startDate, 0, ChronoUnit.DAYS);
|
|
|
+ }
|
|
|
+ if (CheckPlanPeriodTypeEnum.WEEK.getValue().equals(periodType)) {
|
|
|
+ endDate = DateUtils.plus(startDate, 2, ChronoUnit.DAYS);
|
|
|
+ }
|
|
|
+ if (CheckPlanPeriodTypeEnum.MONTH.getValue().equals(periodType)) {
|
|
|
+ endDate = DateUtils.plus(startDate, 10, ChronoUnit.DAYS);
|
|
|
+ }
|
|
|
+ if (CheckPlanPeriodTypeEnum.SEASON.getValue().equals(periodType)) {
|
|
|
+ endDate = DateUtils.plus(startDate, 20, ChronoUnit.DAYS);
|
|
|
+ }
|
|
|
+ if (CheckPlanPeriodTypeEnum.YEAR.getValue().equals(periodType)) {
|
|
|
+ endDate = DateUtils.plus(startDate, 60, ChronoUnit.DAYS);
|
|
|
+ }
|
|
|
+ return endDate;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public CheckJobVO getDetail(Object id) {
|
|
|
CheckJobVO vo = mapper.selectDetail(id);
|
|
@@ -906,7 +931,11 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
public int countSbUserTask(String sbId, String userId, Integer type ) {
|
|
|
Weekend<CheckJob> weekend = new Weekend<>(CheckJob.class);
|
|
|
WeekendCriteria<CheckJob, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
- weekendCriteria.andEqualTo(CheckJob::getSbId, sbId);
|
|
|
+ if(StringUtils.isNotBlank(sbId)){
|
|
|
+ weekendCriteria.andEqualTo(CheckJob::getSbId, sbId);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 截止到当天的任务
|
|
|
weekendCriteria.andLessThan(CheckJob::getStartTime, DateUtils.getTodayEndTime());
|
|
|
if(StringUtils.isNotBlank(userId)){
|
|
|
weekendCriteria.andEqualTo(CheckJob::getCheckUserId, userId);
|