Commit e7154f2beb48a1e8d49d3c4e6657958f2323c8a5

Authored by 陈杰
1 parent 124aa27a
Exists in master

日志

cloud/quartz/src/main/java/com/sincere/quartz/job/SyncJob.java
@@ -20,10 +20,10 @@ public class SyncJob { @@ -20,10 +20,10 @@ public class SyncJob {
20 @Autowired 20 @Autowired
21 YXYReadService yxyReadService ; 21 YXYReadService yxyReadService ;
22 22
23 - @Scheduled(cron = "0 0 22 * * ?") 23 + @Scheduled(cron = "0 0 22 * * ? ")
24 public void Sync(){ 24 public void Sync(){
25 //翼校通的同步 之后还有钉钉的同步等等 25 //翼校通的同步 之后还有钉钉的同步等等
26 - yxyWriteService.sync();  
27 yxyReadService.sync(); 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 +6,33 @@ public class YxyStudent {
6 private String classId ; 6 private String classId ;
7 private String name ; 7 private String name ;
8 private String account ; 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 public String getUserId() { 37 public String getUserId() {
11 return userId; 38 return userId;
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYReadService.java
@@ -138,6 +138,9 @@ public class YXYReadService { @@ -138,6 +138,9 @@ public class YXYReadService {
138 student.setAccount(object.get("account").toString()); 138 student.setAccount(object.get("account").toString());
139 student.setName(object.get("name").toString()); 139 student.setName(object.get("name").toString());
140 student.setUserId(object.get("userID").toString()); 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 }catch (Exception e){ 144 }catch (Exception e){
142 } 145 }
143 yxyService.insertStudent(student); 146 yxyService.insertStudent(student);
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYResult.java
@@ -16,6 +16,9 @@ public class YXYResult implements Serializable { @@ -16,6 +16,9 @@ public class YXYResult implements Serializable {
16 private int pass ; 16 private int pass ;
17 private List<YXYResultDetail> data ; 17 private List<YXYResultDetail> data ;
18 18
  19 + public YXYResult() {
  20 + this.code = -1 ;
  21 + }
19 22
20 public int getCode() { 23 public int getCode() {
21 return code; 24 return code;
cloud/quartz/src/main/java/com/sincere/quartz/third/yixueyun/YXYWriteService.java
@@ -51,19 +51,23 @@ public class YXYWriteService { @@ -51,19 +51,23 @@ public class YXYWriteService {
51 ScFeign scFeign ; 51 ScFeign scFeign ;
52 52
53 public void sync(){ 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,9 +709,17 @@ public class YXYWriteService {
705 709
706 private YXYResult getResult(String url , String json){ 710 private YXYResult getResult(String url , String json){
707 YXYResult result = invokeApi(url,TOKEN,json); 711 YXYResult result = invokeApi(url,TOKEN,json);
708 - if(result.getCode() == 2){ 712 + if(result == null){
709 TOKEN = getToken(); 713 TOKEN = getToken();
710 result = invokeApi(url,TOKEN,json); 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 return result ; 724 return result ;
713 } 725 }
cloud/quartz/src/main/resources/application.yaml
@@ -39,5 +39,5 @@ eureka: @@ -39,5 +39,5 @@ eureka:
39 lease-renewal-interval-in-seconds: 10 39 lease-renewal-interval-in-seconds: 10
40 client: 40 client:
41 service-url: 41 service-url:
42 - defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ 42 + defaultZone: http://121.40.109.21:8761/eureka/,http://121.40.109.21:8762/eureka/
43 43
cloud/quartz/src/main/resources/mapper/YxyMapper.xml
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 </insert> 26 </insert>
27 27
28 <insert id="insertStudent" parameterType="com.sincere.quartz.model.YxyStudent" > 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 </insert> 31 </insert>
32 </mapper> 32 </mapper>
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/controller/AttendanceController.java
@@ -34,7 +34,7 @@ public class AttendanceController { @@ -34,7 +34,7 @@ public class AttendanceController {
34 attendacenService.updateAttendance(attendance.getClint_id()); 34 attendacenService.updateAttendance(attendance.getClint_id());
35 }else { 35 }else {
36 attendanceDto.setState(1); 36 attendanceDto.setState(1);
37 - attendanceDto.setSchool_id("0"); 37 + attendanceDto.setSchool_id("-1");
38 try { 38 try {
39 attendanceDto.setIntime(DateUtils.getToday(DateUtils.format2)); 39 attendanceDto.setIntime(DateUtils.getToday(DateUtils.format2));
40 }catch (Exception e){ 40 }catch (Exception e){
cloud/search_smartCampus/src/main/resources/application.yml
@@ -21,16 +21,14 @@ mybatis: @@ -21,16 +21,14 @@ mybatis:
21 type-aliases-package: com.sincere.smartSearch.mapper 21 type-aliases-package: com.sincere.smartSearch.mapper
22 check-config-location: true 22 check-config-location: true
23 23
24 -  
25 -  
26 eureka: 24 eureka:
27 instance: 25 instance:
28 - hostname: localhost 26 + hostname: 121.40.109.21
29 lease-expiration-duration-in-seconds: 60 27 lease-expiration-duration-in-seconds: 60
30 lease-renewal-interval-in-seconds: 10 28 lease-renewal-interval-in-seconds: 10
31 client: 29 client:
32 service-url: 30 service-url:
33 # defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/ 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,7 +157,7 @@
157 <configuration> 157 <configuration>
158 <archive> 158 <archive>
159 <manifest> 159 <manifest>
160 - <mainClass>com.jevon.Application</mainClass> 160 + <mainClass>com.sincere.xiaoanSearch.XiaoanSearchApplication</mainClass>
161 <addClasspath>true</addClasspath> 161 <addClasspath>true</addClasspath>
162 <classpathPrefix>lib/</classpathPrefix> 162 <classpathPrefix>lib/</classpathPrefix>
163 </manifest> 163 </manifest>
cloud/search_xiaoan/src/main/resources/application.yml
@@ -19,12 +19,12 @@ mybatis: @@ -19,12 +19,12 @@ mybatis:
19 19
20 eureka: 20 eureka:
21 instance: 21 instance:
22 - hostname: localhost 22 + hostname: 121.40.30.78
23 lease-expiration-duration-in-seconds: 60 23 lease-expiration-duration-in-seconds: 60
24 lease-renewal-interval-in-seconds: 10 24 lease-renewal-interval-in-seconds: 10
25 client: 25 client:
26 service-url: 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