|
@@ -10,6 +10,7 @@ import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+import com.xt.dsp.common.util.CommonUtil;
|
|
|
import com.xt.dsp.common.util.ConstUtil;
|
|
|
import com.xt.dsp.model.DataSourceBean;
|
|
|
import com.xt.dsp.service.DataSourceService;
|
|
@@ -63,12 +64,14 @@ public class DatasourceCtl {
|
|
|
public DataSourceBean saveDataSource(Model model,DataSourceVo vo) {
|
|
|
DataSourceBean saveBean = new DataSourceBean();
|
|
|
// 新增
|
|
|
- if(ConstUtil.OPER_ADD.equals(vo.getOpt())) {
|
|
|
+ if (StringUtils.isNullOrEmpty(vo.getId())) {
|
|
|
BeanUtils.copyProperties(vo, saveBean);
|
|
|
+ saveBean.setId(CommonUtil.getUUID());
|
|
|
datasourceService.insert(saveBean);
|
|
|
} else {
|
|
|
// 修改
|
|
|
saveBean = datasourceService.selectByPrimaryKey(vo.getId());
|
|
|
+ saveBean.setCode(vo.getCode());
|
|
|
saveBean.setUrl(vo.getUrl());
|
|
|
saveBean.setDriverclassname(vo.getDriverclassname());
|
|
|
saveBean.setUsername(vo.getUsername());
|