|
@@ -136,13 +136,20 @@ public class CollectionController {
|
|
|
while (it.hasNext()){
|
|
while (it.hasNext()){
|
|
|
String uuid = it.next();
|
|
String uuid = it.next();
|
|
|
ComponentInfo componentInfo = componentInfoDao.findByUuid(uuid);
|
|
ComponentInfo componentInfo = componentInfoDao.findByUuid(uuid);
|
|
|
- Collection store = new Collection();
|
|
|
|
|
- store.setComponentid(componentInfo.getId());
|
|
|
|
|
- store.setUseruu(SystemSession.getUser().getUserUU());
|
|
|
|
|
- store.setEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
- store.setCreatetime(new Date());
|
|
|
|
|
- store.setKind(2);
|
|
|
|
|
- storeList.add(store);
|
|
|
|
|
|
|
+ if (componentInfo != null){
|
|
|
|
|
+ Collection store = new Collection();
|
|
|
|
|
+ store.setComponentid(componentInfo.getId());
|
|
|
|
|
+ store.setUseruu(SystemSession.getUser().getUserUU());
|
|
|
|
|
+ if (SystemSession.getUser().getEnterprise() != null){
|
|
|
|
|
+ store.setDissociative(Type.ENTERPRISING.value());
|
|
|
|
|
+ store.setEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ store.setDissociative(Type.PERSONAL.value());
|
|
|
|
|
+ }
|
|
|
|
|
+ store.setCreatetime(new Date());
|
|
|
|
|
+ store.setKind(2);
|
|
|
|
|
+ storeList.add(store);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
collectionService.save(storeList);
|
|
collectionService.save(storeList);
|
|
|
return "success";
|
|
return "success";
|
|
@@ -160,15 +167,17 @@ public class CollectionController {
|
|
|
String result = "success";
|
|
String result = "success";
|
|
|
if (StringUtils.hasText(str)) {
|
|
if (StringUtils.hasText(str)) {
|
|
|
Collection store = FastjsonUtils.fromJson(str, Collection.class);
|
|
Collection store = FastjsonUtils.fromJson(str, Collection.class);
|
|
|
- store.setUseruu(SystemSession.getUser().getUserUU());
|
|
|
|
|
- if (SystemSession.getUser().getEnterprise() != null) {
|
|
|
|
|
- store.setDissociative(Type.ENTERPRISING.value());
|
|
|
|
|
- store.setEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
- } else {
|
|
|
|
|
- store.setDissociative(Type.PERSONAL.value());
|
|
|
|
|
|
|
+ if (store.getComponentid() != null){
|
|
|
|
|
+ store.setUseruu(SystemSession.getUser().getUserUU());
|
|
|
|
|
+ if (SystemSession.getUser().getEnterprise() != null) {
|
|
|
|
|
+ store.setDissociative(Type.ENTERPRISING.value());
|
|
|
|
|
+ store.setEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ store.setDissociative(Type.PERSONAL.value());
|
|
|
|
|
+ }
|
|
|
|
|
+ store.setCreatetime(new Date());
|
|
|
|
|
+ result = collectionService.save(store);
|
|
|
}
|
|
}
|
|
|
- store.setCreatetime(new Date());
|
|
|
|
|
- result = collectionService.save(store);
|
|
|
|
|
}
|
|
}
|
|
|
System.out.println("result = " + result);
|
|
System.out.println("result = " + result);
|
|
|
return result;
|
|
return result;
|