|
@@ -12,7 +12,6 @@ import com.rongwei.bsentity.domain.*;
|
|
|
import com.rongwei.bsentity.dto.BatchCreateDTO;
|
|
|
import com.rongwei.bsentity.dto.PlanYearCopyDTO;
|
|
|
import com.rongwei.bsentity.dto.TaskCreatorDTO;
|
|
|
-import com.rongwei.bsentity.enums.EquipmentTypeEnum;
|
|
|
import com.rongwei.bsentity.enums.MaintenanceTypeEnum;
|
|
|
import com.rongwei.bsentity.enums.PlannedStatusEnum;
|
|
|
import com.rongwei.bsentity.enums.PlantEnum;
|
|
@@ -67,7 +66,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
|
|
|
/**
|
|
|
* 发布任务
|
|
|
*
|
|
|
- * @param taskCreator 入参
|
|
|
+ * @param taskCreators 入参
|
|
|
* @return {@link R}
|
|
|
* @date 2023/11/27 16:25
|
|
|
* @author shangmi
|
|
@@ -75,7 +74,10 @@ public class MaintenanceServiceImpl implements MaintenanceService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public R saveTask(TaskCreatorDTO taskCreator) {
|
|
|
+ public R saveTask(List<TaskCreatorDTO> taskCreators) {
|
|
|
+
|
|
|
+ for(TaskCreatorDTO taskCreator:taskCreators){
|
|
|
+
|
|
|
// 查询主表信息
|
|
|
EquMaintenanceScheduleDo maintenanceSchedule = maintenanceScheduleService.getMaintenanceSiteByList(taskCreator);
|
|
|
// 查询子表信息
|
|
@@ -104,11 +106,12 @@ public class MaintenanceServiceImpl implements MaintenanceService {
|
|
|
}
|
|
|
maintenanceScheduleService.updatePlannedstatusByIds(Collections.singletonList(maintenanceSchedule.getId()), PlannedStatusEnum.PUBLISHED_TASK);
|
|
|
// 判断是否全部插入成功
|
|
|
- if (number == equMaintenanceTaskDos.size()) {
|
|
|
- return R.ok();
|
|
|
- } else {
|
|
|
- return R.ok("数据添加不完整,请核对数据!");
|
|
|
+ if (number != equMaintenanceTaskDos.size()) {
|
|
|
+ return R.error("数据添加不完整,请核对数据!");
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ return R.ok();
|
|
|
}
|
|
|
|
|
|
/**
|