|
@@ -118,7 +118,12 @@ public class WXCpDepartUtil {
|
|
|
depart.setId(id);
|
|
|
depart.setName(name);
|
|
|
depart.setParentId(parentId);
|
|
|
- departService.update(depart);
|
|
|
+ try {
|
|
|
+ // 部门删除情况下,更新报错,变成创建
|
|
|
+ departService.update(depart);
|
|
|
+ } catch (WxErrorException e) {
|
|
|
+ id = departService.create(depart);
|
|
|
+ }
|
|
|
}
|
|
|
return id;
|
|
|
}
|