|
@@ -63,7 +63,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public int addOrganization(String name, String managerId, String type, String superId, String remarks) {
|
|
|
|
|
|
|
+ public int addOrganization(String name, String managerId, String type, String superId, String remarks,String dep) {
|
|
|
String id = UUID.randomUUID().toString();
|
|
String id = UUID.randomUUID().toString();
|
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
|
OrganizationManagement om=new OrganizationManagement();
|
|
OrganizationManagement om=new OrganizationManagement();
|
|
@@ -76,32 +76,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
|
|
|
om.setName(name);
|
|
om.setName(name);
|
|
|
om.setType(type);
|
|
om.setType(type);
|
|
|
om.setManagerId(managerId);
|
|
om.setManagerId(managerId);
|
|
|
- String sdepNo=organizationManagementMapper.selectDepNoByName(superId);
|
|
|
|
|
- int Count=organizationManagementMapper.selectDepNoCount(superId);
|
|
|
|
|
- if(Count<10){
|
|
|
|
|
- String dep=sdepNo+"0"+Count;
|
|
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- while(sid!=null){
|
|
|
|
|
- Count=Count+1;
|
|
|
|
|
- if(Count>=10){
|
|
|
|
|
- dep=sdepNo+Count;
|
|
|
|
|
- }else{
|
|
|
|
|
- dep=sdepNo+"0"+Count;
|
|
|
|
|
- }
|
|
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- om.setDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- if(Count>=10){
|
|
|
|
|
- String dep=sdepNo+Count;
|
|
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- while(sid!=null){
|
|
|
|
|
- Count=Count+1;
|
|
|
|
|
- dep=sdepNo+Count;
|
|
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- om.setDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ om.setDepNo(dep);
|
|
|
superId=organizationManagementMapper.selectIdByName(superId);
|
|
superId=organizationManagementMapper.selectIdByName(superId);
|
|
|
om.setSuperId(superId);
|
|
om.setSuperId(superId);
|
|
|
om.setRemarks(remarks);
|
|
om.setRemarks(remarks);
|
|
@@ -127,40 +102,14 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
|
|
|
}
|
|
}
|
|
|
@Override
|
|
@Override
|
|
|
public int updateOrganization(String name, String type, String managerId, String superId, String status,
|
|
public int updateOrganization(String name, String type, String managerId, String superId, String status,
|
|
|
- String remarks,String id) {
|
|
|
|
|
|
|
+ String remarks,String id,String depn) {
|
|
|
Date now=new Date();
|
|
Date now=new Date();
|
|
|
OrganizationManagement om=new OrganizationManagement();
|
|
OrganizationManagement om=new OrganizationManagement();
|
|
|
om.setName(name);
|
|
om.setName(name);
|
|
|
om.setType(type);
|
|
om.setType(type);
|
|
|
om.setUpdateTime(now);
|
|
om.setUpdateTime(now);
|
|
|
om.setManagerId(managerId);
|
|
om.setManagerId(managerId);
|
|
|
- String sdepNo=organizationManagementMapper.selectDepNoByName(superId);
|
|
|
|
|
- superId=organizationManagementMapper.selectIdByName(superId);
|
|
|
|
|
- int Count=organizationManagementMapper.selectDepNoCount(superId);
|
|
|
|
|
- if(Count<10){
|
|
|
|
|
- String dep=sdepNo+"0"+Count;
|
|
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- while(sid!=null){
|
|
|
|
|
- Count=Count+1;
|
|
|
|
|
- if(Count>=10){
|
|
|
|
|
- dep=sdepNo+Count;
|
|
|
|
|
- }else{
|
|
|
|
|
- dep=sdepNo+"0"+Count;
|
|
|
|
|
- }
|
|
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- om.setDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- if(Count>=10){
|
|
|
|
|
- String dep=sdepNo+Count;
|
|
|
|
|
- String sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- while(sid!=null){
|
|
|
|
|
- Count=Count+1;
|
|
|
|
|
- dep=sdepNo+Count;
|
|
|
|
|
- sid=organizationManagementMapper.selectIdByDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
- om.setDepNo(dep);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ om.setDepNo(depn);
|
|
|
om.setSuperId(superId);
|
|
om.setSuperId(superId);
|
|
|
om.setStatus(status);
|
|
om.setStatus(status);
|
|
|
om.setRemarks(remarks);
|
|
om.setRemarks(remarks);
|
|
@@ -170,7 +119,7 @@ public class OrganizationServiceImpl extends BaseMybatisDao<OrganizationManageme
|
|
|
int n=0;
|
|
int n=0;
|
|
|
List<OrganizationListOut> Nos =organizationManagementMapper.selectIDNBySuperId(id);
|
|
List<OrganizationListOut> Nos =organizationManagementMapper.selectIDNBySuperId(id);
|
|
|
for(OrganizationListOut i:Nos){
|
|
for(OrganizationListOut i:Nos){
|
|
|
- sdepNo=organizationManagementMapper.selectDepNoById(i.getSuperId());
|
|
|
|
|
|
|
+ String sdepNo=organizationManagementMapper.selectDepNoById(i.getSuperId());
|
|
|
if(n<10){
|
|
if(n<10){
|
|
|
String dep=sdepNo+"0"+n;
|
|
String dep=sdepNo+"0"+n;
|
|
|
if(n>=10){
|
|
if(n>=10){
|