潘志宝
2024-12-03 51c1c2c9fa28fb1765dd6e81c70b78566792aebe
提交 | 用户 | 时间
bbc1ee 1 package com.iailab.module.model.mcs.sche.service.impl;
2
3de266 3 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
bbc1ee 4 import com.iailab.framework.common.pojo.PageResult;
5 import com.iailab.framework.common.service.impl.BaseServiceImpl;
6 import com.iailab.module.model.mcs.sche.dao.StScheduleRecordDao;
7 import com.iailab.module.model.mcs.sche.entity.StScheduleRecordEntity;
8 import com.iailab.module.model.mcs.sche.service.StScheduleRecordDetailService;
9 import com.iailab.module.model.mcs.sche.service.StScheduleRecordService;
10 import com.iailab.module.model.mcs.sche.vo.StScheduleRecordPageReqVO;
11 import com.iailab.module.model.mdk.vo.ScheduleResultVO;
12 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Service;
14
15 import java.util.Date;
16 import java.util.UUID;
17
18 /**
19  * @author PanZhibao
20  * @Description
21  * @createTime 2024年09月06日
22  */
23 @Service
24 public class StScheduleRecordServiceImpl extends BaseServiceImpl<StScheduleRecordDao, StScheduleRecordEntity>
25         implements StScheduleRecordService {
26
27     @Autowired
28     private StScheduleRecordDetailService stScheduleRecordDetailService;
29
30     @Override
31     public PageResult<StScheduleRecordEntity> page(StScheduleRecordPageReqVO reqVO) {
32         return baseDao.selectPage(reqVO);
33     }
34
35     @Override
3de266 36     @DSTransactional(rollbackFor = Exception.class)
bbc1ee 37     public void create(ScheduleResultVO resultVO) {
38         StScheduleRecordEntity entity = new StScheduleRecordEntity();
39         entity.setId(UUID.randomUUID().toString());
40         entity.setCreateTime(new Date());
41         entity.setSchemeId(resultVO.getSchemeId());
42         entity.setScheduleTime(resultVO.getScheduleTime());
43         entity.setModelId(resultVO.getModelId());
44         baseDao.insert(entity);
45         stScheduleRecordDetailService.create(entity.getId(), resultVO);
46     }
47 }