|
@@ -3,12 +3,16 @@ package com.ssj.sys.controller;
|
|
|
import com.ssj.bean.common.framework.core.domain.Response;
|
|
|
import com.ssj.bean.sys.organization.domain.Organization;
|
|
|
import com.ssj.bean.sys.role.domain.Admin;
|
|
|
+import com.ssj.bean.sys.role.domain.AdminOrg;
|
|
|
import com.ssj.bean.weixin.sales.domain.LibStaffing;
|
|
|
import com.ssj.framework.basic.common.bean.SplitPage;
|
|
|
import com.ssj.framework.core.common.controller.BaseController;
|
|
|
import com.ssj.service.sys.organization.service.OrganizationService;
|
|
|
+import com.ssj.service.sys.role.service.AdminOrgService;
|
|
|
import com.ssj.service.sys.sort.service.SortService;
|
|
|
import com.ssj.service.weixin.sales.service.LibStaffingService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.poi.ss.formula.functions.Now;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort.Direction;
|
|
@@ -41,6 +45,9 @@ public class OrganizationController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private SortService sortService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AdminOrgService adminOrgService;
|
|
|
|
|
|
/**
|
|
|
* 栏目主页面
|
|
@@ -133,10 +140,22 @@ public class OrganizationController extends BaseController {
|
|
|
@ResponseBody
|
|
|
public Response updateSortNo(Organization org){
|
|
|
Response response = new Response();
|
|
|
+ Boolean isAdd = StringUtils.isEmpty(org.getId())?true:false;
|
|
|
org.setCreateTime(new Date());
|
|
|
org.setOrgLevel(organizationService.getById(org.getpId()).getOrgLevel()+1);
|
|
|
org=organizationService.save(org);
|
|
|
organizationService.changeSubCount(org.getpId(), true);
|
|
|
+ if(isAdd){
|
|
|
+ //给当前账号插入权限
|
|
|
+ String adminId = adminId();
|
|
|
+ AdminOrg adminOrg = new AdminOrg();
|
|
|
+ adminOrg.setAdminId(adminId);
|
|
|
+ adminOrg.setCreateTime(new Date());
|
|
|
+ adminOrg.setOrgCode(org.getCode());
|
|
|
+ adminOrg.setOrgId(org.getId());
|
|
|
+ adminOrgService.save(adminOrg);
|
|
|
+ }
|
|
|
+
|
|
|
response.success(org);
|
|
|
return response;
|
|
|
}
|