zlisen 4 年之前
父節點
當前提交
b9f98658aa

+ 18
- 0
src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java 查看文件

107
         }
107
         }
108
     }
108
     }
109
 
109
 
110
+    /**
111
+     * 保存对象
112
+     * @param taMedicalLog 实体对象
113
+     * @return
114
+     */
115
+    @RequestMapping(value="/admin/medicalLog",method= RequestMethod.POST)
116
+    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
117
+    public ResponseBean medicalLogAdd(@ApiParam("保存内容") @RequestBody TaMedicalLog taMedicalLog) throws Exception{
118
+
119
+        if (iTaMedicalLogService.save(taMedicalLog)){
120
+            return ResponseBean.success(taMedicalLog);
121
+        }else {
122
+            return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
123
+        }
124
+    }
125
+
110
     /**
126
     /**
111
      * 根据id删除对象
127
      * 根据id删除对象
112
      * @param id  实体ID
128
      * @param id  实体ID
149
                                         @ApiParam("就诊ID") @PathVariable Integer id) throws Exception{
165
                                         @ApiParam("就诊ID") @PathVariable Integer id) throws Exception{
150
         return ResponseBean.success(iTaMedicalLogService.getById(id));
166
         return ResponseBean.success(iTaMedicalLogService.getById(id));
151
     }
167
     }
168
+
169
+
152
 }
170
 }

+ 17
- 0
src/main/java/com/yunzhi/demo/controller/TaPersonController.java 查看文件

151
         return ResponseBean.success(taPerson);
151
         return ResponseBean.success(taPerson);
152
     }
152
     }
153
 
153
 
154
+    /**
155
+     * 根据id查询对象
156
+     * @param id  学号
157
+     */
158
+    @RequestMapping(value="/admin/student/{id}",method= RequestMethod.GET)
159
+    @ApiOperation(value="学生详情", notes = "查询人员详细信息", httpMethod = "GET", response = TaPerson.class)
160
+    public ResponseBean studentGet(@ApiParam("学生学号") @PathVariable String id) throws Exception{
161
+        TaPerson taPerson = iTaPersonService.getByStudentId(id);
162
+        if (null == taPerson || Constants.STATUS_DELETED.equals(taPerson.getStatus())) {
163
+            throw new Exception("验证人员信息失败, 请退出重试");
164
+        }
165
+
166
+        fillInfo(taPerson);
167
+
168
+        return ResponseBean.success(taPerson);
169
+    }
170
+
154
     @GetMapping("/ma/currentPerson")
171
     @GetMapping("/ma/currentPerson")
155
     @ApiOperation(value="小程序当前人员", notes = "获取当前人员信息", httpMethod = "GET", response = TaPerson.class)
172
     @ApiOperation(value="小程序当前人员", notes = "获取当前人员信息", httpMethod = "GET", response = TaPerson.class)
156
     public ResponseBean getCurrent() throws Exception {
173
     public ResponseBean getCurrent() throws Exception {

+ 2
- 0
src/main/java/com/yunzhi/demo/service/ITaPersonService.java 查看文件

15
 
15
 
16
     TaPerson getByOpenid(String openid);
16
     TaPerson getByOpenid(String openid);
17
 
17
 
18
+    TaPerson getByStudentId(String studentId);
19
+
18
     int countStudent();
20
     int countStudent();
19
 }
21
 }

+ 8
- 0
src/main/java/com/yunzhi/demo/service/impl/TaPersonServiceImpl.java 查看文件

34
                 .gt("status", Constants.STATUS_DELETED);
34
                 .gt("status", Constants.STATUS_DELETED);
35
         return count(queryWrapper);
35
         return count(queryWrapper);
36
     }
36
     }
37
+
38
+    @Override
39
+    public TaPerson getByStudentId(String studentId) {
40
+        QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<TaPerson>()
41
+                .eq("student_id", studentId)
42
+                .gt("status", Constants.STATUS_DELETED);
43
+        return getOne(queryWrapper);
44
+    }
37
 }
45
 }