张延森 4 years ago
parent
commit
b3bf14f203

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

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 View File

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 View File

17
 
17
 
18
     TaPerson getByOpenid(String openid);
18
     TaPerson getByOpenid(String openid);
19
 
19
 
20
+    TaPerson getByStudentId(String studentId);
21
+
20
     int countStudent();
22
     int countStudent();
21
 
23
 
22
     IPage<StatisPerson> getStudentStatis(IPage<StatisPerson> pg, String name, String schoolId, String specialtyId, String asc, String desc);
24
     IPage<StatisPerson> getStudentStatis(IPage<StatisPerson> pg, String name, String schoolId, String specialtyId, String asc, String desc);

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

66
                 return "saved_num";
66
                 return "saved_num";
67
         }
67
         }
68
     }
68
     }
69
+
70
+    public TaPerson getByStudentId(String studentId) {
71
+        QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<TaPerson>()
72
+                .eq("student_id", studentId)
73
+                .gt("status", Constants.STATUS_DELETED);
74
+        return getOne(queryWrapper);
75
+    }
69
 }
76
 }