Authored by qinchao

工单处理添加数据库事物

... ... @@ -15,10 +15,12 @@ import com.monitor.other.worksystem.contants.HandlerRole;
import com.monitor.other.worksystem.contants.WorkStatus;
import com.monitor.other.worksystem.contants.WorkType;
import com.monitor.other.worksystem.service.DBService;
import com.yoho.core.dal.datasource.annotation.Database;
import org.apache.commons.lang.StringUtils;
import org.influxdb.dto.QueryResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
... ... @@ -112,6 +114,8 @@ public class DBServiceImpl implements DBService {
}
@Override
@Transactional
@Database(DataSource = "yh_ops")
public int dealWorkJob(HandledJob handledJob) {
//查询待处理工单是否还存在
PendingJob pendingJob = pendingJobMapper.selectByid(handledJob.getId());
... ...
... ... @@ -16,9 +16,11 @@ import com.monitor.other.worksystem.contants.HandlerRole;
import com.monitor.other.worksystem.contants.WorkStatus;
import com.monitor.other.worksystem.contants.WorkType;
import com.monitor.other.worksystem.service.ReleaseService;
import com.yoho.core.dal.datasource.annotation.Database;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
... ... @@ -142,6 +144,8 @@ public class ReleaseServiceImpl implements ReleaseService {
}
@Override
@Transactional
@Database(DataSource = "yh_ops")
public int dealWorkJob(HandledJob handledJob) {
//查询待处理工单是否还存在
PendingJob pendingJob = pendingJobMapper.selectByid(handledJob.getId());
... ...