Commit e7154f2beb48a1e8d49d3c4e6657958f2323c8a5
1 parent
124aa27a
Exists in
master
日志
Showing
11 changed files
with
70 additions
and
27 deletions
Show diff stats
cloud/quartz/src/main/java/com/sincere/quartz/job/SyncJob.java
... | ... | @@ -20,10 +20,10 @@ public class SyncJob { |
20 | 20 | @Autowired |
21 | 21 | YXYReadService yxyReadService ; |
22 | 22 | |
23 | - @Scheduled(cron = "0 0 22 * * ?") | |
23 | + @Scheduled(cron = "0 0 22 * * ? ") | |
24 | 24 | public void Sync(){ |
25 | 25 | //翼校通的同步 之后还有钉钉的同步等等 |
26 | - yxyWriteService.sync(); | |
27 | 26 | yxyReadService.sync(); |
27 | + yxyWriteService.sync(); | |
28 | 28 | } |
29 | 29 | } | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/model/YxyStudent.java
... | ... | @@ -6,6 +6,33 @@ public class YxyStudent { |
6 | 6 | private String classId ; |
7 | 7 | private String name ; |
8 | 8 | private String account ; |
9 | + private String cardID ; | |
10 | + private String cardID2; | |
11 | + private String cardID3 ; | |
12 | + | |
13 | + public String getCardID() { | |
14 | + return cardID; | |
15 | + } | |
16 | + | |
17 | + public void setCardID(String cardID) { | |
18 | + this.cardID = cardID; | |
19 | + } | |
20 | + | |
21 | + public String getCardID2() { | |
22 | + return cardID2; | |
23 | + } | |
24 | + | |
25 | + public void setCardID2(String cardID2) { | |
26 | + this.cardID2 = cardID2; | |
27 | + } | |
28 | + | |
29 | + public String getCardID3() { | |
30 | + return cardID3; | |
31 | + } | |
32 | + | |
33 | + public void setCardID3(String cardID3) { | |
34 | + this.cardID3 = cardID3; | |
35 | + } | |
9 | 36 | |
10 | 37 | public String getUserId() { |
11 | 38 | return userId; | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYReadService.java
... | ... | @@ -138,6 +138,9 @@ public class YXYReadService { |
138 | 138 | student.setAccount(object.get("account").toString()); |
139 | 139 | student.setName(object.get("name").toString()); |
140 | 140 | student.setUserId(object.get("userID").toString()); |
141 | + student.setCardID(object.get("cardID").toString()); | |
142 | + student.setCardID2(object.get("cardID2").toString()); | |
143 | + student.setCardID3(object.get("cardID3").toString()); | |
141 | 144 | }catch (Exception e){ |
142 | 145 | } |
143 | 146 | yxyService.insertStudent(student); | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYResult.java
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYWriteService.java
... | ... | @@ -51,19 +51,23 @@ public class YXYWriteService { |
51 | 51 | ScFeign scFeign ; |
52 | 52 | |
53 | 53 | public void sync(){ |
54 | - //查出要同步的学校 | |
55 | - logger.info("开始同步翼学云数据==========="); | |
56 | - List<SyncSchoolDto> schoolList = scFeign.selectSyncSchool(); | |
57 | - for(SyncSchoolDto school : schoolList){ | |
58 | - logger.info("学校"+school.getSchoolName()); | |
59 | - if(school.getPush() == 0){ | |
60 | - //同步课程 | |
61 | - syncSubject(school); | |
62 | - } | |
63 | - List<SyncDeptDto> deptList = scFeign.selectDept(school.getSchoolId()); | |
64 | - syncDept(school,deptList); | |
65 | - List<SyncUserDto> userList = scFeign.selectUser(school.getSchoolId()); | |
66 | - syncUser(school,userList); | |
54 | + try{ | |
55 | + //查出要同步的学校 | |
56 | + logger.info("开始同步翼学云数据==========="); | |
57 | + List<SyncSchoolDto> schoolList = scFeign.selectSyncSchool(); | |
58 | + for(SyncSchoolDto school : schoolList){ | |
59 | + logger.info("学校"+school.getSchoolName()); | |
60 | + if(school.getPush() == 0){ | |
61 | + //同步课程 | |
62 | + syncSubject(school); | |
63 | + } | |
64 | + List<SyncDeptDto> deptList = scFeign.selectDept(school.getSchoolId()); | |
65 | + syncDept(school,deptList); | |
66 | + List<SyncUserDto> userList = scFeign.selectUser(school.getSchoolId()); | |
67 | + syncUser(school,userList); | |
68 | + } | |
69 | + }catch (Exception e){ | |
70 | + | |
67 | 71 | } |
68 | 72 | } |
69 | 73 | |
... | ... | @@ -705,9 +709,17 @@ public class YXYWriteService { |
705 | 709 | |
706 | 710 | private YXYResult getResult(String url , String json){ |
707 | 711 | YXYResult result = invokeApi(url,TOKEN,json); |
708 | - if(result.getCode() == 2){ | |
712 | + if(result == null){ | |
709 | 713 | TOKEN = getToken(); |
710 | 714 | result = invokeApi(url,TOKEN,json); |
715 | + }else { | |
716 | + if (result.getCode() == 2) { | |
717 | + TOKEN = getToken(); | |
718 | + result = invokeApi(url, TOKEN, json); | |
719 | + } | |
720 | + } | |
721 | + if(result == null){ | |
722 | + result = new YXYResult(); | |
711 | 723 | } |
712 | 724 | return result ; |
713 | 725 | } | ... | ... |
cloud/quartz/src/main/resources/application.yaml
cloud/quartz/src/main/resources/mapper/YxyMapper.xml
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | </insert> |
27 | 27 | |
28 | 28 | <insert id="insertStudent" parameterType="com.sincere.quartz.model.YxyStudent" > |
29 | - insert into Student(userID , account , name , classID , intime , state , isCard , isEquipment , card_crafts) | |
30 | - values (#{userId} , #{account} , #{name} , #{classId} , GETDATE() , 1 ,0,0,2) | |
29 | + insert into Student(userID , account , name , classID , intime , state , isCard , isEquipment , card_crafts,cardID,cardid2,cardid3) | |
30 | + values (#{userId} , #{account} , #{name} , #{classId} , GETDATE() , 1 ,0,0,2,#{cardID},#{cardID2},#{cardID3}) | |
31 | 31 | </insert> |
32 | 32 | </mapper> | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/controller/AttendanceController.java
... | ... | @@ -34,7 +34,7 @@ public class AttendanceController { |
34 | 34 | attendacenService.updateAttendance(attendance.getClint_id()); |
35 | 35 | }else { |
36 | 36 | attendanceDto.setState(1); |
37 | - attendanceDto.setSchool_id("0"); | |
37 | + attendanceDto.setSchool_id("-1"); | |
38 | 38 | try { |
39 | 39 | attendanceDto.setIntime(DateUtils.getToday(DateUtils.format2)); |
40 | 40 | }catch (Exception e){ | ... | ... |
cloud/search_smartCampus/src/main/resources/application.yml
... | ... | @@ -21,16 +21,14 @@ mybatis: |
21 | 21 | type-aliases-package: com.sincere.smartSearch.mapper |
22 | 22 | check-config-location: true |
23 | 23 | |
24 | - | |
25 | - | |
26 | 24 | eureka: |
27 | 25 | instance: |
28 | - hostname: localhost | |
26 | + hostname: 121.40.109.21 | |
29 | 27 | lease-expiration-duration-in-seconds: 60 |
30 | 28 | lease-renewal-interval-in-seconds: 10 |
31 | 29 | client: |
32 | 30 | service-url: |
33 | 31 | # defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ |
34 | - defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ | |
32 | + defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/ | |
35 | 33 | |
36 | 34 | ... | ... |
cloud/search_xiaoan/pom.xml
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | <configuration> |
158 | 158 | <archive> |
159 | 159 | <manifest> |
160 | - <mainClass>com.jevon.Application</mainClass> | |
160 | + <mainClass>com.sincere.xiaoanSearch.XiaoanSearchApplication</mainClass> | |
161 | 161 | <addClasspath>true</addClasspath> |
162 | 162 | <classpathPrefix>lib/</classpathPrefix> |
163 | 163 | </manifest> | ... | ... |
cloud/search_xiaoan/src/main/resources/application.yml
... | ... | @@ -19,12 +19,12 @@ mybatis: |
19 | 19 | |
20 | 20 | eureka: |
21 | 21 | instance: |
22 | - hostname: localhost | |
22 | + hostname: 121.40.30.78 | |
23 | 23 | lease-expiration-duration-in-seconds: 60 |
24 | 24 | lease-renewal-interval-in-seconds: 10 |
25 | 25 | client: |
26 | 26 | service-url: |
27 | - defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ | |
27 | + defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/ | |
28 | 28 | |
29 | 29 | |
30 | 30 | ... | ... |