岗位自动任务
This commit is contained in:
parent
373519684d
commit
b9ce6f6dfd
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import kd.bos.context.RequestContext;
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.exception.KDException;
|
||||
import kd.bos.org.model.OrgParam;
|
||||
import kd.bos.orm.ORM;
|
||||
|
@ -51,7 +52,7 @@ public class JobtitleTaskImpl extends AbstractTask {
|
|||
Query query = new Query();
|
||||
query.setQueryDTO(queryDTO);
|
||||
String requestBody = JSON.toJSONString(query);
|
||||
String jsonResponse = HttpRequest.post("http://" + "10.157.226.9:8088" + "/api/hrm/resful/getHrmUserInfoWithPage")
|
||||
String jsonResponse = HttpRequest.post("http://" + "10.157.226.9:8088" + "/api/hrm/resful/getJobtitleInfoWithPage")
|
||||
.body(requestBody)
|
||||
.execute().body();
|
||||
|
||||
|
@ -78,6 +79,8 @@ public class JobtitleTaskImpl extends AbstractTask {
|
|||
|
||||
// 遍历解析结果
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
//根据ID看是否查询到已有的数据,对已有数据进行ID,
|
||||
|
||||
OperateOption option = OperateOption.create();
|
||||
JSONObject item = dataList.getJSONObject(i);
|
||||
String jobTitleName = item.getString("jobtitlename");
|
||||
|
@ -85,17 +88,22 @@ public class JobtitleTaskImpl extends AbstractTask {
|
|||
String modified = item.getString("modified");
|
||||
String id = item.getString("id");
|
||||
String jobTitleMark = item.getString("jobtitlemark");
|
||||
String number = "0" + id;
|
||||
QFilter filter = new QFilter("shkd_oaid", "=", "aurogp");
|
||||
DynamicObject bos_position = BusinessDataServiceHelper.loadSingle("bos_position", new QFilter[]{filter});
|
||||
|
||||
ORM orm = ORM.create();
|
||||
DynamicObject job = orm.newDynamicObject("bos_position");
|
||||
|
||||
if(bos_position!=null){
|
||||
job =bos_position;
|
||||
}
|
||||
job.set("name", jobTitleName);
|
||||
job.set("dpt", bosAdminorg);
|
||||
job.set("remarks", jobTitleMark);
|
||||
job.set("enable", 1);
|
||||
|
||||
OperationServiceHelper.executeOperate("save", "bos_position", new DynamicObject[]{job}, option);
|
||||
job.set("shkd_oaid",id);
|
||||
// job.set("");
|
||||
OperationResult operationResult = OperationServiceHelper.executeOperate("save", "bos_position", new DynamicObject[]{job}, option);
|
||||
System.out.println();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 处理异常
|
||||
|
|
Loading…
Reference in New Issue