|
@@ -10,6 +10,8 @@ import com.goer.common.command.impl.DBReverseGetAllTablesListImpl;
|
|
|
import com.goer.common.command.impl.PingLoadDriverClassImpl;
|
|
import com.goer.common.command.impl.PingLoadDriverClassImpl;
|
|
|
import com.goer.project.model.modelDbs.domain.ModelDbs;
|
|
import com.goer.project.model.modelDbs.domain.ModelDbs;
|
|
|
import com.goer.project.model.modelDbs.service.IModelDbsService;
|
|
import com.goer.project.model.modelDbs.service.IModelDbsService;
|
|
|
|
|
+import com.goer.project.model.modelField.domain.ModelField;
|
|
|
|
|
+import com.goer.project.model.modelField.service.IModelFieldService;
|
|
|
import com.goer.project.model.modelProject.domain.ModelProject;
|
|
import com.goer.project.model.modelProject.domain.ModelProject;
|
|
|
import com.goer.project.model.modelProject.service.IModelProjectService;
|
|
import com.goer.project.model.modelProject.service.IModelProjectService;
|
|
|
import com.goer.project.system.user.domain.User;
|
|
import com.goer.project.system.user.domain.User;
|
|
@@ -47,6 +49,9 @@ public class ModelEntityController extends BaseController
|
|
|
private IModelEntityService modelEntityService;
|
|
private IModelEntityService modelEntityService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private IModelFieldService modelFieldService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private IModelDbsService modelDbsService;
|
|
private IModelDbsService modelDbsService;
|
|
|
|
|
|
|
|
@RequiresPermissions("model:modelEntity:view")
|
|
@RequiresPermissions("model:modelEntity:view")
|
|
@@ -129,6 +134,46 @@ public class ModelEntityController extends BaseController
|
|
|
return toAjax(modelEntityService.insertModelEntity(modelEntity));
|
|
return toAjax(modelEntityService.insertModelEntity(modelEntity));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/copy/{id}")
|
|
|
|
|
+ public String copy(@PathVariable("id") Long id, ModelMap mmap)
|
|
|
|
|
+ {
|
|
|
|
|
+ ModelEntity modelEntity = modelEntityService.selectModelEntityById(id);
|
|
|
|
|
+ ModelProject modelProject = modelProjectService.selectModelProjectById(modelEntity.getProjectId());
|
|
|
|
|
+ modelProject.setOrgEntityid(id);
|
|
|
|
|
+ mmap.put("modelProject", modelProject);
|
|
|
|
|
+ return prefix + "/copy";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增保存数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequiresPermissions("model:modelEntity:add")
|
|
|
|
|
+ @Log(title = "数据", businessType = BusinessType.INSERT)
|
|
|
|
|
+ @PostMapping("/copy")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public AjaxResult copySave(ModelEntity modelEntity)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ ModelField condMf = new ModelField();
|
|
|
|
|
+ condMf.setEntityId(modelEntity.getOrgEntityId());
|
|
|
|
|
+ List<ModelField> mfs = modelFieldService.selectModelFieldList(condMf);
|
|
|
|
|
+
|
|
|
|
|
+ modelEntity.setVersionId(0L);
|
|
|
|
|
+ modelEntity.setParentVersionId(0L);
|
|
|
|
|
+ modelEntity.setCreateBy(getLoginName());
|
|
|
|
|
+ for (ModelField mf : mfs) {
|
|
|
|
|
+ mf.setCreateBy(getLoginName());
|
|
|
|
|
+ }
|
|
|
|
|
+ modelEntity.setFields(mfs);
|
|
|
|
|
+ modelEntityService.copyModelEntity(modelEntity);
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改数据
|
|
* 修改数据
|
|
|
*/
|
|
*/
|