Commit d1551e02d6bebf2ac100a5fd4276dbff7aefe22f
1 parent
ff013fbd
Exists in
master
通讯录同步
Showing
16 changed files
with
785 additions
and
5 deletions
Show diff stats
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/DeptRelationDto.java
0 → 100644
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/27 0027 10:53 | |
7 | + */ | |
8 | +public class DeptRelationDto { | |
9 | + | |
10 | + private int hxyDeptId; | |
11 | + private String yxyDeptId ; | |
12 | + private int userType ; | |
13 | + private int state ; | |
14 | + | |
15 | + private int sqlStatus ; // 1增2改3删 | |
16 | + | |
17 | + public int getHxyDeptId() { | |
18 | + return hxyDeptId; | |
19 | + } | |
20 | + | |
21 | + public void setHxyDeptId(int hxyDeptId) { | |
22 | + this.hxyDeptId = hxyDeptId; | |
23 | + } | |
24 | + | |
25 | + public String getYxyDeptId() { | |
26 | + return yxyDeptId; | |
27 | + } | |
28 | + | |
29 | + public void setYxyDeptId(String yxyDeptId) { | |
30 | + this.yxyDeptId = yxyDeptId; | |
31 | + } | |
32 | + | |
33 | + public int getUserType() { | |
34 | + return userType; | |
35 | + } | |
36 | + | |
37 | + public void setUserType(int userType) { | |
38 | + this.userType = userType; | |
39 | + } | |
40 | + | |
41 | + public int getState() { | |
42 | + return state; | |
43 | + } | |
44 | + | |
45 | + public void setState(int state) { | |
46 | + this.state = state; | |
47 | + } | |
48 | + | |
49 | + public int getSqlStatus() { | |
50 | + return sqlStatus; | |
51 | + } | |
52 | + | |
53 | + public void setSqlStatus(int sqlStatus) { | |
54 | + this.sqlStatus = sqlStatus; | |
55 | + } | |
56 | +} | ... | ... |
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/GroupDto.java
0 → 100644
... | ... | @@ -0,0 +1,37 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/26 0026 15:47 | |
7 | + */ | |
8 | +public class GroupDto { | |
9 | + | |
10 | + private int groupId ; | |
11 | + private String groupName ; | |
12 | + private int pId ; | |
13 | + | |
14 | + public int getGroupId() { | |
15 | + return groupId; | |
16 | + } | |
17 | + | |
18 | + public void setGroupId(int groupId) { | |
19 | + this.groupId = groupId; | |
20 | + } | |
21 | + | |
22 | + public String getGroupName() { | |
23 | + return groupName; | |
24 | + } | |
25 | + | |
26 | + public void setGroupName(String groupName) { | |
27 | + this.groupName = groupName; | |
28 | + } | |
29 | + | |
30 | + public int getpId() { | |
31 | + return pId; | |
32 | + } | |
33 | + | |
34 | + public void setpId(int pId) { | |
35 | + this.pId = pId; | |
36 | + } | |
37 | +} | ... | ... |
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/SyncDeptDto.java
0 → 100644
... | ... | @@ -0,0 +1,73 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/27 0027 9:28 | |
7 | + */ | |
8 | +public class SyncDeptDto { | |
9 | + private int id ; | |
10 | + private int deptId ; | |
11 | + private int schoolId ; | |
12 | + private String deptName ; | |
13 | + private int updateType ; | |
14 | + private int gradeId ; | |
15 | + private int userType ; | |
16 | + | |
17 | + public int getId() { | |
18 | + return id; | |
19 | + } | |
20 | + | |
21 | + public void setId(int id) { | |
22 | + this.id = id; | |
23 | + } | |
24 | + | |
25 | + public int getDeptId() { | |
26 | + return deptId; | |
27 | + } | |
28 | + | |
29 | + public void setDeptId(int deptId) { | |
30 | + this.deptId = deptId; | |
31 | + } | |
32 | + | |
33 | + public int getSchoolId() { | |
34 | + return schoolId; | |
35 | + } | |
36 | + | |
37 | + public void setSchoolId(int schoolId) { | |
38 | + this.schoolId = schoolId; | |
39 | + } | |
40 | + | |
41 | + public String getDeptName() { | |
42 | + return deptName; | |
43 | + } | |
44 | + | |
45 | + public void setDeptName(String deptName) { | |
46 | + this.deptName = deptName; | |
47 | + } | |
48 | + | |
49 | + public int getUpdateType() { | |
50 | + return updateType; | |
51 | + } | |
52 | + | |
53 | + public void setUpdateType(int updateType) { | |
54 | + this.updateType = updateType; | |
55 | + } | |
56 | + | |
57 | + public int getGradeId() { | |
58 | + return gradeId; | |
59 | + } | |
60 | + | |
61 | + public void setGradeId(int gradeId) { | |
62 | + this.gradeId = gradeId; | |
63 | + } | |
64 | + | |
65 | + public int getUserType() { | |
66 | + return userType; | |
67 | + } | |
68 | + | |
69 | + public void setUserType(int userType) { | |
70 | + this.userType = userType; | |
71 | + } | |
72 | + | |
73 | +} | ... | ... |
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/SyncSchoolDto.java
0 → 100644
... | ... | @@ -0,0 +1,46 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/26 0026 15:39 | |
7 | + */ | |
8 | +public class SyncSchoolDto { | |
9 | + | |
10 | + private int schoolId ; | |
11 | + private String schoolName ; | |
12 | + private String yxtId ; | |
13 | + private int push ; | |
14 | + | |
15 | + public int getSchoolId() { | |
16 | + return schoolId; | |
17 | + } | |
18 | + | |
19 | + public void setSchoolId(int schoolId) { | |
20 | + this.schoolId = schoolId; | |
21 | + } | |
22 | + | |
23 | + public String getSchoolName() { | |
24 | + return schoolName; | |
25 | + } | |
26 | + | |
27 | + public void setSchoolName(String schoolName) { | |
28 | + this.schoolName = schoolName; | |
29 | + } | |
30 | + | |
31 | + public String getYxtId() { | |
32 | + return yxtId; | |
33 | + } | |
34 | + | |
35 | + public void setYxtId(String yxtId) { | |
36 | + this.yxtId = yxtId; | |
37 | + } | |
38 | + | |
39 | + public int getPush() { | |
40 | + return push; | |
41 | + } | |
42 | + | |
43 | + public void setPush(int push) { | |
44 | + this.push = push; | |
45 | + } | |
46 | +} | ... | ... |
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/SyncUserDto.java
0 → 100644
... | ... | @@ -0,0 +1,82 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/27 0027 9:38 | |
7 | + */ | |
8 | +public class SyncUserDto { | |
9 | + | |
10 | + private int id ; | |
11 | + private String name ; | |
12 | + private String customerId ; | |
13 | + private int userType ; | |
14 | + private int classId ; | |
15 | + private int sex ; | |
16 | + private String mobile ; | |
17 | + private int updateType ; | |
18 | + | |
19 | + public int getId() { | |
20 | + return id; | |
21 | + } | |
22 | + | |
23 | + public void setId(int id) { | |
24 | + this.id = id; | |
25 | + } | |
26 | + | |
27 | + public String getName() { | |
28 | + return name; | |
29 | + } | |
30 | + | |
31 | + public void setName(String name) { | |
32 | + this.name = name; | |
33 | + } | |
34 | + | |
35 | + public String getCustomerId() { | |
36 | + return customerId; | |
37 | + } | |
38 | + | |
39 | + public void setCustomerId(String customerId) { | |
40 | + this.customerId = customerId; | |
41 | + } | |
42 | + | |
43 | + public int getUserType() { | |
44 | + return userType; | |
45 | + } | |
46 | + | |
47 | + public void setUserType(int userType) { | |
48 | + this.userType = userType; | |
49 | + } | |
50 | + | |
51 | + public int getClassId() { | |
52 | + return classId; | |
53 | + } | |
54 | + | |
55 | + public void setClassId(int classId) { | |
56 | + this.classId = classId; | |
57 | + } | |
58 | + | |
59 | + public int getSex() { | |
60 | + return sex; | |
61 | + } | |
62 | + | |
63 | + public void setSex(int sex) { | |
64 | + this.sex = sex; | |
65 | + } | |
66 | + | |
67 | + public String getMobile() { | |
68 | + return mobile; | |
69 | + } | |
70 | + | |
71 | + public void setMobile(String mobile) { | |
72 | + this.mobile = mobile; | |
73 | + } | |
74 | + | |
75 | + public int getUpdateType() { | |
76 | + return updateType; | |
77 | + } | |
78 | + | |
79 | + public void setUpdateType(int updateType) { | |
80 | + this.updateType = updateType; | |
81 | + } | |
82 | +} | ... | ... |
cloud/common/src/main/java/com/sincere/common/dto/smartCampus/UserRelationDto.java
0 → 100644
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.sincere.common.dto.smartCampus; | |
2 | + | |
3 | +/** | |
4 | + * @author chen | |
5 | + * @version 1.0 | |
6 | + * @date 2019/12/27 0027 15:45 | |
7 | + */ | |
8 | +public class UserRelationDto { | |
9 | + | |
10 | + private String hxyCustomerId ; | |
11 | + private String yxyUserId ; | |
12 | + private int userType ; | |
13 | + private int state ; | |
14 | + | |
15 | + private int sqlstate ; | |
16 | + | |
17 | + public String getHxyCustomerId() { | |
18 | + return hxyCustomerId; | |
19 | + } | |
20 | + | |
21 | + public void setHxyCustomerId(String hxyCustomerId) { | |
22 | + this.hxyCustomerId = hxyCustomerId; | |
23 | + } | |
24 | + | |
25 | + public String getYxyUserId() { | |
26 | + return yxyUserId; | |
27 | + } | |
28 | + | |
29 | + public void setYxyUserId(String yxyUserId) { | |
30 | + this.yxyUserId = yxyUserId; | |
31 | + } | |
32 | + | |
33 | + public int getUserType() { | |
34 | + return userType; | |
35 | + } | |
36 | + | |
37 | + public void setUserType(int userType) { | |
38 | + this.userType = userType; | |
39 | + } | |
40 | + | |
41 | + public int getState() { | |
42 | + return state; | |
43 | + } | |
44 | + | |
45 | + public void setState(int state) { | |
46 | + this.state = state; | |
47 | + } | |
48 | + | |
49 | + public int getSqlstate() { | |
50 | + return sqlstate; | |
51 | + } | |
52 | + | |
53 | + public void setSqlstate(int sqlstate) { | |
54 | + this.sqlstate = sqlstate; | |
55 | + } | |
56 | +} | ... | ... |
cloud/quartz/src/main/java/com/sincere/quartz/feign/ScFeign.java
... | ... | @@ -45,4 +45,42 @@ public interface ScFeign { |
45 | 45 | |
46 | 46 | @RequestMapping(value = "/sm/rp/selectNotBind",method = RequestMethod.GET) |
47 | 47 | List<ParentDto> selectNotBind(@RequestParam("schoolId") int schoolId , @RequestParam("type") int type); |
48 | + | |
49 | + | |
50 | + //同步通讯录 | |
51 | + @RequestMapping(value = "sm/sync/selectSyncSchool",method = RequestMethod.GET) | |
52 | + List<SyncSchoolDto> selectSyncSchool(); | |
53 | + | |
54 | + @RequestMapping(value = "sm/sync/selectGroup",method = RequestMethod.GET) | |
55 | + List<GroupDto> selectGroup(@RequestParam("schoolId") int schoolId); | |
56 | + | |
57 | + @RequestMapping(value = "sm/sync/selectSubject",method = RequestMethod.GET) | |
58 | + List<String> selectSubject(@RequestParam("schoolId") int schoolId); | |
59 | + | |
60 | + @RequestMapping(value = "sm/sync/selectDept",method = RequestMethod.GET) | |
61 | + List<SyncDeptDto> selectDept(@RequestParam("schoolId") int schoolId) ; | |
62 | + | |
63 | + @RequestMapping(value = "sm/sync/selectUser",method = RequestMethod.GET) | |
64 | + List<SyncUserDto> selectUser(@RequestParam("schoolId") int schoolId); | |
65 | + | |
66 | + @RequestMapping(value = "sm/sync/updateSchool",method = RequestMethod.GET) | |
67 | + void updateSchool(@RequestParam("schoolId") int schoolId); | |
68 | + | |
69 | + @RequestMapping(value = "sm/sync/updateDept",method = RequestMethod.GET) | |
70 | + void updateDept(@RequestParam("id") int id); | |
71 | + | |
72 | + @RequestMapping(value = "sm/sync/updateUser",method = RequestMethod.GET) | |
73 | + void updateUser(@RequestParam("id")int id); | |
74 | + | |
75 | + @RequestMapping(value = "sm/sync/updateDeptRelation",method = RequestMethod.POST) | |
76 | + void updateDeptRelation(@RequestBody DeptRelationDto deptRelationDto); | |
77 | + | |
78 | + @RequestMapping(value = "sm/sync/selectYxyIdByHxyId",method = RequestMethod.GET) | |
79 | + String selectYxyIdByHxyId(@RequestParam("hxyId") int hxyId); | |
80 | + | |
81 | + @RequestMapping(value = "sm/sync/updateUserRelation",method = RequestMethod.POST) | |
82 | + void updateUserRelation(@RequestBody UserRelationDto userRelationDto); | |
83 | + | |
84 | + @RequestMapping(value = "sm/sync/selectUserYxyIdByHxyId",method = RequestMethod.GET) | |
85 | + String selectUserYxyIdByHxyId(@RequestParam("hxyCustomerId") String hxyCustomerId); | |
48 | 86 | } | ... | ... |
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
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +package com.sincere.quartz.job; | |
2 | + | |
3 | +import com.sincere.quartz.third.yixueyun.YXYReadService; | |
4 | +import com.sincere.quartz.third.yixueyun.YXYWriteService; | |
5 | +import org.springframework.beans.factory.annotation.Autowired; | |
6 | +import org.springframework.scheduling.annotation.Scheduled; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +/** | |
10 | + * @author chen | |
11 | + * @version 1.0 | |
12 | + * @date 2019/12/24 0024 10:54 | |
13 | + */ | |
14 | +@Service | |
15 | +public class SyncJob { | |
16 | + | |
17 | + @Autowired | |
18 | + YXYWriteService yxyWriteService ; | |
19 | + | |
20 | + @Autowired | |
21 | + YXYReadService yxyReadService ; | |
22 | + | |
23 | + @Scheduled(cron = "0/1 * * * * ? ") | |
24 | + //@Scheduled(cron = "0 0 23 * * ? ") | |
25 | + public void Sync(){ | |
26 | + //翼校通的同步 之后还有钉钉的同步等等 | |
27 | + yxyWriteService.sync(); | |
28 | + //yxyReadService.sync(); | |
29 | + } | |
30 | +} | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/controller/SyncController.java
0 → 100644
... | ... | @@ -0,0 +1,90 @@ |
1 | +package com.sincere.smartSearch.controller; | |
2 | + | |
3 | +import com.sincere.common.dto.smartCampus.*; | |
4 | +import com.sincere.smartSearch.service.SyncService; | |
5 | +import org.springframework.beans.factory.annotation.Autowired; | |
6 | +import org.springframework.web.bind.annotation.*; | |
7 | + | |
8 | +import java.util.List; | |
9 | + | |
10 | +/** | |
11 | + * @author chen | |
12 | + * @version 1.0 | |
13 | + * @date 2019/12/27 0027 9:55 | |
14 | + */ | |
15 | +@RestController | |
16 | +@RequestMapping("sm/sync") | |
17 | +public class SyncController { | |
18 | + | |
19 | + @Autowired | |
20 | + SyncService syncService ; | |
21 | + | |
22 | + @RequestMapping(value = "selectSyncSchool",method = RequestMethod.GET) | |
23 | + List<SyncSchoolDto> selectSyncSchool(){ | |
24 | + return syncService.selectSyncSchool(); | |
25 | + } | |
26 | + | |
27 | + @RequestMapping(value = "updateSchool",method = RequestMethod.GET) | |
28 | + void updateSchool(@RequestParam("schoolId") int schoolId){ | |
29 | + syncService.updateSchool(schoolId); | |
30 | + } | |
31 | + | |
32 | + | |
33 | + @RequestMapping(value = "selectGroup",method = RequestMethod.GET) | |
34 | + List<GroupDto> selectGroup(@RequestParam("schoolId") int schoolId){ | |
35 | + return syncService.selectGroup(schoolId); | |
36 | + } | |
37 | + | |
38 | + @RequestMapping(value = "selectSubject",method = RequestMethod.GET) | |
39 | + List<String> selectSubject(@RequestParam("schoolId") int schoolId){ | |
40 | + return syncService.selectSubject(schoolId); | |
41 | + } | |
42 | + | |
43 | + @RequestMapping(value = "selectDept",method = RequestMethod.GET) | |
44 | + List<SyncDeptDto> selectDept(@RequestParam("schoolId") int schoolId){ | |
45 | + return syncService.selectDept(schoolId); | |
46 | + } | |
47 | + | |
48 | + @RequestMapping(value = "updateDept",method = RequestMethod.GET) | |
49 | + void updateDept(@RequestParam("id") int id) { | |
50 | + syncService.updateDept(id); | |
51 | + } | |
52 | + | |
53 | + @RequestMapping(value = "updateUser",method = RequestMethod.GET) | |
54 | + void updateUser(@RequestParam("id")int id){ | |
55 | + syncService.updateUser(id); | |
56 | + } | |
57 | + | |
58 | + @RequestMapping(value = "updateDeptRelation",method = RequestMethod.POST) | |
59 | + void updateDeptRelation(@RequestBody DeptRelationDto deptRelationDto){ //1 新增 2 修改删除 | |
60 | + if(deptRelationDto.getSqlStatus() == 1){ | |
61 | + syncService.insertDeptRelation(deptRelationDto); | |
62 | + }else { | |
63 | + syncService.updateDeptRelation(deptRelationDto); | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + @RequestMapping(value = "selectUser",method = RequestMethod.GET) | |
68 | + List<SyncUserDto> selectUser(@RequestParam("schoolId") int schoolId){ | |
69 | + return syncService.selectUser(schoolId); | |
70 | + } | |
71 | + | |
72 | + @RequestMapping(value = "selectYxyIdByHxyId",method = RequestMethod.GET) | |
73 | + String selectYxyIdByHxyId(@RequestParam("hxyId") int hxyId){ | |
74 | + return syncService.selectYxyIdByHxyId(hxyId); | |
75 | + } | |
76 | + | |
77 | + @RequestMapping(value = "updateUserRelation",method = RequestMethod.POST) | |
78 | + void updateUserRelation(@RequestBody UserRelationDto userRelationDto){ //1 新增 2 修改删除 | |
79 | + if(userRelationDto.getSqlstate() == 1){ | |
80 | + syncService.insertUserRelation(userRelationDto); | |
81 | + }else { | |
82 | + syncService.updateUserRelation(userRelationDto); | |
83 | + } | |
84 | + } | |
85 | + | |
86 | + @RequestMapping(value = "selectUserYxyIdByHxyId",method = RequestMethod.GET) | |
87 | + String selectUserYxyIdByHxyId(@RequestParam("hxyCustomerId") String hxyCustomerId){ | |
88 | + return syncService.selectUserYxyIdByHxyId(hxyCustomerId); | |
89 | + } | |
90 | +} | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/mapper/SyncMapper.java
0 → 100644
... | ... | @@ -0,0 +1,42 @@ |
1 | +package com.sincere.smartSearch.mapper; | |
2 | + | |
3 | +import com.sincere.common.dto.smartCampus.*; | |
4 | +import com.sincere.smartSearch.model.User; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * @author chen | |
10 | + * @version 1.0 | |
11 | + * @date 2019/12/26 0026 15:35 | |
12 | + */ | |
13 | +public interface SyncMapper { | |
14 | + | |
15 | + List<SyncSchoolDto> selectSyncSchool(); | |
16 | + | |
17 | + int updateSchool(int schoolId); | |
18 | + | |
19 | + List<GroupDto> selectGroup(int schoolId) ; | |
20 | + | |
21 | + int updateDept(int id); | |
22 | + | |
23 | + int updateUser(int id); | |
24 | + | |
25 | + List<String> selectSubject(int schoolId); | |
26 | + | |
27 | + List<SyncDeptDto> selectDept(int schoolId) ; | |
28 | + | |
29 | + List<SyncUserDto> selectUser(int schoolId); | |
30 | + | |
31 | + int insertDeptRelation(DeptRelationDto deptRelationDto); | |
32 | + | |
33 | + int updateDeptRelation(DeptRelationDto deptRelationDto); | |
34 | + | |
35 | + String selectYxyIdByHxyId(int hxyDeptId); | |
36 | + | |
37 | + int insertUserRelation(UserRelationDto userRelationDto); | |
38 | + | |
39 | + int updateUserRelation(UserRelationDto userRelationDto); | |
40 | + | |
41 | + String selectUserYxyIdByHxyId(String hxyCustomerId); | |
42 | +} | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/service/SyncService.java
0 → 100644
... | ... | @@ -0,0 +1,41 @@ |
1 | +package com.sincere.smartSearch.service; | |
2 | + | |
3 | +import com.sincere.common.dto.smartCampus.*; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * @author chen | |
9 | + * @version 1.0 | |
10 | + * @date 2019/12/27 0027 9:51 | |
11 | + */ | |
12 | +public interface SyncService { | |
13 | + | |
14 | + List<SyncSchoolDto> selectSyncSchool(); | |
15 | + | |
16 | + int updateSchool(int schoolId); | |
17 | + | |
18 | + List<GroupDto> selectGroup(int schoolId) ; | |
19 | + | |
20 | + int updateDept(int id); | |
21 | + | |
22 | + int updateUser(int id); | |
23 | + | |
24 | + List<String> selectSubject(int schoolId); | |
25 | + | |
26 | + List<SyncDeptDto> selectDept(int schoolId) ; | |
27 | + | |
28 | + List<SyncUserDto> selectUser(int schoolId); | |
29 | + | |
30 | + int insertDeptRelation(DeptRelationDto deptRelationDto); | |
31 | + | |
32 | + int updateDeptRelation(DeptRelationDto deptRelationDto); | |
33 | + | |
34 | + String selectYxyIdByHxyId(int hxyId); | |
35 | + | |
36 | + int insertUserRelation(UserRelationDto userRelationDto); | |
37 | + | |
38 | + int updateUserRelation(UserRelationDto userRelationDto); | |
39 | + | |
40 | + String selectUserYxyIdByHxyId(String hxyCustomerId); | |
41 | +} | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/service/impl/SyncServiceImpl.java
0 → 100644
... | ... | @@ -0,0 +1,91 @@ |
1 | +package com.sincere.smartSearch.service.impl; | |
2 | + | |
3 | +import com.sincere.common.dto.smartCampus.*; | |
4 | +import com.sincere.smartSearch.mapper.SyncMapper; | |
5 | +import com.sincere.smartSearch.service.SyncService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * @author chen | |
13 | + * @version 1.0 | |
14 | + * @date 2019/12/27 0027 9:51 | |
15 | + */ | |
16 | +@Service | |
17 | +public class SyncServiceImpl implements SyncService { | |
18 | + | |
19 | + @Autowired | |
20 | + SyncMapper syncMapper ; | |
21 | + | |
22 | + @Override | |
23 | + public List<SyncSchoolDto> selectSyncSchool() { | |
24 | + return syncMapper.selectSyncSchool(); | |
25 | + } | |
26 | + | |
27 | + @Override | |
28 | + public int updateSchool(int schoolId) { | |
29 | + return syncMapper.updateSchool(schoolId); | |
30 | + } | |
31 | + | |
32 | + @Override | |
33 | + public List<GroupDto> selectGroup(int schoolId) { | |
34 | + return syncMapper.selectGroup(schoolId); | |
35 | + } | |
36 | + | |
37 | + @Override | |
38 | + public int updateDept(int id) { | |
39 | + return syncMapper.updateDept(id); | |
40 | + } | |
41 | + | |
42 | + @Override | |
43 | + public int updateUser(int id) { | |
44 | + return syncMapper.updateUser(id); | |
45 | + } | |
46 | + | |
47 | + @Override | |
48 | + public List<String> selectSubject(int schoolId) { | |
49 | + return syncMapper.selectSubject(schoolId); | |
50 | + } | |
51 | + | |
52 | + @Override | |
53 | + public List<SyncDeptDto> selectDept(int schoolId) { | |
54 | + return syncMapper.selectDept(schoolId); | |
55 | + } | |
56 | + | |
57 | + @Override | |
58 | + public List<SyncUserDto> selectUser(int schoolId) { | |
59 | + return syncMapper.selectUser(schoolId); | |
60 | + } | |
61 | + | |
62 | + @Override | |
63 | + public int insertDeptRelation(DeptRelationDto deptRelationDto) { | |
64 | + return syncMapper.insertDeptRelation(deptRelationDto); | |
65 | + } | |
66 | + | |
67 | + @Override | |
68 | + public int updateDeptRelation(DeptRelationDto deptRelationDto) { | |
69 | + return syncMapper.updateDeptRelation(deptRelationDto); | |
70 | + } | |
71 | + | |
72 | + @Override | |
73 | + public String selectYxyIdByHxyId(int hxyId) { | |
74 | + return syncMapper.selectYxyIdByHxyId(hxyId); | |
75 | + } | |
76 | + | |
77 | + @Override | |
78 | + public int insertUserRelation(UserRelationDto userRelationDto) { | |
79 | + return syncMapper.insertUserRelation(userRelationDto); | |
80 | + } | |
81 | + | |
82 | + @Override | |
83 | + public int updateUserRelation(UserRelationDto userRelationDto) { | |
84 | + return syncMapper.updateUserRelation(userRelationDto); | |
85 | + } | |
86 | + | |
87 | + @Override | |
88 | + public String selectUserYxyIdByHxyId(String hxyCustomerId) { | |
89 | + return syncMapper.selectUserYxyIdByHxyId(hxyCustomerId); | |
90 | + } | |
91 | +} | ... | ... |
cloud/search_smartCampus/src/main/resources/application.yml
... | ... | @@ -4,9 +4,12 @@ spring: |
4 | 4 | application: |
5 | 5 | name: smartCampusSearch |
6 | 6 | datasource: |
7 | - username: szjxtuser | |
8 | - password: RQminVCJota3H1u8bBYH | |
9 | - url: jdbc:sqlserver://116.62.155.137:33419;database=SmartCampus | |
7 | +# username: szjxtuser | |
8 | +# password: RQminVCJota3H1u8bBYH | |
9 | +# url: jdbc:sqlserver://116.62.155.137:33419;database=SmartCampus | |
10 | + username: SZJXTUSER | |
11 | + password: xst200919 | |
12 | + url: jdbc:sqlserver://60.190.202.57:14333;database=SmartCampusSZ | |
10 | 13 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
11 | 14 | mvc: |
12 | 15 | static-path-pattern: /images/** | ... | ... |
cloud/search_smartCampus/src/main/resources/mapper/SyncMapper.xml
0 → 100644
... | ... | @@ -0,0 +1,95 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.sincere.smartSearch.mapper.SyncMapper" > | |
4 | + | |
5 | + <resultMap id="SyncSchoolDto" type="com.sincere.common.dto.smartCampus.SyncSchoolDto" > | |
6 | + <result column="SchoolId_XX" property="schoolId" /> | |
7 | + <result column="SchoolName" property="schoolName" /> | |
8 | + <result column="SchoolId_YXT" property="yxtId" /> | |
9 | + <result column="IsAllPush" property="push" /> | |
10 | + </resultMap> | |
11 | + <select id="selectSyncSchool" resultMap="SyncSchoolDto"> | |
12 | + select SchoolId_XX , SchoolName , SchoolId_YXT , IsAllPush from HS_SchoolRelated where SchoolId_YXT is not null and SchoolId_YXT != '' | |
13 | + </select> | |
14 | + | |
15 | + <update id="updateSchool" parameterType="java.lang.Integer"> | |
16 | + update HS_SchoolRelated set IsAllPush = 1 where SchoolId_XX = #{schoolId} | |
17 | + </update> | |
18 | + | |
19 | + <resultMap id="GroupDto" type="com.sincere.common.dto.smartCampus.GroupDto"> | |
20 | + <result column="group_id" property="groupId" /> | |
21 | + <result column="group_name" property="groupName" /> | |
22 | + <result column="p_id" property="pId" /> | |
23 | + </resultMap> | |
24 | + <select id="selectGroup" parameterType="java.lang.Integer" resultMap="GroupDto"> | |
25 | + select group_id , group_name , p_id from SZ_TeaGroup where state=1 and school_id = #{schoolId} | |
26 | + </select> | |
27 | + | |
28 | + <select id="selectSubject" parameterType="java.lang.Integer" resultType="java.lang.String"> | |
29 | + select DISTINCT subject_name from SZ_Subject where school_id = #{schoolId} and Status = 1 | |
30 | + </select> | |
31 | + | |
32 | + <resultMap id="DeptDto" type="com.sincere.common.dto.smartCampus.SyncDeptDto"> | |
33 | + <result column="ID" property="id" /> | |
34 | + <result column="Dept_id" property="deptId" /> | |
35 | + <result column="schoolid" property="schoolId" /> | |
36 | + <result column="Dept_name" property="deptName" /> | |
37 | + <result column="UpdateType" property="updateType" /> | |
38 | + <result column="gradeId" property="gradeId" /> | |
39 | + <result column="usertype" property="userType" /> | |
40 | + </resultMap> | |
41 | + <select id="selectDept" parameterType="java.lang.Integer" resultMap="DeptDto"> | |
42 | + select ID , Dept_id , schoolid , Dept_name ,UpdateType ,gradeId , usertype from HS_TeaGroupUpdate where schoolid = #{schoolId} | |
43 | + and yxy_is_new = 0 | |
44 | + </select> | |
45 | + | |
46 | + <update id="updateDept" parameterType="java.lang.Integer" > | |
47 | + update HS_TeaGroupUpdate set yxy_is_new = 1 where ID = #{id} | |
48 | + </update> | |
49 | + | |
50 | + <update id="updateUser" parameterType="java.lang.Integer" > | |
51 | + update HS_StudentUpdateCard set yxy_is_new = 1 where ID = #{id} | |
52 | + </update> | |
53 | + | |
54 | + <resultMap id="UserDtp" type="com.sincere.common.dto.smartCampus.SyncUserDto"> | |
55 | + <result column="ID" property="id" /> | |
56 | + <result column="UserType" property="userType" /> | |
57 | + <result column="Name" property="name" /> | |
58 | + <result column="ClassId" property="classId" /> | |
59 | + <result column="CustomerId" property="customerId" /> | |
60 | + <result column="Sex" property="sex" /> | |
61 | + <result column="mobile" property="mobile" /> | |
62 | + <result column="UpdateType" property="updateType" /> | |
63 | + </resultMap> | |
64 | + <select id="selectUser" parameterType="java.lang.Integer" resultMap="UserDtp"> | |
65 | + select ID , UserType , Name , ClassId , CustomerId , Sex , mobile , UpdateType from HS_StudentUpdateCard | |
66 | + where SchoolId = #{schoolId} and Yxy_IsNew = 0 | |
67 | + </select> | |
68 | + | |
69 | + <insert id="insertDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> | |
70 | + insert into SZ_DeptRelation (hxyDeptId,yxyDeptId,usertype,updateTime,createTime,state) | |
71 | + values (#{hxyDeptId},#{yxyDeptId},#{userType},GETDATE(),GETDATE(),#{state}) | |
72 | + </insert> | |
73 | + | |
74 | + <update id="updateDeptRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> | |
75 | + update SZ_DeptRelation set updateTime = GETDATE() where state = #{state} and hxyDeptId = #{hxyDeptId} | |
76 | + </update> | |
77 | + | |
78 | + <select id="selectYxyIdByHxyId" parameterType="java.lang.Integer" resultType="java.lang.String"> | |
79 | + select yxyDeptId from SZ_DeptRelation where hxyDeptId = #{hxyDeptId} | |
80 | + </select> | |
81 | + | |
82 | + | |
83 | + <insert id="insertUserRelation" parameterType="com.sincere.common.dto.smartCampus.UserRelationDto"> | |
84 | + insert into SZ_UserRelation (hxyCustomerId,yxyUserId,userType,updateTime,createTime,state) | |
85 | + values (#{hxyCustomerId},#{yxyUserId},#{userType},GETDATE(),GETDATE(),#{state}) | |
86 | + </insert> | |
87 | + | |
88 | + <update id="updateUserRelation" parameterType="com.sincere.common.dto.smartCampus.DeptRelationDto"> | |
89 | + update SZ_UserRelation set updateTime = GETDATE() where state = #{state} and hxyCustomerId = #{hxyCustomerId} | |
90 | + </update> | |
91 | + | |
92 | + <select id="selectUserYxyIdByHxyId" parameterType="java.lang.String" resultType="java.lang.String"> | |
93 | + select yxyUserId from SZ_UserRelation where hxyCustomerId = #{hxyCustomerId} | |
94 | + </select> | |
95 | +</mapper> | |
0 | 96 | \ No newline at end of file | ... | ... |