Commit d847e88693dbd0cb8d81f1885355f1d39f557e2e
1 parent
5781141d
Exists in
master
翼学云通讯录同步
Showing
9 changed files
with
202 additions
and
110 deletions
Show diff stats
cloud/pom.xml
| ... | ... | @@ -21,20 +21,17 @@ |
| 21 | 21 | <module>common</module> |
| 22 | 22 | <!-- <module>geteway</module>--> |
| 23 | 23 | <module>haikang</module> |
| 24 | - <module>dahua</module> | |
| 24 | +<!-- <module>dahua</module>--> | |
| 25 | 25 | <!-- <module>consumer</module>--> |
| 26 | - <module>haikangface</module> | |
| 27 | - <!--<module>search_independence</module>--> | |
| 26 | +<!-- <module>haikangface</module>--> | |
| 27 | +<!-- <module>search_independence</module>--> | |
| 28 | 28 | <module>search_smartCampus</module> |
| 29 | 29 | <module>search_xiaoan</module> |
| 30 | - <module>mypulsar</module> | |
| 31 | - <!--<module>weigeng</module>--> | |
| 32 | - <!--<module>independence</module>--> | |
| 33 | -<!-- <module>test</module>--> | |
| 34 | - <!--<module>weigeng</module>--> | |
| 35 | - <!--<module>independence</module>--> | |
| 36 | - <!--<module>quartz</module>--> | |
| 37 | - <!-- <module>test</module>--> | |
| 30 | +<!-- <module>mypulsar</module>--> | |
| 31 | +<!-- <module>weigeng</module>--> | |
| 32 | +<!-- <module>independence</module>--> | |
| 33 | + <module>quartz</module> | |
| 34 | + <module>zkAttendance</module> | |
| 38 | 35 | </modules> |
| 39 | 36 | |
| 40 | 37 | <properties> |
| ... | ... | @@ -84,5 +81,4 @@ |
| 84 | 81 | </dependency> |
| 85 | 82 | </dependencies> |
| 86 | 83 | </dependencyManagement> |
| 87 | - | |
| 88 | 84 | </project> | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/feign/ScFeign.java
| ... | ... | @@ -51,9 +51,6 @@ public interface ScFeign { |
| 51 | 51 | @RequestMapping(value = "sm/sync/selectSyncSchool",method = RequestMethod.GET) |
| 52 | 52 | List<SyncSchoolDto> selectSyncSchool(); |
| 53 | 53 | |
| 54 | - @RequestMapping(value = "sm/sync/selectGroup",method = RequestMethod.GET) | |
| 55 | - List<GroupDto> selectGroup(@RequestParam("schoolId") int schoolId); | |
| 56 | - | |
| 57 | 54 | @RequestMapping(value = "sm/sync/selectSubject",method = RequestMethod.GET) |
| 58 | 55 | List<String> selectSubject(@RequestParam("schoolId") int schoolId); |
| 59 | 56 | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/job/BindPushJob.java
cloud/quartz/src/main/java/com/sincere/quartz/job/KQJob.java
cloud/quartz/src/main/java/com/sincere/quartz/job/SyncJob.java
| ... | ... | @@ -20,11 +20,11 @@ public class SyncJob { |
| 20 | 20 | @Autowired |
| 21 | 21 | YXYReadService yxyReadService ; |
| 22 | 22 | |
| 23 | - @Scheduled(cron = "0/1 * * * * ? ") | |
| 23 | + @Scheduled(cron = "0 1-59 * * * ? ") | |
| 24 | 24 | //@Scheduled(cron = "0 0 23 * * ? ") |
| 25 | 25 | public void Sync(){ |
| 26 | 26 | //翼校通的同步 之后还有钉钉的同步等等 |
| 27 | 27 | yxyWriteService.sync(); |
| 28 | - //yxyReadService.sync(); | |
| 28 | + yxyReadService.sync(); | |
| 29 | 29 | } |
| 30 | 30 | } | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/ding/DingUtils.java
0 → 100644
| ... | ... | @@ -0,0 +1,67 @@ |
| 1 | +//package com.sincere.quartz.third.ding; | |
| 2 | +// | |
| 3 | +//import com.dingtalk.api.DefaultDingTalkClient; | |
| 4 | +//import com.dingtalk.api.DingTalkClient; | |
| 5 | +//import com.dingtalk.api.request.OapiDepartmentListRequest; | |
| 6 | +//import com.dingtalk.api.request.OapiEduTeacherGetRequest; | |
| 7 | +//import com.dingtalk.api.request.OapiServiceGetCorpTokenRequest; | |
| 8 | +//import com.dingtalk.api.request.OapiUserSimplelistRequest; | |
| 9 | +//import com.dingtalk.api.response.OapiDepartmentListResponse; | |
| 10 | +//import com.dingtalk.api.response.OapiServiceGetCorpTokenResponse; | |
| 11 | +//import com.dingtalk.api.response.OapiUserSimplelistResponse; | |
| 12 | +//import com.taobao.api.ApiException; | |
| 13 | +// | |
| 14 | +///** | |
| 15 | +// * 钉钉 数据同步接口 | |
| 16 | +// * @author chen | |
| 17 | +// * @version 1.0 | |
| 18 | +// * @date 2019/12/11 0011 9:17 | |
| 19 | +// */ | |
| 20 | +//public class DingUtils { | |
| 21 | +// | |
| 22 | +// public static void main(String[] args){ | |
| 23 | +// //System.out.println(getToken("ding5b3f718a90027ec4","suitea4oyazedqfxn60fh", "i6mJCpaWOo-N1ibqExCwvwOJF9mW81Yoc0tc2YCGzehfUO2vyI9tocM9kNR4KBIU")); | |
| 24 | +// getDept("63424a88ee8f3e118e11ede370746bf5"); | |
| 25 | +// } | |
| 26 | +// | |
| 27 | +// private static String getToken(String corpId , String key , String secret){ | |
| 28 | +// try{ | |
| 29 | +// DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/service/get_corp_token"); | |
| 30 | +// OapiServiceGetCorpTokenRequest req = new OapiServiceGetCorpTokenRequest(); | |
| 31 | +// req.setAuthCorpid(corpId); | |
| 32 | +// OapiServiceGetCorpTokenResponse execute = client.execute(req,key,secret, "suiteTicket"); | |
| 33 | +// return execute.getAccessToken(); | |
| 34 | +// }catch (ApiException e){ | |
| 35 | +// | |
| 36 | +// } | |
| 37 | +// return null ; | |
| 38 | +// } | |
| 39 | +// | |
| 40 | +// private static void getDept(String accessToken){ | |
| 41 | +// try{ | |
| 42 | +// DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/department/list"); | |
| 43 | +// OapiDepartmentListRequest request = new OapiDepartmentListRequest(); | |
| 44 | +// request.setId("1"); | |
| 45 | +// request.setHttpMethod("GET"); | |
| 46 | +// OapiDepartmentListResponse response = client.execute(request, accessToken); | |
| 47 | +// System.out.println("1"); | |
| 48 | +// }catch (ApiException e){ | |
| 49 | +// | |
| 50 | +// } | |
| 51 | +// | |
| 52 | +// } | |
| 53 | +// | |
| 54 | +// private static void getUser(String accessToken , Long deptId){ | |
| 55 | +// try{ | |
| 56 | +// DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/simplelist"); | |
| 57 | +// OapiUserSimplelistRequest request = new OapiUserSimplelistRequest(); | |
| 58 | +// request.setDepartmentId(deptId); | |
| 59 | +// request.setHttpMethod("GET"); | |
| 60 | +// OapiUserSimplelistResponse response = client.execute(request, accessToken); | |
| 61 | +// }catch (ApiException e){ | |
| 62 | +// | |
| 63 | +// } | |
| 64 | +// | |
| 65 | +// } | |
| 66 | +// | |
| 67 | +//} | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/qiyehao/QYHUtils.java
0 → 100644
| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | +package com.sincere.quartz.third.qiyehao; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson.JSONObject; | |
| 4 | +import com.sincere.common.util.HttpClientUtils; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * @author chen | |
| 8 | + * @version 1.0 | |
| 9 | + * @date 2019/12/11 0011 15:28 | |
| 10 | + */ | |
| 11 | +public class QYHUtils { | |
| 12 | + | |
| 13 | + public static void main(String[] args){ | |
| 14 | + getToken("wx51b3acc9a06f0bb0","pb5P1feSHnWYYLPAfN4QBMk-nPFaF4RGW5Lq1ceyfhk"); | |
| 15 | + } | |
| 16 | + | |
| 17 | + public static String getToken(String id , String secret){ | |
| 18 | + String url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid="+id+"&corpsecret="+secret ; | |
| 19 | + JSONObject json = HttpClientUtils.httpGet(url) ; | |
| 20 | + return json.get("access_token").toString() ; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public static void getDept(String accessToken){ | |
| 24 | + String url = "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token="+accessToken; | |
| 25 | + JSONObject json = HttpClientUtils.httpGet(url) ; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public static void getUser(String accessToken){ | |
| 29 | + String url = "https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token="+accessToken+"&department_id="+1+"&fetch_child=1&status=0"; | |
| 30 | + JSONObject json = HttpClientUtils.httpGet(url) ; | |
| 31 | + } | |
| 32 | +} | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYReadService.java
| ... | ... | @@ -44,9 +44,9 @@ public class YXYReadService { |
| 44 | 44 | list.add(SI); |
| 45 | 45 | list.add(getPassword(SI_CODE)); |
| 46 | 46 | list.add("05750400"); |
| 47 | - String wsdl =getAllDept ; | |
| 47 | + String wsdl =getAllStudent ; | |
| 48 | 48 | String ns = nameSpace; |
| 49 | - String method = getALlDept_method; | |
| 49 | + String method = getALlStudent_method; | |
| 50 | 50 | JSONArray jsonArray = getMessage(wsdl, ns, method, list); |
| 51 | 51 | System.out.println(jsonArray.toJSONString()); |
| 52 | 52 | } | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYWriteService.java
| ... | ... | @@ -70,7 +70,7 @@ public class YXYWriteService { |
| 70 | 70 | List<SyncUserDto> deleteTeacherList = new ArrayList<>(); |
| 71 | 71 | |
| 72 | 72 | for(SyncUserDto user : userList){ |
| 73 | - if(user.getUserType() == 1){ //老师 | |
| 73 | + if(user.getUserType() == 2){ //学生 | |
| 74 | 74 | if(user.getUpdateType() == 1){ |
| 75 | 75 | addStudentList.add(user); |
| 76 | 76 | }else if(user.getUpdateType() == 3){ |
| ... | ... | @@ -78,7 +78,7 @@ public class YXYWriteService { |
| 78 | 78 | }else if(user.getUpdateType() == 5){ |
| 79 | 79 | deleteStudentList.add(user); |
| 80 | 80 | } |
| 81 | - }else if(user.getUserType() == 2){ //学生 | |
| 81 | + }else if(user.getUserType() == 1){ //老师 | |
| 82 | 82 | if(user.getUpdateType() == 1){ |
| 83 | 83 | addTeacherList.add(user); |
| 84 | 84 | }else if(user.getUpdateType() == 3){ |
| ... | ... | @@ -219,7 +219,7 @@ public class YXYWriteService { |
| 219 | 219 | }else { |
| 220 | 220 | System.out.println(result.getMessage()); |
| 221 | 221 | } |
| 222 | - for(SyncDeptDto deptDto : updateDept){ | |
| 222 | + for(SyncDeptDto deptDto : deleteDept){ | |
| 223 | 223 | if(!errorList.contains(deptDto.getDeptName())){ |
| 224 | 224 | DeptRelationDto deptRelationDto = new DeptRelationDto(); |
| 225 | 225 | deptRelationDto.setHxyDeptId(deptDto.getDeptId()); |
| ... | ... | @@ -391,84 +391,20 @@ public class YXYWriteService { |
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - | |
| 395 | - private JSONArray initAddJson(List<SyncUserDto> list){ | |
| 396 | - JSONArray array = new JSONArray(); | |
| 397 | - for(SyncUserDto user : list){ | |
| 398 | - JSONObject object = new JSONObject(); | |
| 399 | - object.put("classid",scFeign.selectYxyIdByHxyId(user.getClassId())); | |
| 400 | - object.put("stuname",user.getName()); | |
| 401 | - object.put("mobile",user.getMobile()); | |
| 402 | - object.put("sex",user.getSex()); | |
| 403 | - array.add(object); | |
| 404 | - } | |
| 405 | - return array ; | |
| 406 | - } | |
| 407 | - | |
| 408 | - private JSONArray initTeacherAddJson(SyncSchoolDto school , List<SyncUserDto> list){ | |
| 409 | - JSONArray array = new JSONArray(); | |
| 410 | - for(SyncUserDto user : list){ | |
| 411 | - JSONObject object = new JSONObject(); | |
| 412 | - object.put("schoolid",school.getYxtId()); | |
| 413 | - object.put("name",user.getName()); | |
| 414 | - object.put("mobile",user.getMobile()); | |
| 415 | - object.put("sex",user.getSex()); | |
| 416 | - array.add(object); | |
| 417 | - } | |
| 418 | - return array ; | |
| 419 | - } | |
| 420 | - | |
| 421 | - private JSONArray initTeacherUpdateJson(SyncSchoolDto school , List<SyncUserDto> list){ | |
| 422 | - JSONArray array = new JSONArray(); | |
| 423 | - for(SyncUserDto user : list){ | |
| 424 | - JSONObject object = new JSONObject(); | |
| 425 | - object.put("schoolid",school.getYxtId()); | |
| 426 | - object.put("name",user.getName()); | |
| 427 | - object.put("mobile",user.getMobile()); | |
| 428 | - object.put("sex",user.getSex()); | |
| 429 | - array.add(object); | |
| 430 | - } | |
| 431 | - return array ; | |
| 432 | - } | |
| 433 | - | |
| 434 | - private JSONArray initUserUpdateJson(List<SyncUserDto> list){ | |
| 435 | - JSONArray array = new JSONArray(); | |
| 436 | - for(SyncUserDto user : list){ | |
| 437 | - JSONObject object = new JSONObject(); | |
| 438 | - object.put("userid",user.getHxyCustomerId()); | |
| 439 | - object.put("classid",scFeign.selectYxyIdByHxyId(user.getClassId())); | |
| 440 | - object.put("stuname",user.getName()); | |
| 441 | - object.put("mobile",user.getMobile()); | |
| 442 | - object.put("sex",user.getSex()); | |
| 443 | - array.add(object); | |
| 444 | - } | |
| 445 | - return array ; | |
| 446 | - } | |
| 447 | - | |
| 448 | - private JSONArray initUserDeleteJson(List<SyncUserDto> list){ | |
| 449 | - JSONArray array = new JSONArray(); | |
| 450 | - for(SyncUserDto user : list){ | |
| 451 | - JSONObject object = new JSONObject(); | |
| 452 | - object.put("id",user.getHxyCustomerId()); | |
| 453 | - array.add(object); | |
| 454 | - } | |
| 455 | - return array ; | |
| 456 | - } | |
| 457 | - | |
| 458 | 394 | private void syncStudentHxy(SyncSchoolDto school , List<SyncUserDto> addStudentList , List<SyncUserDto> updateStudentList ,List<SyncUserDto> deleteStudentList ){ |
| 459 | 395 | if(addStudentList.size() > 0){ |
| 460 | 396 | JSONArray array = initAddJson(addStudentList); |
| 461 | 397 | YXYResult result = getResult(prefix_url+suffix_student_add,array.toJSONString()); |
| 462 | 398 | if(result.getCode() == 0 || result.getCode() == -3){ |
| 463 | 399 | for(YXYResultDetail detail : result.getData()){ |
| 464 | - if(StringUtils.isNotBlank(detail.getId())){ | |
| 400 | + if(StringUtils.isNotBlank(detail.getUserid())){ | |
| 465 | 401 | //成功 |
| 466 | 402 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 467 | - SyncUserDto syncUserDto = getUser(addStudentList,detail.getName()) ; | |
| 403 | + SyncUserDto syncUserDto = getUser(addStudentList,detail.getStuname()) ; | |
| 468 | 404 | userRelationDto.setHxyCustomerId(syncUserDto.getCustomerId()); |
| 469 | 405 | userRelationDto.setYxyUserId(detail.getUserid()); |
| 470 | 406 | userRelationDto.setSqlstate(1); |
| 471 | - userRelationDto.setUserType(1); | |
| 407 | + userRelationDto.setUserType(2); | |
| 472 | 408 | userRelationDto.setState(1); |
| 473 | 409 | scFeign.updateUserRelation(userRelationDto); |
| 474 | 410 | scFeign.updateUser(syncUserDto.getId()); |
| ... | ... | @@ -493,14 +429,14 @@ public class YXYWriteService { |
| 493 | 429 | System.out.println(result.getMessage()); |
| 494 | 430 | } |
| 495 | 431 | for(SyncUserDto user : updateStudentList){ |
| 496 | - if(!errorList.contains(user.getHxyCustomerId())){ | |
| 432 | + if(!errorList.contains(user.getYxyUserId())){ | |
| 497 | 433 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 498 | - userRelationDto.setYxyUserId(user.getCustomerId()); | |
| 434 | + userRelationDto.setHxyCustomerId(user.getCustomerId()); | |
| 499 | 435 | userRelationDto.setSqlstate(2); |
| 500 | - userRelationDto.setUserType(1); | |
| 436 | + userRelationDto.setUserType(2); | |
| 501 | 437 | userRelationDto.setState(1); |
| 502 | 438 | scFeign.updateUserRelation(userRelationDto); |
| 503 | - scFeign.updateDept(user.getId()); | |
| 439 | + scFeign.updateUser(user.getId()); | |
| 504 | 440 | } |
| 505 | 441 | } |
| 506 | 442 | } |
| ... | ... | @@ -518,15 +454,15 @@ public class YXYWriteService { |
| 518 | 454 | }else { |
| 519 | 455 | System.out.println(result.getMessage()); |
| 520 | 456 | } |
| 521 | - for(SyncUserDto user : updateStudentList){ | |
| 522 | - if(!errorList.contains(user.getHxyCustomerId())){ | |
| 457 | + for(SyncUserDto user : deleteStudentList){ | |
| 458 | + if(!errorList.contains(user.getYxyUserId())){ | |
| 523 | 459 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 524 | - userRelationDto.setYxyUserId(user.getCustomerId()); | |
| 460 | + userRelationDto.setHxyCustomerId(user.getCustomerId()); | |
| 525 | 461 | userRelationDto.setSqlstate(2); |
| 526 | - userRelationDto.setUserType(1); | |
| 462 | + userRelationDto.setUserType(2); | |
| 527 | 463 | userRelationDto.setState(0); |
| 528 | 464 | scFeign.updateUserRelation(userRelationDto); |
| 529 | - scFeign.updateDept(user.getId()); | |
| 465 | + scFeign.updateUser(user.getId()); | |
| 530 | 466 | } |
| 531 | 467 | } |
| 532 | 468 | } |
| ... | ... | @@ -538,14 +474,14 @@ public class YXYWriteService { |
| 538 | 474 | YXYResult result = getResult(prefix_url+suffix_teacher_add,array.toJSONString()); |
| 539 | 475 | if(result.getCode() == 0 || result.getCode() == -3){ |
| 540 | 476 | for(YXYResultDetail detail : result.getData()){ |
| 541 | - if(StringUtils.isNotBlank(detail.getId())){ | |
| 477 | + if(StringUtils.isNotBlank(detail.getUserid())){ | |
| 542 | 478 | //成功 |
| 543 | 479 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 544 | 480 | SyncUserDto syncUserDto = getUser(addTeacherList,detail.getName()) ; |
| 545 | 481 | userRelationDto.setHxyCustomerId(syncUserDto.getCustomerId()); |
| 546 | 482 | userRelationDto.setYxyUserId(detail.getUserid()); |
| 547 | 483 | userRelationDto.setSqlstate(1); |
| 548 | - userRelationDto.setUserType(2); | |
| 484 | + userRelationDto.setUserType(1); | |
| 549 | 485 | userRelationDto.setState(1); |
| 550 | 486 | scFeign.updateUserRelation(userRelationDto); |
| 551 | 487 | scFeign.updateUser(syncUserDto.getId()); |
| ... | ... | @@ -570,14 +506,14 @@ public class YXYWriteService { |
| 570 | 506 | System.out.println(result.getMessage()); |
| 571 | 507 | } |
| 572 | 508 | for(SyncUserDto user : updateTeacherList){ |
| 573 | - if(!errorList.contains(user.getHxyCustomerId())){ | |
| 509 | + if(!errorList.contains(user.getYxyUserId())){ | |
| 574 | 510 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 575 | - userRelationDto.setYxyUserId(user.getCustomerId()); | |
| 511 | + userRelationDto.setHxyCustomerId(user.getCustomerId()); | |
| 576 | 512 | userRelationDto.setSqlstate(2); |
| 577 | - userRelationDto.setUserType(2); | |
| 513 | + userRelationDto.setUserType(1); | |
| 578 | 514 | userRelationDto.setState(1); |
| 579 | 515 | scFeign.updateUserRelation(userRelationDto); |
| 580 | - scFeign.updateDept(user.getId()); | |
| 516 | + scFeign.updateUser(user.getId()); | |
| 581 | 517 | } |
| 582 | 518 | } |
| 583 | 519 | } |
| ... | ... | @@ -596,14 +532,14 @@ public class YXYWriteService { |
| 596 | 532 | System.out.println(result.getMessage()); |
| 597 | 533 | } |
| 598 | 534 | for(SyncUserDto user : deleteTeacherList){ |
| 599 | - if(!errorList.contains(user.getHxyCustomerId())){ | |
| 535 | + if(!errorList.contains(user.getYxyUserId())){ | |
| 600 | 536 | UserRelationDto userRelationDto = new UserRelationDto(); |
| 601 | - userRelationDto.setYxyUserId(user.getCustomerId()); | |
| 537 | + userRelationDto.setHxyCustomerId(user.getCustomerId()); | |
| 602 | 538 | userRelationDto.setSqlstate(2); |
| 603 | - userRelationDto.setUserType(2); | |
| 539 | + userRelationDto.setUserType(1); | |
| 604 | 540 | userRelationDto.setState(0); |
| 605 | 541 | scFeign.updateUserRelation(userRelationDto); |
| 606 | - scFeign.updateDept(user.getId()); | |
| 542 | + scFeign.updateUser(user.getId()); | |
| 607 | 543 | } |
| 608 | 544 | } |
| 609 | 545 | } |
| ... | ... | @@ -657,6 +593,70 @@ public class YXYWriteService { |
| 657 | 593 | return array ; |
| 658 | 594 | } |
| 659 | 595 | |
| 596 | + private JSONArray initAddJson(List<SyncUserDto> list){ | |
| 597 | + JSONArray array = new JSONArray(); | |
| 598 | + for(SyncUserDto user : list){ | |
| 599 | + JSONObject object = new JSONObject(); | |
| 600 | + object.put("classid",scFeign.selectYxyIdByHxyId(user.getClassId())); | |
| 601 | + object.put("stuname",user.getName()); | |
| 602 | + object.put("mobile",user.getMobile()); | |
| 603 | + object.put("sex",user.getSex()); | |
| 604 | + array.add(object); | |
| 605 | + } | |
| 606 | + return array ; | |
| 607 | + } | |
| 608 | + | |
| 609 | + private JSONArray initTeacherAddJson(SyncSchoolDto school , List<SyncUserDto> list){ | |
| 610 | + JSONArray array = new JSONArray(); | |
| 611 | + for(SyncUserDto user : list){ | |
| 612 | + JSONObject object = new JSONObject(); | |
| 613 | + object.put("schoolid",school.getYxtId()); | |
| 614 | + object.put("name",user.getName()); | |
| 615 | + object.put("mobile",user.getMobile()); | |
| 616 | + object.put("sex",user.getSex()); | |
| 617 | + array.add(object); | |
| 618 | + } | |
| 619 | + return array ; | |
| 620 | + } | |
| 621 | + | |
| 622 | + private JSONArray initTeacherUpdateJson(SyncSchoolDto school , List<SyncUserDto> list){ | |
| 623 | + JSONArray array = new JSONArray(); | |
| 624 | + for(SyncUserDto user : list){ | |
| 625 | + JSONObject object = new JSONObject(); | |
| 626 | + object.put("userid",user.getYxyUserId()); | |
| 627 | + object.put("name",user.getName()); | |
| 628 | + object.put("mobile",user.getMobile()); | |
| 629 | + object.put("sex",user.getSex()); | |
| 630 | + array.add(object); | |
| 631 | + } | |
| 632 | + return array ; | |
| 633 | + } | |
| 634 | + | |
| 635 | + private JSONArray initUserUpdateJson(List<SyncUserDto> list){ | |
| 636 | + JSONArray array = new JSONArray(); | |
| 637 | + for(SyncUserDto user : list){ | |
| 638 | + JSONObject object = new JSONObject(); | |
| 639 | + object.put("userid",user.getYxyUserId()); | |
| 640 | + object.put("classid",scFeign.selectYxyIdByHxyId(user.getClassId())); | |
| 641 | + object.put("stuname",user.getName()); | |
| 642 | + object.put("mobile",user.getMobile()); | |
| 643 | + object.put("sex",user.getSex()); | |
| 644 | + array.add(object); | |
| 645 | + } | |
| 646 | + return array ; | |
| 647 | + } | |
| 648 | + | |
| 649 | + private JSONArray initUserDeleteJson(List<SyncUserDto> list){ | |
| 650 | + JSONArray array = new JSONArray(); | |
| 651 | + for(SyncUserDto user : list){ | |
| 652 | + JSONObject object = new JSONObject(); | |
| 653 | + object.put("userid",user.getYxyUserId()); | |
| 654 | + array.add(object); | |
| 655 | + } | |
| 656 | + return array ; | |
| 657 | + } | |
| 658 | + | |
| 659 | + | |
| 660 | 660 | //返回父部门,或者年级 |
| 661 | 661 | private SyncDeptDto getDept(List<SyncDeptDto> deptList , int pId){ |
| 662 | 662 | for(SyncDeptDto dept : deptList){ | ... | ... |