人员修改任务中初始化同步OA绑定
This commit is contained in:
parent
b29520b15c
commit
45604cbd6d
|
@ -22,6 +22,7 @@ import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
import shkd.utils.DobeDWUtils;
|
import shkd.utils.DobeDWUtils;
|
||||||
|
import shkd.utils.OAUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -106,6 +107,7 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
|
||||||
String bank_account = null;
|
String bank_account = null;
|
||||||
|
|
||||||
List<UserParam> updateList = new ArrayList<>();
|
List<UserParam> updateList = new ArrayList<>();
|
||||||
|
List<DynamicObject> userinfos = new ArrayList<>();
|
||||||
UserParam user = null;
|
UserParam user = null;
|
||||||
DynamicObject currentUser = null;
|
DynamicObject currentUser = null;
|
||||||
DynamicObject deptOrg = null;
|
DynamicObject deptOrg = null;
|
||||||
|
@ -141,6 +143,10 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
|
||||||
dataMap.put("email", email);//电子邮箱
|
dataMap.put("email", email);//电子邮箱
|
||||||
user.setDataMap(dataMap);
|
user.setDataMap(dataMap);
|
||||||
updateList.add(user);
|
updateList.add(user);
|
||||||
|
//组装要与OA绑定的人员集合
|
||||||
|
if(personoabid){
|
||||||
|
userinfos.add(currentUser);
|
||||||
|
}
|
||||||
//处理部门和职位
|
//处理部门和职位
|
||||||
if(!DobeDWUtils.isEmpty(deptid)){
|
if(!DobeDWUtils.isEmpty(deptid)){
|
||||||
deptOrg = QueryServiceHelper.queryOne("bos_org","id,number,name",new QFilter[]{new QFilter("fyzjorgid","=",deptid)});
|
deptOrg = QueryServiceHelper.queryOne("bos_org","id,number,name",new QFilter[]{new QFilter("fyzjorgid","=",deptid)});
|
||||||
|
@ -223,6 +229,15 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//调用OA人员绑定
|
||||||
|
if(userinfos.size() > 0){
|
||||||
|
String billNo = "person-first-all-bid";
|
||||||
|
//获取token
|
||||||
|
String oaToken = OAUtils.getOaToken(billNo);
|
||||||
|
if (!DobeDWUtils.isEmpty(oaToken)) {
|
||||||
|
OAUtils.thirdpartyUser(userinfos, oaToken, billNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private boolean isNeedUpdate(DynamicObject personbank,String name,String bank,String bank_branch,String bank_account){
|
private boolean isNeedUpdate(DynamicObject personbank,String name,String bank,String bank_branch,String bank_account){
|
||||||
if(!name.equals(personbank.getString("name"))){
|
if(!name.equals(personbank.getString("name"))){
|
||||||
|
|
Loading…
Reference in New Issue