|
|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.ruoyi.platform.service.impl; |
|
|
|
|
|
|
|
import com.google.gson.Gson; |
|
|
|
import com.ruoyi.common.security.utils.DictUtils; |
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils; |
|
|
|
import com.ruoyi.platform.domain.Component; |
|
|
|
@@ -20,6 +21,8 @@ import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import static com.ruoyi.platform.utils.GsonUtil.gson; |
|
|
|
|
|
|
|
/** |
|
|
|
* (Component)表服务实现类 |
|
|
|
* |
|
|
|
@@ -96,11 +99,17 @@ public class ComponentServiceImpl implements ComponentService { |
|
|
|
@Override |
|
|
|
public Component insert(ComponentVo componentVo) { |
|
|
|
//把那几个Object转成String类型 |
|
|
|
Gson gson = new Gson(); |
|
|
|
Component component = ConvertUtil.entityToVo(componentVo, Component.class); |
|
|
|
component.setControlStrategy(controlStrategy.toString()); |
|
|
|
component.setEnvVirables(componentVo.getEnvVirables().toString()); |
|
|
|
component.setInParameters(componentVo.getInParameters().toString()); |
|
|
|
component.setOutParameters(componentVo.getOutParameters().toString()); |
|
|
|
component.setControlStrategy(controlStrategy); |
|
|
|
|
|
|
|
//json转换,存数据库 |
|
|
|
String inParameters= gson.toJson(componentVo.getInParameters(), LinkedHashMap.class); |
|
|
|
String outParameters = gson.toJson(componentVo.getOutParameters(), LinkedHashMap.class); |
|
|
|
String envVariable = gson.toJson(componentVo.getEnvVirables(), LinkedHashMap.class); |
|
|
|
component.setEnvVirables(envVariable); |
|
|
|
component.setInParameters(inParameters); |
|
|
|
component.setOutParameters(outParameters); |
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
|
component.setCreateBy(loginUser.getUsername()); |
|
|
|
component.setUpdateBy(loginUser.getUsername()); |
|
|
|
|