|  |  | 
 |  |  | import com.doumee.core.model.LoginUserModel; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.core.utils.DateUtil; | 
 |  |  | import com.doumee.dao.business.ApproveParamMapper; | 
 |  |  | import com.doumee.dao.business.PlatformLogMapper; | 
 |  |  | import com.doumee.dao.business.YwQuickModelMapper; | 
 |  |  | import com.doumee.dao.business.model.YwQuickModel; | 
 |  |  | import com.doumee.dao.business.*; | 
 |  |  | import com.doumee.dao.business.model.*; | 
 |  |  | import com.doumee.dao.business.vo.MonthDataResponse; | 
 |  |  | import com.doumee.dao.business.vo.WorkDeskDataResponse; | 
 |  |  | import com.doumee.dao.system.join.NoticesJoinMapper; | 
 |  |  | import com.doumee.dao.system.model.Notices; | 
 |  |  | import com.doumee.dao.system.model.SystemUser; | 
 |  |  | import com.doumee.service.business.WorkbenchesService; | 
 |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
 |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
 |  |  | import io.jsonwebtoken.lang.Objects; | 
 |  |  | import io.swagger.models.auth.In; | 
 |  |  | import org.apache.tomcat.util.bcel.classfile.Constant; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private YwQuickModelMapper ywQuickModelMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private YwWorkorderMapper ywWorkorderMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private NoticesJoinMapper noticesJoinMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private YwPatrolTaskMapper ywPatrolTaskMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private YwStocktakingMapper ywStocktakingMapper; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |     public List<MonthDataResponse> getMonthNotices(String yearMonth, LoginUserInfo loginUserInfo){ | 
 |  |  |         List<String> dataList = DateUtil.getDayByMonth(yearMonth); | 
 |  |  |         List<MonthDataResponse> monthDataResponseList = new ArrayList<>(); | 
 |  |  |         List<Notices> noticesList = noticesJoinMapper.selectList(new QueryWrapper<Notices>().lambda() | 
 |  |  |                 .eq(Notices::getUserId,loginUserInfo.getId()) | 
 |  |  |                 .eq(Notices::getIsdeleted,Constants.ZERO) | 
 |  |  |                 .eq(Notices::getStatus,Constants.ZERO) | 
 |  |  |         ); | 
 |  |  |         for (String str:dataList) { | 
 |  |  |             MonthDataResponse  monthDataResponse = new MonthDataResponse(); | 
 |  |  |             monthDataResponse.setWeekMsg(DateUtil.getWeek(DateUtil.StringToDate(str,"yyyy-MM-dd")).getChineseName()); | 
 |  |  |             monthDataResponse.setMonthDate(str); | 
 |  |  |  | 
 |  |  |             if(CollectionUtils.isNotEmpty(noticesList)){ | 
 |  |  |                 monthDataResponse.setNoticeList(noticesList.stream().filter(i->i.getParam1().equals(str)).collect(Collectors.toList())); | 
 |  |  |             } | 
 |  |  |             monthDataResponseList.add(monthDataResponse); | 
 |  |  |         } | 
 |  |  |         return monthDataResponseList; | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public WorkDeskDataResponse workDeskData(LoginUserInfo loginUserInfo){ | 
 |  |  |         WorkDeskDataResponse workDeskDataResponse = new WorkDeskDataResponse(); | 
 |  |  |         workDeskDataResponse.setWaitDealWorkOrderSize(Constants.ZERO); | 
 |  |  |         workDeskDataResponse.setTimeOutSize(Constants.ZERO); | 
 |  |  |         workDeskDataResponse.setStocktakingSize(Constants.ZERO); | 
 |  |  |         workDeskDataResponse.setWaitTaskSize(Constants.ZERO); | 
 |  |  |  | 
 |  |  |         List<YwPatrolTask> ywPatrolTaskList = ywPatrolTaskMapper.selectJoinList(YwPatrolTask.class,new MPJLambdaWrapper<YwPatrolTask>() | 
 |  |  |                 .selectAll(YwPatrolTask.class) | 
 |  |  |                 .selectAs(YwPatrolScheme::getCode,YwPatrolTask::getPlanCode) | 
 |  |  |                 .selectAs(YwPatrolScheme::getTitle,YwPatrolTask::getPlanTitle) | 
 |  |  |                 .leftJoin(YwPatrolScheme.class,YwPatrolScheme::getId,YwPatrolTask::getSchemeId) | 
 |  |  |                 .eq(YwPatrolTask::getIsdeleted, Constants.ZERO) | 
 |  |  |                 .eq(YwPatrolScheme::getStatus, Constants.ZERO) | 
 |  |  |                 .in(YwPatrolTask::getStatus, Constants.ZERO, Constants.ONE) | 
 |  |  |                 .le(YwPatrolTask::getEndDate,DateUtil.getCurrDateTime()) | 
 |  |  |                 .apply(" find_in_set( "+loginUserInfo.getId()+" , t1.USER_IDS ) ") | 
 |  |  |         ); | 
 |  |  |         Integer waitTaskSize = ywPatrolTaskList.size(); | 
 |  |  |         Integer timeOutSize = Constants.ZERO; | 
 |  |  |         if(CollectionUtils.isNotEmpty(ywPatrolTaskList)){ | 
 |  |  |             timeOutSize = ywPatrolTaskList.stream().filter(i->(Constants.equalsInteger(i.getStatus(),Constants.ZERO) || Constants.equalsInteger(i.getStatus(),Constants.ONE) ) && | 
 |  |  |                     i.getEndDate().getTime()<System.currentTimeMillis()).collect(Collectors.toList()).size(); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         long waitDealWorkOrderSize = ywWorkorderMapper.selectCount(new QueryWrapper<YwWorkorder>().lambda() | 
 |  |  |                 .eq(YwWorkorder::getIsdeleted, Constants.ZERO) | 
 |  |  |                 .eq(YwWorkorder::getStatus,Constants.ZERO) | 
 |  |  |                 .eq(YwWorkorder::getDealStatus,Constants.ONE) | 
 |  |  |                 .eq(YwWorkorder::getDealUserId,loginUserInfo.getId()) | 
 |  |  |         ); | 
 |  |  |  | 
 |  |  |         long stocktakingSize = ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda() | 
 |  |  |                 .eq(YwStocktaking::getIsdeleted,Constants.ZERO) | 
 |  |  |                 .eq(YwStocktaking::getUserId,loginUserInfo.getId()) | 
 |  |  |                 .in(YwStocktaking::getStatus, Constants.ZERO, Constants.ONE) | 
 |  |  |         ); | 
 |  |  |         workDeskDataResponse.setTimeOutSize(timeOutSize); | 
 |  |  |         workDeskDataResponse.setWaitTaskSize(waitTaskSize); | 
 |  |  |         workDeskDataResponse.setWaitDealWorkOrderSize(waitDealWorkOrderSize); | 
 |  |  |         workDeskDataResponse.setStocktakingSize(stocktakingSize); | 
 |  |  |         return workDeskDataResponse; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  |