|
@@ -9,6 +9,7 @@ import com.uas.platform.b2c.trade.presale.dao.CollectionInfoDao;
|
|
|
import com.uas.platform.b2c.trade.presale.model.Collection;
|
|
import com.uas.platform.b2c.trade.presale.model.Collection;
|
|
|
import com.uas.platform.b2c.trade.presale.model.CollectionInfo;
|
|
import com.uas.platform.b2c.trade.presale.model.CollectionInfo;
|
|
|
import com.uas.platform.b2c.trade.presale.service.CollectionService;
|
|
import com.uas.platform.b2c.trade.presale.service.CollectionService;
|
|
|
|
|
+import com.uas.platform.b2c.trade.support.CodeType;
|
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
import com.uas.platform.b2c.trade.support.ResultMap;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.Type;
|
|
import com.uas.platform.core.model.Type;
|
|
@@ -88,18 +89,17 @@ public class CollectionServiceImpl implements CollectionService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String save(Collection store, String cmpuuid) {
|
|
|
|
|
- if ((!StringUtils.isEmpty(cmpuuid)) || (store.getComponentid() != null)) {
|
|
|
|
|
|
|
+ public ResultMap save(Collection store) {
|
|
|
|
|
+ if ((!StringUtils.isEmpty(store.getCmpuuid())) || (store.getComponentid() != null)) {
|
|
|
Component component = null;
|
|
Component component = null;
|
|
|
- if(!StringUtils.isEmpty(cmpuuid)) {
|
|
|
|
|
- component = componentDao.findByUuid(cmpuuid);
|
|
|
|
|
|
|
+ if(!StringUtils.isEmpty(store.getCmpuuid())) {
|
|
|
|
|
+ component = componentDao.findByUuid(store.getCmpuuid());
|
|
|
} else if (store.getComponentid() != null) {
|
|
} else if (store.getComponentid() != null) {
|
|
|
component = componentDao.findOne(store.getComponentid());
|
|
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());
|
|
store.setSpec(component.getDescription());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -115,7 +115,7 @@ public class CollectionServiceImpl implements CollectionService {
|
|
|
if (storeList.size() == 0) {
|
|
if (storeList.size() == 0) {
|
|
|
collectionDao.save(store);
|
|
collectionDao.save(store);
|
|
|
}else {
|
|
}else {
|
|
|
- return "repeat";
|
|
|
|
|
|
|
+ return new ResultMap(CodeType.NOT_PERMIT, "该信息已被收藏");
|
|
|
}
|
|
}
|
|
|
} else if (store.getKind() == 2) {
|
|
} else if (store.getKind() == 2) {
|
|
|
if (SystemSession.getUser().getEnterprise() != null){
|
|
if (SystemSession.getUser().getEnterprise() != null){
|
|
@@ -127,10 +127,10 @@ public class CollectionServiceImpl implements CollectionService {
|
|
|
if (storeList.size() == 0) {
|
|
if (storeList.size() == 0) {
|
|
|
collectionDao.save(store);
|
|
collectionDao.save(store);
|
|
|
}else {
|
|
}else {
|
|
|
- return "repeat";
|
|
|
|
|
|
|
+ return new ResultMap(CodeType.NOT_PERMIT, "该信息已被收藏");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return "success";
|
|
|
|
|
|
|
+ return ResultMap.success("成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|