|
@@ -74,6 +74,9 @@ public class OrgServiceImpl implements OrgService {
|
|
|
org.setCreateBy(currentUser.getUsername());
|
|
|
org.setDateCreate(new Date());
|
|
|
org.setStatus(0);
|
|
|
+ if(org.getParentOrgId()==null){
|
|
|
+ org.setParentOrgId(0);
|
|
|
+ }
|
|
|
return this.orgMapper.insert(org);
|
|
|
}
|
|
|
|
|
@@ -97,7 +100,7 @@ public class OrgServiceImpl implements OrgService {
|
|
|
@Override
|
|
|
public int update(Org org) {
|
|
|
Org orgType = orgMapper.findOrgType(org);
|
|
|
- if(!orgType.getOrgType().equals(org.getOrgType())){
|
|
|
+ if(!orgType.getOrgType().equals(org.getOrgType())&&org.getChildType()!=null){
|
|
|
if(org.getOrgType().equals("department")
|
|
|
&&orgType.getChildType().equals("company")){
|
|
|
return -2;
|