增加 定时任务创建巡检
parent
2692d5f280
commit
e512f702d3
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.api.service.impl;
|
||||
|
||||
import com.ruoyi.api.domain.CheckTaskInfo;
|
||||
import com.ruoyi.api.mapper.ApiMapper;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.manage.domain.RecordInspection;
|
||||
import com.ruoyi.manage.mapper.RecordInspectionMapper;
|
||||
import com.ruoyi.manage.service.IRecordInspectionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Component("TaskService")
|
||||
public class TaskService {
|
||||
|
||||
@Autowired
|
||||
private ApiMapper mapper;
|
||||
@Autowired
|
||||
private RecordInspectionMapper recordInspectionMapper;
|
||||
|
||||
//定时任务创建巡检单
|
||||
public void inspectionCreate(){
|
||||
System.out.println("创建成功");
|
||||
int number=recordInspectionMapper.countInsertRecordNumber();
|
||||
number++;
|
||||
RecordInspection recordInspection = new RecordInspection();
|
||||
recordInspection.setInspectionCode(DateUtils.parseDateToStr("yyyyMMdd",new Date())+"00"+number);
|
||||
System.out.println();
|
||||
//插入主表
|
||||
int insertNumber = recordInspectionMapper.insertRecordInspection(recordInspection);
|
||||
List<CheckTaskInfo> list = mapper.selectLocationFromLedger();
|
||||
mapper.insertCheckTask(Math.toIntExact(recordInspection.getInspectionId()), list);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue