|
@@ -212,11 +212,14 @@ public class OfficeController extends BaseController {
|
|
|
addMessage(redirectAttributes, "演示模式,不允许操作!");
|
|
|
return "redirect:" + adminPath + "/sys/office/";
|
|
|
}
|
|
|
- Office o=officeService.get(office.getParent().getId());
|
|
|
- if(o.getType().equals("2")){
|
|
|
- if(!"2".equals(office.getType())){
|
|
|
- addMessage(redirectAttributes, "部门下不能添加分公司!");
|
|
|
- return "redirect:" + adminPath + "/sys/office/";
|
|
|
+ Office office1 = office.getParent();
|
|
|
+ if(office1 != null && office1.getName() != null) {
|
|
|
+ Office o = officeService.get(office.getParent().getId());
|
|
|
+ if (o.getType().equals("2")) {
|
|
|
+ if (!"2".equals(office.getType())) {
|
|
|
+ addMessage(redirectAttributes, "部门下不能添加分公司!");
|
|
|
+ return "redirect:" + adminPath + "/sys/office/";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (!beanValidator(model, office)) {
|