Browse Source

【企业微信】【组织禁用】

wuyx 1 year ago
parent
commit
f06989a1b7

+ 9 - 0
uas-office-qywx/src/main/java/com/usoftchina/uas/office/qywx/entity/HrOrg.java

@@ -11,6 +11,7 @@ public class HrOrg {
     private String or_name;
     private Integer or_subof;
     private String or_headmancode;
+    private String or_statuscode;
     private Integer or_qywx;
 
     public Integer getOr_id() {
@@ -52,4 +53,12 @@ public class HrOrg {
     public void setOr_qywx(Integer or_qywx) {
         this.or_qywx = or_qywx;
     }
+
+    public String getOr_statuscode() {
+        return or_statuscode;
+    }
+
+    public void setOr_statuscode(String or_statuscode) {
+        this.or_statuscode = or_statuscode;
+    }
 }

+ 4 - 4
uas-office-qywx/src/main/java/com/usoftchina/uas/office/qywx/service/UasOrgService.java

@@ -27,7 +27,7 @@ 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,
+        return queryForBean("select * from HrOrg where or_id=?", HrOrg.class,
                 id);
     }
 
@@ -38,7 +38,7 @@ public class UasOrgService extends AbstractService {
      * @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,
+        return queryForBean("select * from HrOrg where or_qywx is not null and or_id=?", HrOrg.class,
                 id);
     }
 
@@ -80,7 +80,7 @@ public class UasOrgService extends AbstractService {
                 addrBookSdk.updateDepartment(req);
             } else {
                 HrOrg parentOrg = getBindById(org.getOr_subof());
-                if (null != parentOrg) {
+                if (null != parentOrg&&!"DISABLE".equals(parentOrg.getOr_statuscode())) {
                     UpdateDepartmentReq req = new UpdateDepartmentReq()
                             .id(org.getOr_qywx())
                             .name(org.getOr_name())
@@ -95,7 +95,7 @@ public class UasOrgService extends AbstractService {
             int parentId = 0;
             if(subof>0){
                 HrOrg parentOrg = getBindById(subof);
-                if(parentOrg!=null){
+                if(parentOrg!=null&&!"DISABLE".equals(parentOrg.getOr_statuscode())){
                     parentId = (parentOrg.getOr_qywx() == null)?0:parentOrg.getOr_qywx();
                     if(parentId == 0){
                         logger.debug("create qywx department Or_subof:"+subof+" not exists qywx");