Commit 036dcd99eebdfd53df39a681651be2b7ca318ac5

Authored by landong2015
1 parent 1b0fd0a558
Exists in master

提交代码

Showing 2 changed files with 55 additions and 59 deletions

webApi/src/main/java/com/lyms/yimiao/web/controller/v1/FeedbackController.java View file @ 036dcd9
... ... @@ -45,7 +45,7 @@
45 45 *
46 46 * @return
47 47 */
48   - @RequestMapping(value = "/feedBacks", method = RequestMethod.POST)
  48 + @RequestMapping(value = "/feedbacks", method = RequestMethod.POST)
49 49 @TokenRequired
50 50 public void submitFeedBack(@RequestParam("content") String content,
51 51 HttpServletRequest request,
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/KidsController.java View file @ 036dcd9
... ... @@ -161,9 +161,9 @@
161 161  
162 162 for (MedKids medKids : medKidsList) {
163 163 Map<String, String> map = new HashMap<>();
164   - if (StringUtils.isNotEmpty(medKids.getName())){
165   - map.put("id",medKids.getId());
166   - map.put("name",medKids.getName());
  164 + if (StringUtils.isNotEmpty(medKids.getName())) {
  165 + map.put("id", medKids.getId());
  166 + map.put("name", medKids.getName());
167 167 }
168 168 list.add(map);
169 169 }
170 170  
... ... @@ -271,7 +271,9 @@
271 271  
272 272 map.put("id", kids.getId());
273 273 map.put("name", kids.getName());
  274 + map.put("sex",kids.getSex());
274 275 map.put("birthday", DateUtil.getSecond(DateUtil.parseYMD(kids.getBirthday())));
  276 + map.put("avatar", null);//先给默认头像
275 277  
276 278 MedInoculateOrderQuery inoculateorderQuery = new MedInoculateOrderQuery();
277 279 inoculateorderQuery.setIoKidId(kids.getId());
... ... @@ -311,9 +313,9 @@
311 313 * @param kidId 宝宝ID
312 314 */
313 315 @RequestMapping(value = "/inoculatePlan", method = RequestMethod.GET)
314   - //@TokenRequired
315   - public void getKidVaccines(HttpServletResponse response,
316   - @RequestParam("id") String kidId) {
  316 + @TokenRequired
  317 + public void getKidInoculatePlan(HttpServletResponse response,
  318 + @RequestParam("id") String kidId) {
317 319 List<MedVaccineName> nameList = vaccineNameSington.getListVaccineName();
318 320  
319 321 List<KidInoculationRecords> recordsList = medKidsService.queryInoculationRecord(kidId);
... ... @@ -322,7 +324,7 @@
322 324  
323 325 int monthYear = 0;
324 326  
325   - for (MouthAgeEnum ageEnum : MouthAgeEnum.values()){
  327 + for (MouthAgeEnum ageEnum : MouthAgeEnum.values()) {
326 328  
327 329 Map<String, Object> map = new HashMap<>();
328 330  
329 331  
330 332  
331 333  
332 334  
333 335  
... ... @@ -331,41 +333,41 @@
331 333 List<Map> freeList = new ArrayList<>();
332 334 List<Map> chargeList = new ArrayList<>();
333 335  
334   - for (MedVaccineName data : nameList){
335   - if (ageEnum.getId()==data.getMouthAge()){
336   - if (data.getVnVaccineType()==1){
337   - Map<String,Object> freeMap = new HashMap<>();
338   - freeMap.put("id",data.getVnId());
339   - freeMap.put("name",data.getVnName());
340   - String[]a = data.getVnMonthAge().split(",");
341   - int sum = a.length;
342   - int current = 0 ;
343   - for (int i = 0;i<a.length;i++){
344   - if (data.getMouthAge()==Integer.valueOf(a[i])){
345   - current = i + 1;
  336 + for (MedVaccineName data : nameList) {
  337 + if (ageEnum.getId() == data.getMouthAge()) {
  338 + if (data.getVnVaccineType() == 1) {
  339 + Map<String, Object> freeMap = new HashMap<>();
  340 + freeMap.put("id", data.getVnId());
  341 + freeMap.put("title", data.getVnName());
  342 + String[] a = data.getVnMonthAge().split(",");
  343 + int sum = a.length;
  344 + int current = 0;
  345 + for (int i = 0; i < a.length; i++) {
  346 + if (data.getMouthAge() == Integer.valueOf(a[i])) {
  347 + current = i + 1;
  348 + }
346 349 }
347   - }
348   - freeMap.put("current",current);
349   - freeMap.put("sum",sum);
350   - //接种ID
351   - if (CollectionUtils.isNotEmpty(recordsList)){
352   - for (KidInoculationRecords temp : recordsList){
353   - if (temp.getJiCi()==current && temp.getVaccineNameTitle().equals(data.getVnName())
354   - && temp.getVaccineType().equals("1")){
  350 + freeMap.put("current", current);
  351 + freeMap.put("sum", sum);
  352 + //接种ID
  353 + if (CollectionUtils.isNotEmpty(recordsList)) {
  354 + for (KidInoculationRecords temp : recordsList) {
  355 + if (temp.getJiCi() == current && temp.getVaccineNameTitle().equals(data.getVnName())
  356 + && temp.getVaccineType().equals("1")) {
355 357 freeMap.put("inoculateId", temp.getRecordId());
356 358 break;
357   - }else {
358   - freeMap.put("inoculateId",null);
  359 + } else {
  360 + freeMap.put("inoculateId", null);
359 361 }
360 362 }
361   - }else {
362   - freeMap.put("inoculateId",null);
  363 + } else {
  364 + freeMap.put("inoculateId", null);
363 365 }
364   - freeList.add(freeMap);
365   - }else if (data.getVnVaccineType()==2) {
  366 + freeList.add(freeMap);
  367 + } else if (data.getVnVaccineType() == 2) {
366 368 Map<String, Object> chargeMap = new HashMap<>();
367 369 chargeMap.put("id", data.getVnId());
368   - chargeMap.put("name", data.getVnName());
  370 + chargeMap.put("title", data.getVnName());
369 371 String[] a = data.getVnMonthAge().split(",");
370 372 int sum = a.length;
371 373 int current = 0;
372 374  
373 375  
374 376  
375 377  
376 378  
377 379  
378 380  
379 381  
... ... @@ -377,61 +379,55 @@
377 379 chargeMap.put("current", current);
378 380 chargeMap.put("sum", sum);
379 381 //接种ID
380   - if (CollectionUtils.isNotEmpty(recordsList)){
381   - for (KidInoculationRecords temp : recordsList){
382   - if (temp.getJiCi()==current && temp.getVaccineNameTitle().equals(data.getVnName())
383   - && temp.getCnt() == sum&& temp.getVaccineType().equals("2")){
  382 + if (CollectionUtils.isNotEmpty(recordsList)) {
  383 + for (KidInoculationRecords temp : recordsList) {
  384 + if (temp.getJiCi() == current && temp.getVaccineNameTitle().equals(data.getVnName())
  385 + && temp.getCnt() == sum && temp.getVaccineType().equals("2")) {
384 386 chargeMap.put("inoculateId", temp.getRecordId());
385 387 break;
386   - }else {
387   - chargeMap.put("inoculateId",null);
  388 + } else {
  389 + chargeMap.put("inoculateId", null);
388 390 }
389 391 }
390   - }else {
391   - chargeMap.put("inoculateId",null);
  392 + } else {
  393 + chargeMap.put("inoculateId", null);
392 394 }
393 395 chargeList.add(chargeMap);
394 396 }
395 397 }
396 398 }
397   - monthYear = monthYear + 1 ;
398   - mouthMap.put("freeList",freeList);
399   - mouthMap.put("chargeList",chargeList);
  399 + monthYear = monthYear + 1;
  400 + mouthMap.put("freeList", freeList);
  401 + mouthMap.put("chargeList", chargeList);
400 402 mouthList.add(mouthMap);
401 403 map.put(monthYear + "monthsOfAge", mouthList);
402 404 list.add(map);
403 405 }
404 406  
405   - ResultUtils.buildSuccessResultAndWrite(response,list);
  407 + ResultUtils.buildSuccessResultAndWrite(response, list);
406 408 }
407 409  
408 410 /**
409 411 * 获取接种记录
410 412 *
411 413 * @param response
412   - * @param kidId 宝宝ID
413   - * @param vaccineInfoId 疫苗基本信息ID
414 414 */
415 415 @RequestMapping(value = "/inoculateRecord", method = RequestMethod.GET)
416 416 @TokenRequired
417 417 public void getKidVaccines(HttpServletResponse response,
418   - @RequestParam("kidId") String kidId,
419   - @RequestParam("jiCi") String jiCi,
420   - @RequestParam("vaccineInfoId") String vaccineInfoId) {
  418 + @RequestParam("id") String icId) {
421 419  
422 420 List<Map> list = new ArrayList<>();
423 421  
424 422 MedInoculateRecordQuery recordQuery = new MedInoculateRecordQuery();
425   - recordQuery.setIcKidId(kidId);
426   - recordQuery.setIcVaccineId(vaccineInfoId);
427   - recordQuery.setIcJiCi(jiCi);
  423 + recordQuery.setIcId(icId);
428 424 recordQuery.setIsDelete(isDelete);
429 425 List<MedInoculateRecord> recordList = medInoculateRecordService.queryMedInoculateRecord(recordQuery);
430 426 if (CollectionUtils.isNotEmpty(recordList)) {
431 427 MedInoculateRecord data = recordList.get(0);
432 428 Map<String, Object> map = new HashMap<>();
433 429 //疫苗名称
434   - MedVaccineInfo info = medVaccineinfoService.getMedVaccineInfo(vaccineInfoId);
  430 + MedVaccineInfo info = medVaccineinfoService.getMedVaccineInfo(data.getIcVaccineId());
435 431 if (info != null && isDelete.equals(info.getIsDelete())) {
436 432 map.put("vaccineInfoName", info.getViName());
437 433 //生产企业
438 434  
439 435  
... ... @@ -447,16 +443,16 @@
447 443 //接种日期
448 444 map.put("inoculateTime", DateUtil.getSecond(DateUtil.parseYMD(data.getIcInoculateTime())));
449 445 //接种医生
450   - map.put("doctor", data.getIcDoctor());
  446 + map.put("doctorName", data.getIcDoctor());
451 447 //接种部位
452 448 map.put("position", data.getIcPosition());
453 449  
454 450 //接种单位
455 451 MedOrganization medOrganization = medOrganizationService.getMedOrganization(data.getIcOrganizationId());
456 452 if (medOrganization != null && isDelete.equals(medOrganization.getIsDelete())) {
457   - map.put("organization", medOrganization.getoName());
  453 + map.put("organizationName", medOrganization.getoName());
458 454 } else {
459   - map.put("organization", null);
  455 + map.put("organizationName", null);
460 456 }
461 457 //疫苗批号
462 458 map.put("batchNumber", data.getIcBatchNumber());