Commit 4fd85d858aaabe44ae1aa4ebbb821936e65fc989
1 parent
fb56ca7f
Exists in
master
中控指纹机发送看板调试
Showing
7 changed files
with
67 additions
and
5 deletions
Show diff stats
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/controller/UserController.java
... | ... | @@ -65,7 +65,7 @@ public class UserController { |
65 | 65 | } |
66 | 66 | |
67 | 67 | @RequestMapping(value = "getSchoolIdWidthCardNum", method = RequestMethod.GET) |
68 | - int getSchoolIdWidthCardNum(@RequestParam("num") String num) { | |
68 | + String getSchoolIdWidthCardNum(@RequestParam("num") String num) { | |
69 | 69 | return userService.getSchoolIdWidthCardNum(num); |
70 | 70 | } |
71 | 71 | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/mapper/UserMapper.java
... | ... | @@ -24,7 +24,7 @@ public interface UserMapper { |
24 | 24 | StudentBean getStudent_NumWitdCode(@Param("studentcode") String studentcode); |
25 | 25 | |
26 | 26 | |
27 | - int getSchoolIdWidthCardNum(@Param("cardNum") String cardNum); | |
27 | + String getSchoolIdWidthCardNum(@Param("cardNum") String cardNum); | |
28 | 28 | |
29 | 29 | List<String> getClintIds(@Param("schoolId") String schoolId); |
30 | 30 | ... | ... |
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/service/UserService.java
cloud/search_smartCampus/src/main/java/com/sincere/smartSearch/service/impl/UserServiceImpl.java
... | ... | @@ -95,7 +95,7 @@ public class UserServiceImpl implements UserService { |
95 | 95 | } |
96 | 96 | |
97 | 97 | @Override |
98 | - public int getSchoolIdWidthCardNum(String num) { | |
98 | + public String getSchoolIdWidthCardNum(String num) { | |
99 | 99 | return userMapper.getSchoolIdWidthCardNum(num); |
100 | 100 | } |
101 | 101 | ... | ... |
cloud/search_smartCampus/src/main/resources/mapper/UserMapper.xml
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | select student_num from SZ_V_School_Student where student_id = #{studentId} |
7 | 7 | </select> |
8 | 8 | |
9 | - <select id="getSchoolIdWidthCardNum" parameterType="java.lang.String" resultType="java.lang.Integer"> | |
9 | + <select id="getSchoolIdWidthCardNum" parameterType="java.lang.String" resultType="java.lang.String"> | |
10 | 10 | select Top(1) school_id from SZ_V_School_Student where student_num = #{cardNum} |
11 | 11 | </select> |
12 | 12 | ... | ... |
cloud/search_smartCampus/src/test/java/com.sincere.smartSearch/Tester.java
0 → 100644
... | ... | @@ -0,0 +1,17 @@ |
1 | +package com.sincere.smartSearch; | |
2 | + | |
3 | + | |
4 | +import org.junit.runner.RunWith; | |
5 | +import org.springframework.boot.test.context.SpringBootTest; | |
6 | +import org.springframework.test.context.junit4.SpringRunner; | |
7 | + | |
8 | + | |
9 | +/** | |
10 | + * 单元测试继承该类即可 | |
11 | + */ | |
12 | +@RunWith(SpringRunner.class) | |
13 | +@SpringBootTest | |
14 | +public abstract class Tester {} | |
15 | + | |
16 | + | |
17 | + | ... | ... |
cloud/search_smartCampus/src/test/java/com.sincere.smartSearch/mapper/SearchMapperTest.java
0 → 100644
... | ... | @@ -0,0 +1,45 @@ |
1 | +package com.sincere.smartSearch.mapper; | |
2 | + | |
3 | + | |
4 | +import com.sincere.smartSearch.Tester; | |
5 | +import com.sincere.smartSearch.service.AttendacenService; | |
6 | +import com.sincere.smartSearch.service.UserService; | |
7 | +import org.junit.Test; | |
8 | +import org.springframework.beans.factory.annotation.Autowired; | |
9 | + | |
10 | +import java.util.List; | |
11 | + | |
12 | +/** | |
13 | + * TODO | |
14 | + * | |
15 | + * @author xuquan | |
16 | + * @date 2020/11/18 10:13 | |
17 | + */ | |
18 | + | |
19 | +public class SearchMapperTest extends Tester { | |
20 | + | |
21 | + @Autowired | |
22 | + private AttendacenService attendacenService; | |
23 | + | |
24 | + @Autowired | |
25 | + private UserService userService; | |
26 | + | |
27 | + @Test | |
28 | + public void test(){ | |
29 | + String deviceId = "2181113246"; | |
30 | + System.out.println(attendacenService.selectPlaceAttendance(deviceId)); | |
31 | + System.out.println("======"); | |
32 | + String schoolId = "2"; | |
33 | + List<String> list = userService.getClintIds(schoolId); | |
34 | + if(list.size()>0){ | |
35 | + for(String s : list){ | |
36 | + System.out.println(s); | |
37 | + } | |
38 | + } | |
39 | + System.out.println("======"); | |
40 | + String cardNum ="6F27EA85"; | |
41 | + System.out.println(userService.getSchoolIdWidthCardNum(cardNum)); | |
42 | + | |
43 | + } | |
44 | + | |
45 | +} | ... | ... |