|
|
@@ -16,11 +16,7 @@ import com.wordnik.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
@@ -189,20 +185,20 @@ public class CollectionController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/save", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "保存收藏信息", httpMethod = "POST")
|
|
|
- public String saveEntity(@ApiParam(required = true, value = "保存的json对象") @RequestBody String str) {
|
|
|
+ public String saveEntity(@ApiParam(required = true, value = "保存的json对象") @RequestBody String str, @RequestParam(defaultValue = "", required = false) String cmpuuid) {
|
|
|
String result = "success";
|
|
|
if (StringUtils.hasText(str)) {
|
|
|
Collection store = FastjsonUtils.fromJson(str, Collection.class);
|
|
|
- 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.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());
|
|
|
+ if ((store.getComponentid() != null) || (!StringUtils.isEmpty(cmpuuid))) {
|
|
|
+ result = collectionService.save(store, cmpuuid);
|
|
|
}
|
|
|
}
|
|
|
System.out.println("result = " + result);
|