|
@@ -1,11 +1,17 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.system.entity.DragTable;
|
|
|
import com.ruoyi.system.entity.DragTableGroup;
|
|
|
+import com.ruoyi.system.entity.vo.DragTableGroupVo;
|
|
|
+import com.ruoyi.system.entity.vo.DragTableVo;
|
|
|
import com.ruoyi.system.mapper.DragTableGroupMapper;
|
|
|
+import com.ruoyi.system.mapper.DragTableMapper;
|
|
|
import com.ruoyi.system.service.IDragTableGroupService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -21,6 +27,12 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
|
|
|
@Autowired
|
|
|
private DragTableGroupMapper dragTableGroupMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DragTableMapper dragTableMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private DragTableServiceImpl dragTableService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询拖拽格组
|
|
|
*
|
|
@@ -48,16 +60,23 @@ public class DragTableGroupServiceImpl implements IDragTableGroupService {
|
|
|
/**
|
|
|
* 新增拖拽格组
|
|
|
*
|
|
|
- * @param dragTableGroup 拖拽格组
|
|
|
+ * @param dragTableGroupVo 拖拽格组
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int insertDragTableGroup(DragTableGroup dragTableGroup)
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public int insertDragTableGroup(DragTableGroupVo dragTableGroupVo)
|
|
|
{
|
|
|
- dragTableGroup.setCreateTime(DateUtils.getNowDate());
|
|
|
+ //表格组实体类拷贝数据
|
|
|
+ DragTableGroup dragTableGroup=new DragTableGroup();
|
|
|
+ BeanUtils.copyProperties(dragTableGroupVo,dragTableGroup);
|
|
|
+ //添加动态表格列表
|
|
|
+ List<DragTableVo> dragTables = dragTableGroupVo.getDragTables();
|
|
|
+ dragTables.forEach(item->{
|
|
|
+ dragTableService.addDragTable(item);
|
|
|
+ });
|
|
|
return dragTableGroupMapper.insertDragTableGroup(dragTableGroup);
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 修改拖拽格组
|
|
|
*
|