张延森 3 år sedan
förälder
incheckning
40a6560c42

+ 1
- 1
deploy/bootstrap Visa fil

@@ -2,6 +2,6 @@
2 2
 #
3 3
 #
4 4
 
5
-appVer="0.0.6"
5
+appVer="0.0.8"
6 6
 
7 7
 java -jar ./medical-plat-${appVer}.jar

+ 1
- 1
deploy/template.yml Visa fil

@@ -11,7 +11,7 @@ Resources:
11 11
       Properties:
12 12
         Handler: com.yunzhi.demo.SpringApplication::main
13 13
         Runtime: custom
14
-        CodeUri: 'oss://yz-serverless/medical-plat/medical-plat-0.0.6.zip'
14
+        CodeUri: 'oss://yz-serverless/medical-plat/medical-plat-0.0.8.zip'
15 15
         MemorySize: 1024
16 16
         Timeout: 30
17 17
         InitializationTimeout: 30

+ 1
- 1
pom.xml Visa fil

@@ -10,7 +10,7 @@
10 10
 	</parent>
11 11
 	<groupId>com.yunzhi</groupId>
12 12
 	<artifactId>medical-plat</artifactId>
13
-	<version>0.0.6</version>
13
+	<version>0.0.8</version>
14 14
 	<name>medical-plat</name>
15 15
 	<description>Demo project for Spring Boot</description>
16 16
 

+ 12
- 2
src/main/java/com/yunzhi/demo/controller/TaTestLogController.java Visa fil

@@ -62,11 +62,13 @@ public class TaTestLogController extends BaseController {
62 62
                                       @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
63 63
         TaPerson taPerson = getCurrentPerson();
64 64
         TaStudent taStudent = iTaStudentService.getByPersonId(taPerson.getPersonId());
65
-        String studentId = taStudent == null ? "******" : taStudent.getStudentId();
65
+        String schoolId = taStudent == null ? "******" : taStudent.getSchoolId();
66
+        String studentNo = taStudent == null ? "******" : taStudent.getStudentNo();
66 67
 
67 68
         IPage<TaTestLog> pg = new Page<>(pageNum, pageSize);
68 69
         QueryWrapper<TaTestLog> queryWrapper = new QueryWrapper<>();
69
-        queryWrapper.eq("student_id", studentId);
70
+        queryWrapper.eq("school_id", schoolId);
71
+        queryWrapper.eq("student_no", studentNo);
70 72
         queryWrapper.eq("status", Constants.STATUS_NORMAL);
71 73
         queryWrapper.orderByDesc("create_date");
72 74
 
@@ -103,6 +105,10 @@ public class TaTestLogController extends BaseController {
103 105
     @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
104 106
     public ResponseBean taTestLogAdd(@ApiParam("保存内容") @RequestBody TaTestLog taTestLog) throws Exception{
105 107
 
108
+        if (StringUtils.isEmpty(taTestLog.getSchoolId())) {
109
+            return ResponseBean.error("没有找到学校信息", ResponseBean.ERROR_UNAVAILABLE);
110
+        }
111
+
106 112
         if (iTaTestLogService.save(taTestLog)){
107 113
             return ResponseBean.success(taTestLog);
108 114
         }else {
@@ -171,6 +177,10 @@ public class TaTestLogController extends BaseController {
171 177
     public ResponseBean taTestLogUpdate(@ApiParam("对象ID") @PathVariable Integer id,
172 178
                                         @ApiParam("更新内容") @RequestBody TaTestLog taTestLog) throws Exception{
173 179
 
180
+        if (StringUtils.isEmpty(taTestLog.getSchoolId())) {
181
+            return ResponseBean.error("没有找到学校信息", ResponseBean.ERROR_UNAVAILABLE);
182
+        }
183
+
174 184
         if (iTaTestLogService.updateById(taTestLog)){
175 185
             return ResponseBean.success(iTaTestLogService.getById(id));
176 186
         }else {

+ 3
- 3
src/main/java/com/yunzhi/demo/controller/TdSpecialtyController.java Visa fil

@@ -41,7 +41,7 @@ public class TdSpecialtyController extends BaseController {
41 41
     public ResponseBean maSchoolList(@ApiParam(value = "学校ID", required = false) @RequestParam(value ="school", required = false) String school,
42 42
                                      @ApiParam(value = "名称", required = false) @RequestParam(value ="name", required = false) String name) throws Exception {
43 43
         QueryWrapper<TdSpecialty> queryWrapper = new QueryWrapper<TdSpecialty>()
44
-                .eq(!StringUtils.isEmpty(school),"schoolId", school)
44
+                .eq(!StringUtils.isEmpty(school),"school_id", school)
45 45
                 .like(!StringUtils.isEmpty(name), "name", "%"+name+"%")
46 46
                 .eq("status", Constants.STATUS_NORMAL)
47 47
                 .orderByAsc("sort_no")
@@ -77,12 +77,12 @@ public class TdSpecialtyController extends BaseController {
77 77
     @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
78 78
     public ResponseBean adminSpecialtyList(@ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
79 79
                                            @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
80
-                                           @ApiParam(value = "学校ID", required = false) @RequestParam(value ="schoolId", required = false) String schoolId,
80
+                                           @ApiParam(value = "学校ID", required = false) @RequestParam(value ="school", required = false) String school,
81 81
                                            @ApiParam(value = "名称", required = false) @RequestParam(value ="name", required = false) String name) throws Exception {
82 82
 
83 83
         IPage<TdSpecialty> pg = new Page<>(pageNum, pageSize);
84 84
         QueryWrapper<TdSpecialty> queryWrapper = new QueryWrapper<TdSpecialty>()
85
-                .eq(!StringUtils.isEmpty(schoolId),"school_id", schoolId)
85
+                .eq(!StringUtils.isEmpty(school),"school_id", school)
86 86
                 .like(!StringUtils.isEmpty(name), "name", "%"+name+"%")
87 87
                 .eq("status", Constants.STATUS_NORMAL)
88 88
                 .orderByAsc("sort_no")

+ 17
- 5
src/main/resources/mapper/TaTestLogMapper.xml Visa fil

@@ -4,7 +4,19 @@
4 4
 
5 5
     <select id="getTestLogWithStudent" resultType="com.yunzhi.demo.vo.StudentTestLog">
6 6
         SELECT
7
-            b.*,
7
+            b.student_id,
8
+            b.name,
9
+            b.sex,
10
+            b.phone,
11
+            b.e_mail,
12
+            a.school_id,
13
+            b.school_batch,
14
+            b.specialty_id,
15
+            a.student_no,
16
+            b.person_id,
17
+            b.status,
18
+            b.create_date,
19
+            b.update_date,
8 20
             a.`name` as test_name,
9 21
             a.serial_no,
10 22
             a.attchment,
@@ -12,16 +24,16 @@
12 24
             d.`name` as specialty_name
13 25
         FROM
14 26
             ta_test_log a
15
-            LEFT JOIN ta_student b on a.student_id = b.student_id
16
-            LEFT JOIN td_school c on b.school_id = c.school_id
27
+            LEFT JOIN ta_student b on a.student_no = b.student_no
28
+            LEFT JOIN td_school c on a.school_id = c.school_id
17 29
             LEFT JOIN td_specialty d on b.specialty_id = d.specialty_id
18 30
         WHERE
19 31
             a.`status` > - 1
20 32
         <if test="studentNo != null and studentNo != ''">
21
-            AND b.student_no LIKE CONCAT( '%', #{studentNo}, '%' )
33
+            AND a.student_no LIKE CONCAT( '%', #{studentNo}, '%' )
22 34
         </if>
23 35
         <if test="schoolId != null and schoolId != ''">
24
-            AND b.school_id = #{schoolId}
36
+            AND a.school_id = #{schoolId}
25 37
         </if>
26 38
         <if test="specialtyId != null and specialtyId != ''">
27 39
             AND b.specialty_id = #{specialtyId}