|
|
@@ -6,6 +6,7 @@ import cn.hutool.json.JSONObject;
|
|
|
import org.dromara.server.common.constant.DefaultConstants;
|
|
|
import org.dromara.server.common.domain.bo.ResourceDept;
|
|
|
import org.dromara.server.common.domain.bo.ResourcePerson;
|
|
|
+import org.dromara.server.common.domain.bo.ResourcePersonDept;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
@@ -28,6 +29,32 @@ public class TeacherUtils {
|
|
|
* @param data 教职工
|
|
|
* @return 结果
|
|
|
*/
|
|
|
+ public static List<ResourcePerson> getSyncTrainee(JSONObject data) {
|
|
|
+ List<ResourcePerson> resourcePersonList = new ArrayList<>();
|
|
|
+ ResourcePerson person = new ResourcePerson();
|
|
|
+ JSONObject stuObj = data.getJSONObject("student");
|
|
|
+ person.setUserId(stuObj.getStr("id"));
|
|
|
+ person.setDeptId(stuObj.getStr("currentClassId"));
|
|
|
+ person.setPostCode(DefaultConstants.TRAINEE_CODE);
|
|
|
+ person.setRealName(stuObj.get("name").toString());
|
|
|
+ person.setSex(stuObj.get("sex").toString());
|
|
|
+ person.setPhone(stuObj.get("phone").toString());
|
|
|
+ person.setCategory("2");
|
|
|
+ person.setUserState(stuObj.get("flag").toString());
|
|
|
+ person.setTenantId(data.getStr("tenantId"));
|
|
|
+ person.setOperatorId(DefaultConstants.KAFKA_SYNC_ADMIN);
|
|
|
+ List<ResourcePersonDept> userDeptList = new ArrayList<>();
|
|
|
+ ResourcePersonDept dept = new ResourcePersonDept();
|
|
|
+ dept.setDeptId(stuObj.getStr("currentClassId"));
|
|
|
+ userDeptList.add(dept);
|
|
|
+ person.setUserDeptList(userDeptList);
|
|
|
+ resourcePersonList.add(person);
|
|
|
+ return resourcePersonList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理学员数据
|
|
|
+ */
|
|
|
public static List<ResourcePerson> getSyncTeacher(JSONObject data) {
|
|
|
List<ResourcePerson> resourcePersonList = new ArrayList<>();
|
|
|
ResourcePerson person = new ResourcePerson();
|