|
@@ -89,10 +89,18 @@ public class CollectionServiceImpl implements CollectionService {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String save(Collection store, String cmpuuid) {
|
|
public String save(Collection store, String cmpuuid) {
|
|
|
- if (!StringUtils.isEmpty(cmpuuid)) {
|
|
|
|
|
- Component component = componentDao.findByUuid(cmpuuid);
|
|
|
|
|
|
|
+ if ((!StringUtils.isEmpty(cmpuuid)) || (store.getComponentid() != null)) {
|
|
|
|
|
+ Component component = null;
|
|
|
|
|
+ if(!StringUtils.isEmpty(cmpuuid)) {
|
|
|
|
|
+ component = componentDao.findByUuid(cmpuuid);
|
|
|
|
|
+ } else if (store.getComponentid() != null) {
|
|
|
|
|
+ component = componentDao.findOne(store.getComponentid());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (component != null) {
|
|
if (component != null) {
|
|
|
store.setComponentid(component.getId());
|
|
store.setComponentid(component.getId());
|
|
|
|
|
+ store.setCmpuuid(cmpuuid);
|
|
|
|
|
+ store.setSpec(component.getDescription());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
List<Collection> storeList = new ArrayList<Collection>();
|
|
List<Collection> storeList = new ArrayList<Collection>();
|