Commit d520fd4a2abe6d13cf1c4807a39fc5d7761ded25
1 parent
ee986d191d
Exists in
master
提交代码
Showing 2 changed files with 36 additions and 3 deletions
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/KidsController.java
View file @
d520fd4
... | ... | @@ -273,13 +273,16 @@ |
273 | 273 | * @param id 宝宝id |
274 | 274 | */ |
275 | 275 | @RequestMapping(value = "/babys", method = RequestMethod.GET) |
276 | - @TokenRequired | |
276 | + //@TokenRequired | |
277 | 277 | public void getKids(HttpServletResponse response, |
278 | 278 | @RequestParam("id") String id) { |
279 | 279 | if (StringUtils.isBlank(id)) { |
280 | 280 | ResultUtils.buildIdIsNull(response); |
281 | 281 | return; |
282 | 282 | } |
283 | + | |
284 | + List<KidInoculationRecords> recordsList = medKidsService.queryInoculationRecord(id); | |
285 | + | |
283 | 286 | //取出建档最早的那个 |
284 | 287 | MedKidsQuery query = new MedKidsQuery(); |
285 | 288 | query.setIsDelete(isDelete); |
286 | 289 | |
... | ... | @@ -313,12 +316,17 @@ |
313 | 316 | map.put("vaccineId", medInoculateorder.getIoVaccineId()); |
314 | 317 | MedVaccineName medVaccineName = medVaccineNameService.getMedVaccineName(medInoculateorder.getIoVaccineId()); |
315 | 318 | map.put("vaccineName", medVaccineName == null ? "" : medVaccineName.getVnName()); |
319 | + //剂次 | |
320 | + int sum = medVaccineName.getVnMonthAge().split(",").length; | |
321 | + | |
322 | + | |
323 | + | |
316 | 324 | //接种地点 |
317 | 325 | map.put("organizationId", medInoculateorder.getIoOrganizationId()); |
318 | 326 | MedOrganization medOrganization = medOrganizationService.getMedOrganization(medInoculateorder.getIoOrganizationId()); |
319 | 327 | map.put("organizationName", medOrganization == null ? "" : medOrganization.getoName()); |
320 | 328 | } else { |
321 | - map.put("ioInoculateTime", null); | |
329 | + map.put("ioInoculateDate", null); | |
322 | 330 | map.put("vaccineId", null); |
323 | 331 | map.put("vaccineName", null); |
324 | 332 | map.put("organizationId", null); |
... | ... | @@ -331,6 +339,17 @@ |
331 | 339 | map.put("errormsg", "成功"); |
332 | 340 | writeJson(response, JsonUtil.obj2JsonString(map)); |
333 | 341 | } |
342 | + | |
343 | + public static void main(String[] str) { | |
344 | + long a = DateUtil.getSecond(new Date()) - DateUtil.getSecond(DateUtil.parseYMD("2016-1-1")); | |
345 | + | |
346 | + System.out.println(DateUtil.getSecond(new Date())); | |
347 | + System.out.println(DateUtil.parseYMD("2016-1-1")); | |
348 | + | |
349 | + System.out.print(a); | |
350 | + } | |
351 | + | |
352 | + | |
334 | 353 | |
335 | 354 | /** |
336 | 355 | * 根据月龄获取宝宝该月龄预约接种的疫苗(分为免费疫苗和收费疫苗两个模块) |
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/UserController.java
View file @
d520fd4
... | ... | @@ -131,7 +131,7 @@ |
131 | 131 | map.put("errormsg", "成功"); |
132 | 132 | writeJson(response,JsonUtil.obj2JsonString(map)); |
133 | 133 | }else { |
134 | - ResultUtils.buildParameterErrorResultAndWrite(response,"該手機不存在,請註冊"); | |
134 | + ResultUtils.buildParameterErrorResultAndWrite(response,"该手机号不存在,请注册"); | |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
... | ... | @@ -187,6 +187,8 @@ |
187 | 187 | //如果没有头像,返回默认头像 |
188 | 188 | map.put("avatar", QiniuUtil.buildImg(users.getAvatar()!=null ? users.getAvatar() : ImageUtil.DEFAULTUSERAVATAR)); |
189 | 189 | |
190 | + map.put("phone", users.getPhone()); | |
191 | + | |
190 | 192 | list.add(map); |
191 | 193 | |
192 | 194 | ResultUtils.buildSuccessResultAndWrite(response,list); |
... | ... | @@ -206,6 +208,18 @@ |
206 | 208 | |
207 | 209 | //取到当前登陆用户的id |
208 | 210 | YmUsers users = usersService.getYmUsers(loginContext.getId()); |
211 | + | |
212 | + YmUsersQuery query = new YmUsersQuery(); | |
213 | + query.setYn(YnEnum.yes.getId()); | |
214 | + List<YmUsers> ymUsersList = usersService.queryYmUsers(query); | |
215 | + if (CollectionUtils.isNotEmpty(ymUsersList)){ | |
216 | + for (YmUsers data : ymUsersList){ | |
217 | + if (phone.equals(data.getPhone())){ | |
218 | + ResultUtils.buildParameterErrorResultAndWrite(response,"当前手机已绑定,请重新输入"); | |
219 | + } | |
220 | + } | |
221 | + } | |
222 | + | |
209 | 223 | if (PhoneUtil.isMobileNO(phone)){ |
210 | 224 | users.setPhone(phone); |
211 | 225 | users.setModified(new Date()); |