|
|
@@ -59,35 +59,13 @@ public class AdminOrganizationController extends BaseApiController{
|
|
|
return res;
|
|
|
}
|
|
|
String sdepNo=organizationManagementMapper.selectDepNo(superId);
|
|
|
- int Count=organizationManagementMapper.selectDepNoCount(superId);
|
|
|
- if((Count+1)>99){
|
|
|
+ int count=organizationManagementMapper.selectDepNoCount(superId);
|
|
|
+ if((count+1)>99){
|
|
|
res.getError().add(buildError("","每层最多存在99个子类"));
|
|
|
return res;
|
|
|
}
|
|
|
- if(Count<10){
|
|
|
- String dep=sdepNo+"0"+Count;
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- while(sid!=null){
|
|
|
- Count=(Count+1)%100;
|
|
|
- if(Count>=10){
|
|
|
- dep=sdepNo+Count;
|
|
|
- }else{
|
|
|
- dep=sdepNo+"0"+Count;
|
|
|
- }
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- }
|
|
|
- organizationService.addOrganization(name, managerId, type, superId, remarks,dep,workingHoursType);
|
|
|
- }
|
|
|
- if(Count>=10){
|
|
|
- String dep=sdepNo+Count;
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- while(sid!=null){
|
|
|
- Count=(Count+1)%100;
|
|
|
- dep=sdepNo+Count;
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- }
|
|
|
- organizationService.addOrganization(name, managerId, type, superId, remarks,dep,workingHoursType);
|
|
|
- }
|
|
|
+
|
|
|
+ organizationService.addOrganization(name, managerId, type, superId, remarks,sdepNo,count,workingHoursType);
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
@@ -117,36 +95,14 @@ public class AdminOrganizationController extends BaseApiController{
|
|
|
return res;
|
|
|
}
|
|
|
String sdepNo=organizationManagementMapper.selectDepNo(superId);//No
|
|
|
- int Count=organizationManagementMapper.selectDepNoCount(superId);//14
|
|
|
- if((Count+1)>99){
|
|
|
+ int count=organizationManagementMapper.selectDepNoCount(superId);//14
|
|
|
+ if((count+1)>99){
|
|
|
res.getError().add(buildError("","每层最多存在99个子类"));
|
|
|
return res;
|
|
|
}
|
|
|
- int i=0;
|
|
|
- if(Count<10){
|
|
|
- String dep=sdepNo+"0"+Count;
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- while(sid!=null){
|
|
|
- Count=(Count+1)%100;
|
|
|
- if(Count>=10){
|
|
|
- dep=sdepNo+Count;
|
|
|
- }else{
|
|
|
- dep=sdepNo+"0"+Count;
|
|
|
- }
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- }
|
|
|
- i=organizationService.updateOrganization(name, type, managerId, superId, status, province,remarks,id,dep,abbreviation,financeId,workingHoursType);
|
|
|
- }else if(Count>=10){
|
|
|
- String dep=sdepNo+Count;
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- while(sid!=null){
|
|
|
- Count=(Count+1)%100;
|
|
|
- dep=sdepNo+Count;
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
- }
|
|
|
- i=organizationService.updateOrganization(name, type, managerId, superId, status, province,remarks,id,dep,abbreviation,financeId,workingHoursType);
|
|
|
- }
|
|
|
|
|
|
+ int i=organizationService.updateOrganization(name, type, managerId, superId, status, province,remarks,id,
|
|
|
+ sdepNo,count,abbreviation,financeId,workingHoursType);
|
|
|
return res.data(i);
|
|
|
}
|
|
|
|