package com.iailab.module.model.mcs.sche.service.impl; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.sche.dao.StScheduleRecordDao; import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity; import com.iailab.module.model.mcs.sche.service.StScheduleRecordDetailService; import com.iailab.module.model.mcs.sche.service.StScheduleRecordService; import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO; import com.iailab.module.model.mdk.vo.ScheduleResultVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; import java.util.UUID; /** * @author PanZhibao * @Description * @createTime 2024年09月06日 */ @Service public class StScheduleRecordServiceImpl extends BaseServiceImpl implements StScheduleRecordService { @Autowired private StScheduleRecordDetailService stScheduleRecordDetailService; @Override public PageResult page(StScheduleRecordPageReqVO reqVO) { return baseDao.selectPage(reqVO); } @Override @DSTransactional(rollbackFor = Exception.class) public void create(ScheduleResultVO resultVO) { StScheduleRecordEntity entity = new StScheduleRecordEntity(); entity.setId(UUID.randomUUID().toString()); entity.setCreateTime(new Date()); entity.setSchemeId(resultVO.getSchemeId()); entity.setScheduleTime(resultVO.getScheduleTime()); entity.setModelId(resultVO.getModelId()); baseDao.insert(entity); stScheduleRecordDetailService.create(entity.getId(), resultVO); } }