|
|
@@ -29,6 +29,17 @@ public class UasOrgService extends AbstractService {
|
|
|
private final Logger logger = LoggerFactory.getLogger(UasOrgService.class);
|
|
|
|
|
|
public HrOrg getById(Integer id) {
|
|
|
+ return queryForBean("select * from HrOrg where or_statuscode<>'DISABLE' and or_id=?", HrOrg.class,
|
|
|
+ id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 组织(已绑定企业微信)
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public HrOrg getBindById(Integer id) {
|
|
|
return queryForBean("select * from HrOrg where or_statuscode<>'DISABLE' and or_qywx is not null and or_id=?", HrOrg.class,
|
|
|
id);
|
|
|
}
|
|
|
@@ -66,7 +77,7 @@ public class UasOrgService extends AbstractService {
|
|
|
// 修改部门
|
|
|
addrBookSdk.updateDepartment(req);
|
|
|
} else {
|
|
|
- HrOrg parentOrg = getById(org.getOr_subof());
|
|
|
+ HrOrg parentOrg = getBindById(org.getOr_subof());
|
|
|
if (null != parentOrg) {
|
|
|
UpdateDepartmentReq req = new UpdateDepartmentReq()
|
|
|
.id(org.getOr_qywx())
|
|
|
@@ -100,7 +111,7 @@ public class UasOrgService extends AbstractService {
|
|
|
} else {
|
|
|
try {
|
|
|
// 只需考虑父级组织已同步的情况
|
|
|
- HrOrg parentOrg = getById(org.getOr_subof());
|
|
|
+ HrOrg parentOrg = getBindById(org.getOr_subof());
|
|
|
GetDepartmentListResp.Department dept = null;
|
|
|
for (GetDepartmentListResp.Department department : departmentList) {
|
|
|
if (department.getParentid().equals(parentOrg.getOr_qywx()) && department.getName().equals(org.getOr_name())) {
|