| | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.common.util.UUIDGenerator; |
| | | import org.jeecg.modules.eam.entity.PredictiveWorkPlan; |
| | | import org.jeecg.modules.eam.mapper.PredictiveWorkPlanMapper; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanParameterService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanSparePartService; |
| | | import org.jeecg.modules.eam.service.IPredictiveWorkPlanWarnService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | @Service |
| | | public class PredictiveWorkPlanServiceImpl extends ServiceImpl<PredictiveWorkPlanMapper, PredictiveWorkPlan> implements IPredictiveWorkPlanService { |
| | | |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IPredictiveWorkPlanWarnService predictiveWorkPlanWarnService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IPredictiveWorkPlanSparePartService predictiveWorkPlanSparePartService; |
| | | |
| | | @Autowired |
| | | @Lazy |
| | | private IPredictiveWorkPlanParameterService predictiveWorkPlanParameterService; |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> pagePredictiveWorkPlan(Integer pageNo, Integer pageSize, Map<String, Object> params) { |
| | |
| | | lambdaQuery.eq(PredictiveWorkPlan::getMonitorType,monitorType); |
| | | return lambdaQuery.list(); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | PredictiveWorkPlan predictiveWorkPlan = this.getById(id); |
| | | if (!"1".equals(predictiveWorkPlan.getStatus())) { |
| | | ExceptionCast.cast("该方案不是未生效状态,不能删除!"); |
| | | } |
| | | this.removeById(id); |
| | | predictiveWorkPlanWarnService.removeByWorkPlanId(id); |
| | | predictiveWorkPlanSparePartService.removeByWorkPlanId(id); |
| | | predictiveWorkPlanParameterService.removeByWorkPlanId(id); |
| | | } |
| | | |
| | | @Override |
| | | public void revise(PredictiveWorkPlan predictiveWorkPlan) { |
| | | String oldWorkPlanId = predictiveWorkPlan.getId(); |
| | | predictiveWorkPlan.setId(UUIDGenerator.generate()); |
| | | this.save(predictiveWorkPlan); |
| | | predictiveWorkPlanWarnService.revise(oldWorkPlanId,predictiveWorkPlan.getId()); |
| | | predictiveWorkPlanSparePartService.revise(oldWorkPlanId,predictiveWorkPlan.getId()); |
| | | predictiveWorkPlanParameterService.revise(oldWorkPlanId,predictiveWorkPlan.getId()); |
| | | } |
| | | } |