zlisen 4 years ago
parent
commit
b9f98658aa

+ 18
- 0
src/main/java/com/yunzhi/demo/controller/TaMedicalLogController.java View File

@@ -107,6 +107,22 @@ public class TaMedicalLogController extends BaseController {
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 127
      * 根据id删除对象
112 128
      * @param id  实体ID
@@ -149,4 +165,6 @@ public class TaMedicalLogController extends BaseController {
149 165
                                         @ApiParam("就诊ID") @PathVariable Integer id) throws Exception{
150 166
         return ResponseBean.success(iTaMedicalLogService.getById(id));
151 167
     }
168
+
169
+
152 170
 }

+ 17
- 0
src/main/java/com/yunzhi/demo/controller/TaPersonController.java View File

@@ -151,6 +151,23 @@ public class TaPersonController extends BaseController {
151 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 171
     @GetMapping("/ma/currentPerson")
155 172
     @ApiOperation(value="小程序当前人员", notes = "获取当前人员信息", httpMethod = "GET", response = TaPerson.class)
156 173
     public ResponseBean getCurrent() throws Exception {

+ 2
- 0
src/main/java/com/yunzhi/demo/service/ITaPersonService.java View File

@@ -15,5 +15,7 @@ public interface ITaPersonService extends IService<TaPerson> {
15 15
 
16 16
     TaPerson getByOpenid(String openid);
17 17
 
18
+    TaPerson getByStudentId(String studentId);
19
+
18 20
     int countStudent();
19 21
 }

+ 8
- 0
src/main/java/com/yunzhi/demo/service/impl/TaPersonServiceImpl.java View File

@@ -34,4 +34,12 @@ public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> i
34 34
                 .gt("status", Constants.STATUS_DELETED);
35 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
 }