|
@@ -12,6 +12,7 @@ import java.util.stream.Stream;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.transaction.Transactional;
|
|
|
|
|
|
import org.apache.commons.fileupload.FileItem;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
@@ -56,6 +57,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
/**
|
|
|
* 机构服务API Created by songyue on 17/1/14.
|
|
|
*/
|
|
|
+@Transactional
|
|
|
@RestController
|
|
|
@RequestMapping("${$rmp.ctr.basic}/org")
|
|
|
public class OrgController extends ControllerSupport {
|
|
@@ -179,7 +181,8 @@ public class OrgController extends ControllerSupport {
|
|
|
public Org addRootOrg(@RequestBody Org org, HttpServletRequest request) {
|
|
|
org.setCreateTime(new Date());
|
|
|
org.setParentId(null);
|
|
|
- org.setRootId(null);
|
|
|
+ // 临时
|
|
|
+ org.setRootId(-1L);
|
|
|
Org saved = orgService.save(org);
|
|
|
saved.setRootId(saved.getId());
|
|
|
saved = orgService.save(org);
|