|
@@ -1,12 +1,14 @@
|
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.rongwei.bscommon.sys.dao.EquMaintenanceScheduleDao;
|
|
|
import com.rongwei.bscommon.sys.service.EquMaintenanceScheduleService;
|
|
|
import com.rongwei.bsentity.domain.EquMaintenanceScheduleDo;
|
|
|
import com.rongwei.bsentity.dto.BatchCreateDTO;
|
|
|
import com.rongwei.bsentity.dto.TaskCreatorDTO;
|
|
|
+import com.rongwei.bsentity.enums.PlannedStatusEnum;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -78,14 +80,33 @@ public class EquMaintenanceScheduleServiceImpl extends ServiceImpl<EquMaintenanc
|
|
|
return maintenanceScheduleDao.selectList(queryWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询该年下当前工厂的计划
|
|
|
+ *
|
|
|
+ * @param oldYear
|
|
|
+ * @param tenantId
|
|
|
+ * @return {@link List<EquMaintenanceScheduleDo>}
|
|
|
+ * @date 2023/12/13 10:06
|
|
|
+ * @author shangmi
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
- public List<EquMaintenanceScheduleDo> getYearByList(int oldYear, String tenantId) {
|
|
|
+ public List<EquMaintenanceScheduleDo> getYearAndTenantIdByList(int oldYear, String tenantId) {
|
|
|
LambdaQueryWrapper<EquMaintenanceScheduleDo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(EquMaintenanceScheduleDo::getPlanyear,oldYear)
|
|
|
.eq(EquMaintenanceScheduleDo::getTenantid,tenantId);
|
|
|
return maintenanceScheduleDao.selectList(queryWrapper);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过ID查询记录表
|
|
|
+ *
|
|
|
+ * @param masterIds
|
|
|
+ * @return {@link List< EquMaintenanceScheduleDo>}
|
|
|
+ * @date 2023/12/13 10:06
|
|
|
+ * @author shangmi
|
|
|
+ *
|
|
|
+ */
|
|
|
@Override
|
|
|
public List<EquMaintenanceScheduleDo> getListByIds(List<String> masterIds) {
|
|
|
LambdaQueryWrapper<EquMaintenanceScheduleDo> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -93,4 +114,29 @@ public class EquMaintenanceScheduleServiceImpl extends ServiceImpl<EquMaintenanc
|
|
|
.eq(EquMaintenanceScheduleDo::getDeleted,0);
|
|
|
return maintenanceScheduleDao.selectList(queryWrapper);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 根据用户ID修改计划状态
|
|
|
+ *
|
|
|
+ * @param strings
|
|
|
+ * @param plannedStatusEnum
|
|
|
+ * @return
|
|
|
+ * @date 2023/12/13 10:07
|
|
|
+ * @author shangmi
|
|
|
+ *
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void updatePlannedstatusByIds(List<String> strings, PlannedStatusEnum plannedStatusEnum) {
|
|
|
+ LambdaUpdateWrapper<EquMaintenanceScheduleDo> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.in(EquMaintenanceScheduleDo::getId,strings)
|
|
|
+ .set(EquMaintenanceScheduleDo::getPlannedstatus,plannedStatusEnum.getValue());
|
|
|
+ maintenanceScheduleDao.update(null,updateWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<EquMaintenanceScheduleDo> getYearByList(int year) {
|
|
|
+ LambdaQueryWrapper<EquMaintenanceScheduleDo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(EquMaintenanceScheduleDo::getPlanyear,year)
|
|
|
+ .eq(EquMaintenanceScheduleDo::getDeleted,0);
|
|
|
+ return maintenanceScheduleDao.selectList(queryWrapper);
|
|
|
+ }
|
|
|
}
|