提交 328b28b4 编写于 作者: llz's avatar llz

avue-data大屏新增成功

上级 cbe03654
...@@ -94,7 +94,7 @@ export const addObj = (data) => { ...@@ -94,7 +94,7 @@ export const addObj = (data) => {
data.status = 1; data.status = 1;
} }
request({ request({
url: url + '/bladevisuals/save', url: url + '/bladevisuals',
method: 'post', method: 'post',
data: { data: {
password: data.password, password: data.password,
...@@ -120,7 +120,7 @@ export const addObj = (data) => { ...@@ -120,7 +120,7 @@ export const addObj = (data) => {
res.code = 200; res.code = 200;
res.msg = "操作成功!"; res.msg = "操作成功!";
res.success = response; res.success = response;
res.data = {id: data.id}; res.data = {id: response.data.id};
} }
resolve({data: res}); resolve({data: res});
}).catch((response) => { }).catch((response) => {
......
package cn.ibizlab.core.avuedata.extensions; package cn.ibizlab.core.avuedata.extensions.service;
import cn.ibizlab.core.avuedata.domain.BladeVisual; import cn.ibizlab.core.avuedata.domain.BladeVisual;
import cn.ibizlab.core.avuedata.domain.BladeVisualConfig; import cn.ibizlab.core.avuedata.domain.BladeVisualConfig;
import cn.ibizlab.core.avuedata.service.IBladeVisualConfigService; import cn.ibizlab.core.avuedata.service.IBladeVisualConfigService;
import cn.ibizlab.core.avuedata.service.impl.BladeVisualServiceImpl; import cn.ibizlab.core.avuedata.service.impl.BladeVisualServiceImpl;
import cn.ibizlab.util.helper.CachedBeanCopier;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -14,7 +15,7 @@ public class BladeVisualServiceImplImpl extends BladeVisualServiceImpl { ...@@ -14,7 +15,7 @@ public class BladeVisualServiceImplImpl extends BladeVisualServiceImpl {
@Autowired @Autowired
IBladeVisualConfigService iBladeVisualConfigService; IBladeVisualConfigService iBladeVisualConfigService;
/*
@Override @Override
public boolean saveOrUpdate(BladeVisual et) { public boolean saveOrUpdate(BladeVisual et) {
if (null == et) { if (null == et) {
...@@ -25,6 +26,21 @@ public class BladeVisualServiceImplImpl extends BladeVisualServiceImpl { ...@@ -25,6 +26,21 @@ public class BladeVisualServiceImplImpl extends BladeVisualServiceImpl {
bladeVisualConfig.setDetail(et.getDetail()); bladeVisualConfig.setDetail(et.getDetail());
return (iBladeVisualConfigService.save(bladeVisualConfig) && checkKey(et) ? this.update(et) : this.create(et)); return (iBladeVisualConfigService.save(bladeVisualConfig) && checkKey(et) ? this.update(et) : this.create(et));
} }
}*/
@Override
public boolean create(BladeVisual et) {
if(!this.retBool(this.baseMapper.insert(et))) {
return false;
}
BladeVisualConfig bladeVisualConfig = new BladeVisualConfig();
bladeVisualConfig.setComponent(et.getComponent());
bladeVisualConfig.setDetail(et.getDetail());
bladeVisualConfig.setId(et.getId());
bladeVisualConfig.setVisualid(et.getId());
CachedBeanCopier.copy(get(et.getId()), et);
iBladeVisualConfigService.create(bladeVisualConfig);
return true;
} }
@Override @Override
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册