|
@@ -3,12 +3,14 @@ package com.onemap.system.service.impl;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.onemap.common.core.utils.DateUtils;
|
|
|
+import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.utils.uuid.UUID;
|
|
|
import com.onemap.system.domain.TJscSql;
|
|
|
import com.onemap.system.mapper.TJscSqlMapper;
|
|
|
import com.onemap.system.service.ITJscSqlService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
/**
|
|
|
* 驾驶舱数据处理Service业务层处理
|
|
@@ -50,10 +52,15 @@ public class TJscSqlServiceImpl implements ITJscSqlService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int insertTJscSql(TJscSql tJscSql) {
|
|
|
tJscSql.setId(UUID.randomUUID().toString());
|
|
|
tJscSql.setCreateTime(DateUtils.getNowDate());
|
|
|
- return tJscSqlMapper.insertTJscSql(tJscSql);
|
|
|
+ int i = tJscSqlMapper.insertTJscSql(tJscSql);
|
|
|
+ if (i > 0 && StringUtils.isNotEmpty(tJscSql.getJscView())) {
|
|
|
+ handleView(tJscSql.getJscView());
|
|
|
+ }
|
|
|
+ return i;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -63,9 +70,14 @@ public class TJscSqlServiceImpl implements ITJscSqlService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int updateTJscSql(TJscSql tJscSql) {
|
|
|
tJscSql.setUpdateTime(DateUtils.getNowDate());
|
|
|
- return tJscSqlMapper.updateTJscSql(tJscSql);
|
|
|
+ int i = tJscSqlMapper.updateTJscSql(tJscSql);
|
|
|
+ if (i > 0 && StringUtils.isNotEmpty(tJscSql.getJscView())) {
|
|
|
+ handleView(tJscSql.getJscView());
|
|
|
+ }
|
|
|
+ return i;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -75,6 +87,7 @@ public class TJscSqlServiceImpl implements ITJscSqlService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int deleteTJscSqlByIds(String[] ids) {
|
|
|
return tJscSqlMapper.deleteTJscSqlByIds(ids);
|
|
|
}
|
|
@@ -86,7 +99,14 @@ public class TJscSqlServiceImpl implements ITJscSqlService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public int deleteTJscSqlById(String id) {
|
|
|
return tJscSqlMapper.deleteTJscSqlById(id);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private void handleView(String view) {
|
|
|
+ tJscSqlMapper.handleView(view);
|
|
|
+ }
|
|
|
+
|
|
|
}
|