Commit 21e6c7fd24fbd45e33e722582ae2d5ccc891a8a6
1 parent
0f28138ac4
Exists in
master
提交代码
Showing 13 changed files with 835 additions and 64 deletions
- mainData/src/main/java/com/lymsh/yimiao/main/data/enumdata/PositionEnum.java
- mainData/src/main/java/com/lymsh/yimiao/main/data/model/MedVaccineName.java
- webApi/src/main/java/com/lyms/yimiao/web/controller/v1/InoculateRecordController.java
- webApi/src/main/java/com/lyms/yimiao/web/controller/v1/KidsController.java
- webApi/src/main/java/com/lyms/yimiao/web/controller/v1/OrganizationsController.java
- webApi/src/main/java/com/lyms/yimiao/web/controller/v1/VaccineNamesController.java
- webApi/src/main/resources/macro.vm
- webApi/src/main/resources/spring/applicationContext-mvc.xml
- webApi/src/main/resources/velocity.properties
- webApi/src/main/webapp/WEB-INF/VelocityUtils.xml
- webApi/src/main/webapp/WEB-INF/html/inoculateRecord.vm
- webApi/src/main/webapp/WEB-INF/html/vaccineNameList.vm
- webApi/src/main/webapp/image/small_arrow_down.png
mainData/src/main/java/com/lymsh/yimiao/main/data/enumdata/PositionEnum.java
View file @
21e6c7f
1 | +package com.lymsh.yimiao.main.data.enumdata; | |
2 | + | |
3 | +/** | |
4 | + * Created by riecard on 15/9/28. | |
5 | + */ | |
6 | +public enum PositionEnum { | |
7 | + | |
8 | + | |
9 | + | |
10 | + zero("0","口服"), | |
11 | + one("1","左上臂"), | |
12 | + two("2","右上臂"), | |
13 | + three("3","左臀"), | |
14 | + four("4","右臀"), | |
15 | + five("5","其他部位"); | |
16 | + | |
17 | + private PositionEnum(String id, String title) { | |
18 | + this.id = id; | |
19 | + this.title = title; | |
20 | + } | |
21 | + | |
22 | + public static String getTitle(String id) { | |
23 | + for (PositionEnum e: PositionEnum.values()) { | |
24 | + if (e.getId().equals(id)) { | |
25 | + return e.getTitle(); | |
26 | + } | |
27 | + } | |
28 | + return ""; | |
29 | + } | |
30 | + | |
31 | + private String id; | |
32 | + private String title; | |
33 | + | |
34 | + public String getId() { | |
35 | + return id; | |
36 | + } | |
37 | + | |
38 | + public void setId(String id) { | |
39 | + this.id = id; | |
40 | + } | |
41 | + | |
42 | + public String getTitle() { | |
43 | + return title; | |
44 | + } | |
45 | + | |
46 | + public void setTitle(String title) { | |
47 | + this.title = title; | |
48 | + } | |
49 | +} |
mainData/src/main/java/com/lymsh/yimiao/main/data/model/MedVaccineName.java
View file @
21e6c7f
... | ... | @@ -8,10 +8,41 @@ |
8 | 8 | private String vnPreventDisease; |
9 | 9 | private String vnMonthAge; |
10 | 10 | private String vnPosition; |
11 | + | |
12 | + public String getVnPositionName() { | |
13 | + return vnPositionName; | |
14 | + } | |
15 | + | |
16 | + public void setVnPositionName(String vnPositionName) { | |
17 | + this.vnPositionName = vnPositionName; | |
18 | + } | |
19 | + | |
20 | + private String vnPositionName; | |
11 | 21 | private String vnTaboo; |
12 | 22 | private String vnDescription; |
13 | 23 | private String vnIsValid; |
14 | 24 | private Integer vnVaccineType; |
25 | + | |
26 | + public String getTypeName() { | |
27 | + return typeName; | |
28 | + } | |
29 | + | |
30 | + public void setTypeName(String typeName) { | |
31 | + this.typeName = typeName; | |
32 | + } | |
33 | + | |
34 | + private String typeName; | |
35 | + | |
36 | + | |
37 | + public String getVnVaccineTypeName() { | |
38 | + return vnVaccineTypeName; | |
39 | + } | |
40 | + | |
41 | + public void setVnVaccineTypeName(String vnVaccineTypeName) { | |
42 | + this.vnVaccineTypeName = vnVaccineTypeName; | |
43 | + } | |
44 | + | |
45 | + private String vnVaccineTypeName; | |
15 | 46 | private String isDelete; |
16 | 47 | private Integer mouthAge; |
17 | 48 |
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/InoculateRecordController.java
View file @
21e6c7f
1 | +package com.lyms.yimiao.web.controller.v1; | |
2 | + | |
3 | +import com.lymsh.mommybaby.basecommon.base.TokenRequired; | |
4 | +import com.lymsh.mommybaby.basecommon.util.DateUtil; | |
5 | +import com.lymsh.mommybaby.basecommon.util.ResultUtils; | |
6 | +import com.lymsh.yimiao.main.data.model.*; | |
7 | +import com.lymsh.yimiao.main.data.service.MedFactoryService; | |
8 | +import com.lymsh.yimiao.main.data.service.MedInoculateRecordService; | |
9 | +import com.lymsh.yimiao.main.data.service.MedOrganizationService; | |
10 | +import com.lymsh.yimiao.main.data.service.MedVaccineInfoService; | |
11 | +import org.apache.commons.collections.CollectionUtils; | |
12 | +import org.springframework.beans.factory.annotation.Autowired; | |
13 | +import org.springframework.stereotype.Controller; | |
14 | +import org.springframework.web.bind.annotation.RequestMapping; | |
15 | +import org.springframework.web.bind.annotation.RequestMethod; | |
16 | +import org.springframework.web.bind.annotation.RequestParam; | |
17 | +import org.springframework.web.servlet.ModelAndView; | |
18 | + | |
19 | +import javax.servlet.http.HttpServletResponse; | |
20 | +import java.util.ArrayList; | |
21 | +import java.util.HashMap; | |
22 | +import java.util.List; | |
23 | +import java.util.Map; | |
24 | + | |
25 | +/** | |
26 | + * Created by Administrator on 2016/5/13 0013. | |
27 | + */ | |
28 | +@Controller | |
29 | +@RequestMapping("/v1") | |
30 | +public class InoculateRecordController { | |
31 | + @Autowired | |
32 | + private MedInoculateRecordService medInoculateRecordService; | |
33 | + @Autowired | |
34 | + private MedFactoryService medFactoryService; | |
35 | + @Autowired | |
36 | + private MedVaccineInfoService medVaccineinfoService; | |
37 | + @Autowired | |
38 | + private MedOrganizationService medOrganizationService; | |
39 | + | |
40 | + | |
41 | + private final static String isDelete = "1"; | |
42 | + | |
43 | + /** | |
44 | + * 获取接种记录 | |
45 | + * | |
46 | + * @param response | |
47 | + */ | |
48 | + @RequestMapping(value = "/inoculateRecord", method = RequestMethod.GET) | |
49 | + @TokenRequired | |
50 | + public ModelAndView getKidVaccines(HttpServletResponse response, | |
51 | + @RequestParam("id") String icId) { | |
52 | + ModelAndView mv = new ModelAndView("error"); | |
53 | + | |
54 | + if (icId == null) { | |
55 | + mv.addObject("msg", "inoculateRecord id is null"); | |
56 | + } | |
57 | + | |
58 | + | |
59 | + MedInoculateRecordQuery recordQuery = new MedInoculateRecordQuery(); | |
60 | + recordQuery.setIcId(icId); | |
61 | + recordQuery.setIsDelete(isDelete); | |
62 | + List<MedInoculateRecord> recordList = medInoculateRecordService.queryMedInoculateRecord(recordQuery); | |
63 | + if (recordList.size()==0){ | |
64 | + mv.setViewName("empty"); | |
65 | + mv.addObject("msg", "无疫苗详情信息"); | |
66 | + } | |
67 | + | |
68 | + mv.setViewName("recordList"); | |
69 | + mv.addObject("recordList", recordList); | |
70 | + | |
71 | + return mv; | |
72 | + | |
73 | +// if (CollectionUtils.isNotEmpty(recordList)) { | |
74 | +// MedInoculateRecord data = recordList.get(0); | |
75 | +// Map<String, Object> map = new HashMap<>(); | |
76 | +// //疫苗名称 | |
77 | +// MedVaccineInfo info = medVaccineinfoService.getMedVaccineInfo(data.getIcVaccineId()); | |
78 | +// if (info != null && isDelete.equals(info.getIsDelete())) { | |
79 | +// map.put("vaccineInfoName", info.getViName()); | |
80 | +// //生产企业 | |
81 | +// MedFactory medFactory = medFactoryService.getMedFactory(info.getViFactoryId()); | |
82 | +// if (medFactory != null && isDelete.equals(medFactory.getIsDelete())) { | |
83 | +// map.put("factoryName", medFactory.getFName()); | |
84 | +// } | |
85 | +// } else { | |
86 | +// map.put("vaccineInfoName", null); | |
87 | +// map.put("factoryName", null); | |
88 | +// | |
89 | +// } | |
90 | +// //接种日期 | |
91 | +// map.put("inoculateTime", DateUtil.getSecond(DateUtil.parseYMD(data.getIcInoculateTime()))); | |
92 | +// //接种医生 | |
93 | +// map.put("doctorName", data.getIcDoctor()); | |
94 | +// //接种部位 | |
95 | +// map.put("position", data.getIcPosition()); | |
96 | +// | |
97 | +// //接种单位 | |
98 | +// MedOrganization medOrganization = medOrganizationService.getMedOrganization(data.getIcOrganizationId()); | |
99 | +// if (medOrganization != null && isDelete.equals(medOrganization.getIsDelete())) { | |
100 | +// map.put("organizationName", medOrganization.getoName()); | |
101 | +// } else { | |
102 | +// map.put("organizationName", null); | |
103 | +// } | |
104 | +// //疫苗批号 | |
105 | +// map.put("batchNumber", data.getIcBatchNumber()); | |
106 | +// list.add(map); | |
107 | +// } | |
108 | +// ResultUtils.buildSuccessResultAndWrite(response, list); | |
109 | + } | |
110 | + | |
111 | +} |
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/KidsController.java
View file @
21e6c7f
... | ... | @@ -50,17 +50,13 @@ |
50 | 50 | private YmUserKidMapsService ymUserKidMapsService; |
51 | 51 | @Autowired |
52 | 52 | private MedInoculateOrderService medInoculateorderService; |
53 | + | |
53 | 54 | @Autowired |
54 | - private MedVaccineInfoService medVaccineinfoService; | |
55 | - @Autowired | |
56 | 55 | private MedOrganizationService medOrganizationService; |
57 | 56 | @Autowired |
58 | 57 | private MedVaccineNameService medVaccineNameService; |
59 | - @Autowired | |
60 | - private MedInoculateRecordService medInoculateRecordService; | |
61 | - @Autowired | |
62 | - private MedFactoryService medFactoryService; | |
63 | 58 | |
59 | + | |
64 | 60 | private final static String isDelete = "1"; |
65 | 61 | |
66 | 62 | @Autowired |
67 | 63 | |
... | ... | @@ -482,59 +478,7 @@ |
482 | 478 | ResultUtils.buildSuccessResultAndWrite(response, list); |
483 | 479 | } |
484 | 480 | |
485 | - /** | |
486 | - * 获取接种记录 | |
487 | - * | |
488 | - * @param response | |
489 | - */ | |
490 | - @RequestMapping(value = "/inoculateRecord", method = RequestMethod.GET) | |
491 | - @TokenRequired | |
492 | - public void getKidVaccines(HttpServletResponse response, | |
493 | - @RequestParam("id") String icId) { | |
494 | 481 | |
495 | - List<Map> list = new ArrayList<>(); | |
496 | - | |
497 | - MedInoculateRecordQuery recordQuery = new MedInoculateRecordQuery(); | |
498 | - recordQuery.setIcId(icId); | |
499 | - recordQuery.setIsDelete(isDelete); | |
500 | - List<MedInoculateRecord> recordList = medInoculateRecordService.queryMedInoculateRecord(recordQuery); | |
501 | - if (CollectionUtils.isNotEmpty(recordList)) { | |
502 | - MedInoculateRecord data = recordList.get(0); | |
503 | - Map<String, Object> map = new HashMap<>(); | |
504 | - //疫苗名称 | |
505 | - MedVaccineInfo info = medVaccineinfoService.getMedVaccineInfo(data.getIcVaccineId()); | |
506 | - if (info != null && isDelete.equals(info.getIsDelete())) { | |
507 | - map.put("vaccineInfoName", info.getViName()); | |
508 | - //生产企业 | |
509 | - MedFactory medFactory = medFactoryService.getMedFactory(info.getViFactoryId()); | |
510 | - if (medFactory != null && isDelete.equals(medFactory.getIsDelete())) { | |
511 | - map.put("factoryName", medFactory.getFName()); | |
512 | - } | |
513 | - } else { | |
514 | - map.put("vaccineInfoName", null); | |
515 | - map.put("factoryName", null); | |
516 | - | |
517 | - } | |
518 | - //接种日期 | |
519 | - map.put("inoculateTime", DateUtil.getSecond(DateUtil.parseYMD(data.getIcInoculateTime()))); | |
520 | - //接种医生 | |
521 | - map.put("doctorName", data.getIcDoctor()); | |
522 | - //接种部位 | |
523 | - map.put("position", data.getIcPosition()); | |
524 | - | |
525 | - //接种单位 | |
526 | - MedOrganization medOrganization = medOrganizationService.getMedOrganization(data.getIcOrganizationId()); | |
527 | - if (medOrganization != null && isDelete.equals(medOrganization.getIsDelete())) { | |
528 | - map.put("organizationName", medOrganization.getoName()); | |
529 | - } else { | |
530 | - map.put("organizationName", null); | |
531 | - } | |
532 | - //疫苗批号 | |
533 | - map.put("batchNumber", data.getIcBatchNumber()); | |
534 | - list.add(map); | |
535 | - } | |
536 | - ResultUtils.buildSuccessResultAndWrite(response, list); | |
537 | - } | |
538 | 482 | |
539 | 483 | |
540 | 484 | } |
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/OrganizationsController.java
View file @
21e6c7f
... | ... | @@ -46,37 +46,37 @@ |
46 | 46 | map.put("contactWay",medOrganization.getoContactWay()); |
47 | 47 | //省 |
48 | 48 | if (medOrganization.getoProvinceNo()!=null){ |
49 | - map.put("province",medAreaService.getMedArea(medOrganization.getoProvinceNo()) == null ? null : medAreaService.getMedArea(medOrganization.getoProvinceNo()).getAName()); | |
49 | + map.put("province",medAreaService.getMedArea(medOrganization.getoProvinceNo()) == null ? "" : medAreaService.getMedArea(medOrganization.getoProvinceNo()).getAName()); | |
50 | 50 | }else { |
51 | 51 | map.put("province",null); |
52 | 52 | } |
53 | 53 | //市 |
54 | 54 | if (medOrganization.getoCityNo()!=null){ |
55 | - map.put("city",medAreaService.getMedArea(medOrganization.getoCityNo()) == null ? null : medAreaService.getMedArea(medOrganization.getoCityNo()).getAName()); | |
55 | + map.put("city",medAreaService.getMedArea(medOrganization.getoCityNo()) == null ? "" : medAreaService.getMedArea(medOrganization.getoCityNo()).getAName()); | |
56 | 56 | }else { |
57 | 57 | map.put("city",null); |
58 | 58 | } |
59 | 59 | //县 |
60 | 60 | if (medOrganization.getoCountyNo()!=null){ |
61 | - map.put("county",medAreaService.getMedArea(medOrganization.getoCountyNo()) == null ? null : medAreaService.getMedArea(medOrganization.getoCountyNo()).getAName()); | |
61 | + map.put("county",medAreaService.getMedArea(medOrganization.getoCountyNo()) == null ? "" : medAreaService.getMedArea(medOrganization.getoCountyNo()).getAName()); | |
62 | 62 | }else { |
63 | 63 | map.put("county",null); |
64 | 64 | } |
65 | 65 | //乡镇 |
66 | 66 | if (medOrganization.getoTownshipNo()!=null){ |
67 | - map.put("township",medAreaService.getMedArea(medOrganization.getoTownshipNo()) == null ? null : medAreaService.getMedArea(medOrganization.getoTownshipNo()).getAName()); | |
67 | + map.put("township",medAreaService.getMedArea(medOrganization.getoTownshipNo()) == null ? "" : medAreaService.getMedArea(medOrganization.getoTownshipNo()).getAName()); | |
68 | 68 | }else { |
69 | 69 | map.put("township",null); |
70 | 70 | } |
71 | 71 | //村 |
72 | 72 | if (medOrganization.getoVillageNo()!=null){ |
73 | - map.put("village",medAreaService.getMedArea(medOrganization.getoVillageNo()) == null ? null : medAreaService.getMedArea(medOrganization.getoVillageNo()).getAName()); | |
73 | + map.put("village",medAreaService.getMedArea(medOrganization.getoVillageNo()) == null ? "" : medAreaService.getMedArea(medOrganization.getoVillageNo()).getAName()); | |
74 | 74 | }else { |
75 | 75 | map.put("village",null); |
76 | 76 | } |
77 | 77 | //街道 |
78 | 78 | if (medOrganization.getoAddress()!=null){ |
79 | - map.put("address",medAreaService.getMedArea(medOrganization.getoAddress()) == null ? null : medAreaService.getMedArea(medOrganization.getoAddress()).getAName()); | |
79 | + map.put("address",medAreaService.getMedArea(medOrganization.getoAddress()) == null ? "" : medAreaService.getMedArea(medOrganization.getoAddress()).getAName()); | |
80 | 80 | }else { |
81 | 81 | map.put("address",null); |
82 | 82 | } |
webApi/src/main/java/com/lyms/yimiao/web/controller/v1/VaccineNamesController.java
View file @
21e6c7f
... | ... | @@ -2,7 +2,9 @@ |
2 | 2 | |
3 | 3 | import com.lymsh.mommybaby.basecommon.base.BaseController; |
4 | 4 | import com.lymsh.mommybaby.basecommon.util.ResultUtils; |
5 | +import com.lymsh.yimiao.main.data.enumdata.PositionEnum; | |
5 | 6 | import com.lymsh.yimiao.main.data.model.MedVaccineName; |
7 | +import com.lymsh.yimiao.main.data.model.MedVaccineNameQuery; | |
6 | 8 | import com.lymsh.yimiao.main.data.service.MedVaccineNameService; |
7 | 9 | import com.lymsh.yimiao.main.data.util.JsonUtil; |
8 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
... | ... | @@ -10,6 +12,7 @@ |
10 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
11 | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
12 | 14 | import org.springframework.web.bind.annotation.RequestParam; |
15 | +import org.springframework.web.servlet.ModelAndView; | |
13 | 16 | |
14 | 17 | import javax.servlet.http.HttpServletResponse; |
15 | 18 | import java.util.ArrayList; |
... | ... | @@ -27,6 +30,13 @@ |
27 | 30 | @Autowired |
28 | 31 | private MedVaccineNameService medVaccineNameService; |
29 | 32 | |
33 | + private final static String isDelete = "1"; | |
34 | + | |
35 | + private final static String MIAN_FEI = "免费"; | |
36 | + private final static String SHOU_FEI = "收费"; | |
37 | + private final static String YI_LEI_YI_MIAO = "一类疫苗"; | |
38 | + private final static String ER_LEI_YI_MIAO = "二类疫苗"; | |
39 | + | |
30 | 40 | /** |
31 | 41 | * |
32 | 42 | * @param response |
... | ... | @@ -79,6 +89,84 @@ |
79 | 89 | |
80 | 90 | writeJson(response, JsonUtil.obj2JsonString(map)); |
81 | 91 | } |
92 | + | |
93 | + /** | |
94 | + * 获取疫苗详情 | |
95 | + * @param response | |
96 | + * @param ids | |
97 | + * @return | |
98 | + */ | |
99 | + @RequestMapping(value = "/getVaccineNames") | |
100 | + public ModelAndView getVaccineName(HttpServletResponse response, | |
101 | + @RequestParam(value = "ids") String ids) { | |
102 | + ModelAndView mv = new ModelAndView("error"); | |
103 | + | |
104 | + if (ids == null) { | |
105 | + mv.addObject("msg", "vaccineNames id is null"); | |
106 | + } | |
107 | + | |
108 | + List<MedVaccineName> nameAllList = new ArrayList<>(); | |
109 | + | |
110 | + String[] temp = ids.split(","); | |
111 | + for (String id : temp){ | |
112 | + MedVaccineNameQuery query = new MedVaccineNameQuery(); | |
113 | + query.setIsDelete(isDelete); | |
114 | + query.setVnId(id); | |
115 | + List<MedVaccineName> nameList = medVaccineNameService.queryMedVaccineName(query); | |
116 | + if (nameList.size()==0){ | |
117 | + mv.setViewName("empty"); | |
118 | + mv.addObject("msg", "无疫苗详情信息"); | |
119 | + } | |
120 | + | |
121 | + for (MedVaccineName data : nameList){ | |
122 | + | |
123 | + String[] ages = data.getVnMonthAge().split(",");//1,2 | |
124 | + String monthAgeStr = ""; | |
125 | + for (int j = 0; j < ages.length ; j++) { | |
126 | + String q = ages[j]+"月齡"+"("+ (j+1) +"/"+ages.length+")"; | |
127 | + monthAgeStr+=q; | |
128 | + if (ages.length-1 != j) | |
129 | + { | |
130 | + monthAgeStr+=","; | |
131 | + } | |
132 | + } | |
133 | + data.setVnMonthAge(monthAgeStr); | |
134 | + | |
135 | + if (data.getVnVaccineType()==1){ | |
136 | + data.setTypeName(MIAN_FEI); | |
137 | + data.setVnVaccineTypeName(YI_LEI_YI_MIAO); | |
138 | + }else if (data.getVnVaccineType()==2){ | |
139 | + data.setTypeName(SHOU_FEI); | |
140 | + data.setVnVaccineTypeName(ER_LEI_YI_MIAO); | |
141 | + } | |
142 | + | |
143 | + if (data.getVnPosition().equals(PositionEnum.zero.getId())){ | |
144 | + data.setVnPositionName(PositionEnum.getTitle(PositionEnum.zero.getId())); | |
145 | + }else if (data.getVnPosition().equals(PositionEnum.two.getId())){ | |
146 | + data.setVnPositionName(PositionEnum.getTitle(PositionEnum.two.getId())); | |
147 | + }else if (data.getVnPosition().equals(PositionEnum.three.getId())){ | |
148 | + data.setVnPositionName(PositionEnum.getTitle(PositionEnum.three.getId())); | |
149 | + }else if (data.getVnPosition().equals(PositionEnum.four.getId())){ | |
150 | + data.setVnPositionName(PositionEnum.getTitle(PositionEnum.four.getId())); | |
151 | + }else if (data.getVnPosition().equals(PositionEnum.five.getId())){ | |
152 | + data.setVnPositionName(PositionEnum.getTitle(PositionEnum.five.getId())); | |
153 | + } | |
154 | + | |
155 | + } | |
156 | + nameAllList.addAll(nameList); | |
157 | + } | |
158 | + | |
159 | + mv.setViewName("vaccineNameList"); | |
160 | + mv.addObject("vaccineNameList", nameAllList); | |
161 | + | |
162 | + return mv; | |
163 | + } | |
164 | + | |
165 | + | |
166 | + | |
167 | + | |
168 | + | |
169 | + | |
82 | 170 | |
83 | 171 | } |
webApi/src/main/resources/macro.vm
View file @
21e6c7f
1 | +#macro(paging $page $url) | |
2 | + #set($nextPage = $page.page+1) | |
3 | + #set($prevousPage = $page.page - 1 ) | |
4 | + #if($page.pages > 1) | |
5 | + #if($page.prev) | |
6 | + <li> <a href="$!{request.contextPath}/$url?page=$prevousPage" class="active">上一页</a> </li> | |
7 | + #else | |
8 | + <li> <a disabled="true">上一页</a></li> | |
9 | + #end | |
10 | + | |
11 | + #foreach($num in $page.pageNums) | |
12 | + #if($num==$page.page) | |
13 | + <li class="active"><a href="$num" class="toPage">$num</a></li> | |
14 | + #else | |
15 | + <li><a href="$!{request.contextPath}/$url?page=$num" class="toPage">$num</a></li> | |
16 | + #end | |
17 | + #end | |
18 | + | |
19 | + #if($page.next) | |
20 | + <li> <a href="$!{request.contextPath}/$url?page=$nextPage" class="next">下一页</a></li> | |
21 | + #else | |
22 | + <li> <a disabled="true">下一页</a></li> | |
23 | + #end | |
24 | + #end | |
25 | + | |
26 | + <li class="active"> | |
27 | + <a disabled="true">$page.range[0]-$page.range[1] 共 $page.total</a> | |
28 | + </li> | |
29 | +#end |
webApi/src/main/resources/spring/applicationContext-mvc.xml
View file @
21e6c7f
... | ... | @@ -17,5 +17,35 @@ |
17 | 17 | </mvc:interceptors> |
18 | 18 | |
19 | 19 | |
20 | + | |
21 | + <context:component-scan base-package="com.lyms.yimiao.web.controller" use-default-filters="false"> | |
22 | + <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> | |
23 | + </context:component-scan> | |
24 | + | |
25 | + | |
26 | + <mvc:resources mapping="/image/**" location="/image/" /> | |
27 | + | |
28 | + <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"> | |
29 | + <property name="resourceLoaderPath" value="/WEB-INF/html"/> | |
30 | + <property name="configLocation" value="classpath:velocity.properties"/> | |
31 | + </bean> | |
32 | + | |
33 | + <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"> | |
34 | + <property name="suffix" value=".vm"/> | |
35 | + | |
36 | + <!-- 使用springMacro、使用servlet的对象 --> | |
37 | + <property name="exposeSpringMacroHelpers" value="true"/> | |
38 | + <property name="exposeRequestAttributes" value="true"/> | |
39 | + <property name="exposeSessionAttributes" value="true"/> | |
40 | + | |
41 | + <property name="contentType" value="text/html;charset=UTF-8" /> | |
42 | + | |
43 | + <!-- spring的日期格式化 --> | |
44 | + <property name="dateToolAttribute" value="dateTool"/> | |
45 | + | |
46 | + <!-- velocity toolbox --> | |
47 | + <property name="toolboxConfigLocation" value="/WEB-INF/VelocityUtils.xml"/> | |
48 | + </bean> | |
49 | + | |
20 | 50 | </beans> |
webApi/src/main/resources/velocity.properties
View file @
21e6c7f
1 | +#encoding | |
2 | +input.encoding =UTF-8 | |
3 | +output.encoding=UTF-8 | |
4 | +contentType=text/html;charset=UTF-8 | |
5 | + | |
6 | +#autoreload when vm changed | |
7 | +file.resource.loader.cache=false | |
8 | +file.resource.loader.modificationCheckInterval =1 | |
9 | +velocimacro.library.autoreload=true | |
10 | + | |
11 | +#macro | |
12 | +velocimacro.library=macro.vm | |
13 | +#velocimacro.library =/WEB-INF/vm/macro.vm | |
14 | + | |
15 | +#layout | |
16 | +#tools.view.servlet.layout.directory =/WEB-INF/vm/layout/ | |
17 | +#tools.view.servlet.error.template=/WEB-INF/vm/error.vm | |
18 | +#tools.view.servlet.layout.default.template=default.vm | |
19 | + | |
20 | +runtime.log.logsystem.class=org.springframework.ui.velocity.CommonsLoggingLogSystem | |
21 | +runtime.log=com.yi | |
22 | +runtime.log.error.stacktrace=true | |
23 | +runtime.log.warn.stacktrace=true | |
24 | +runtime.log.info.stacktrace=false | |
25 | +runtime.log.invalid.reference=true |
webApi/src/main/webapp/WEB-INF/VelocityUtils.xml
View file @
21e6c7f
webApi/src/main/webapp/WEB-INF/html/inoculateRecord.vm
View file @
21e6c7f
1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
2 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
3 | +<html xmlns="http://www.w3.org/1999/xhtml" class="mommyboby"> | |
4 | +<head> | |
5 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
6 | + <title>接种记录</title> | |
7 | + | |
8 | + <style> | |
9 | + | |
10 | + body { | |
11 | + background-color: #E7E7E7; | |
12 | + } | |
13 | + .container { | |
14 | + min-width: 200px; | |
15 | + width: 100%; | |
16 | + margin-top: 10px; | |
17 | + } | |
18 | + .container .title { | |
19 | + height: 25px; | |
20 | + background-color: #A3D1EA; | |
21 | + padding-left: 15px; | |
22 | + padding-bottom: 15px; | |
23 | + padding-top: 20px; | |
24 | + border-radius:3px 3px 0px 0px; | |
25 | + color: #FFFFFF; | |
26 | + } | |
27 | + | |
28 | + | |
29 | + .container .title .t_left { | |
30 | + float: left; | |
31 | + font-size: 23px; | |
32 | + } | |
33 | + .container .title .t_right { | |
34 | + float: right; | |
35 | + } | |
36 | + | |
37 | + | |
38 | + .container .body { | |
39 | + clear: both; | |
40 | + } | |
41 | + | |
42 | + .container .body ul { | |
43 | + list-style: none; | |
44 | + margin: 0px; | |
45 | + padding: 0px; | |
46 | + } | |
47 | + .container .body ul li{ | |
48 | + border-bottom: #e7e5df 1px solid; | |
49 | + } | |
50 | + | |
51 | + .container .body ul li.header { | |
52 | + background-color: #fffef2; | |
53 | + height: 40px; | |
54 | + line-height: 40px;; | |
55 | + } | |
56 | + | |
57 | + .container .body ul li.content { | |
58 | + background-color: #ffffff; | |
59 | + } | |
60 | + | |
61 | + .container .body ul li.header span{ | |
62 | + font-size: 12px; | |
63 | + line-height: 40px; | |
64 | + padding-left: 15px; | |
65 | + display: inline-block; | |
66 | + width: 45%; | |
67 | + color: #434343; | |
68 | + } | |
69 | + | |
70 | + .container .body ul li.header span.half:first-child{ | |
71 | + border-right: #e7e5df 1px solid; | |
72 | + float: left; | |
73 | + } | |
74 | + | |
75 | + .container .body ul li.content span { | |
76 | + line-height: 40px; | |
77 | + padding-left: 15px; | |
78 | + display: inline-block; | |
79 | + width: 45%; | |
80 | + color: #979797; | |
81 | + font-size: 14px; | |
82 | + } | |
83 | + | |
84 | + .container .body ul li.content span.text { | |
85 | + width: 95%; | |
86 | + line-height: 30px;; | |
87 | + padding-top:10px; | |
88 | + padding-bottom: 10px;; | |
89 | + } | |
90 | + | |
91 | + .container .body ul li.content span.line { | |
92 | + width: 95%; | |
93 | + line-height: 30px; | |
94 | + } | |
95 | + | |
96 | + .container .body .lookMore { | |
97 | + height: 40px; | |
98 | + line-height: 40px; | |
99 | + background-color: #f5f5f5; | |
100 | + color: #BABABA; | |
101 | + font-size: 12px; | |
102 | + text-align: center; | |
103 | + border-radius: 0 0 3px 3px; | |
104 | + } | |
105 | + .container .body .lookMore img { | |
106 | + height: 16px; | |
107 | + width: 16px; | |
108 | + margin-top:-3px; | |
109 | + vertical-align: middle; | |
110 | + } | |
111 | + .container .body ul.moreInfo { | |
112 | + margin-top: 10px; | |
113 | + display: none; | |
114 | + } | |
115 | + .container .body ul.moreInfo li:first-child { | |
116 | + border-radius: 3px 3px 0 0; | |
117 | + } | |
118 | + .container .body ul.moreInfo li:last-child{ | |
119 | + border-radius: 0 0 3px 3px; | |
120 | + } | |
121 | + </style> | |
122 | + | |
123 | + <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | |
124 | + <meta content="IE=edge" http-equiv="X-UA-Compatible"> | |
125 | + <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"> | |
126 | +</head> | |
127 | + | |
128 | + | |
129 | + | |
130 | + | |
131 | +<body"> | |
132 | + | |
133 | +<div class="container"> | |
134 | + | |
135 | + <div class="title"> | |
136 | + <div class="t_left"> | |
137 | + 乙肝疫苗 | |
138 | + </div> | |
139 | + </div> | |
140 | + <div class="body"> | |
141 | + <ul> | |
142 | + <li class="header"> | |
143 | + <span>接种单位</span> | |
144 | + </li> | |
145 | + <li class="content"> | |
146 | + <span>东半壁店卫生院</span> | |
147 | + </li> | |
148 | + <li class="header"> | |
149 | + <span class="half">接种时间</span> | |
150 | + <span>接种医生</span> | |
151 | + </li> | |
152 | + <li class="content"> | |
153 | + <span class="half">2016年5月12日</span> | |
154 | + <span>王医生</span> | |
155 | + </li> | |
156 | + <li class="header"> | |
157 | + <span class="half">接种部位</span> | |
158 | + <span>接种剂次</span> | |
159 | + </li> | |
160 | + <li class="content"> | |
161 | + <span class="half">左上臂</span> | |
162 | + <span>第1/2次</span> | |
163 | + </li> | |
164 | + <li class="header"> | |
165 | + <span class="half">疫苗生产企业</span> | |
166 | + <span>疫苗批号</span> | |
167 | + </li> | |
168 | + <li class="content"> | |
169 | + <span class="half">华尔顿</span> | |
170 | + <span>1324235123</span> | |
171 | + </li> | |
172 | + </ul> | |
173 | + <div class="lookMore" onclick="lookMore(this)"> | |
174 | + <span>查看疫苗详情</span> | |
175 | + <img id="moreImg" src="../image/small_arrow_down.png"> | |
176 | + </div> | |
177 | + <ul id="moreInfo" class="moreInfo"> | |
178 | + <li class="header"> | |
179 | + <span>接种预防疾病</span> | |
180 | + </li> | |
181 | + <li class="content"> | |
182 | + <span>乙肝肝炎</span> | |
183 | + </li> | |
184 | + <li class="header"> | |
185 | + <span>接种时间</span> | |
186 | + </li> | |
187 | + <li class="content"> | |
188 | + <span>3月龄(1/2), 6月龄(2/2)</span> | |
189 | + </li> | |
190 | + <li class="header"> | |
191 | + <span>接种部位</span> | |
192 | + </li> | |
193 | + <li class="content"> | |
194 | + <span>上臂三角肌(注射)</span> | |
195 | + </li> | |
196 | + <li class="header"> | |
197 | + <span>接种效果</span> | |
198 | + </li> | |
199 | + <li class="content"> | |
200 | + <span class="text"> | |
201 | + 凡按照规定程序注射3针乙肝疫苗的人,95%能产生保护作用,可以生产抗体乙肝病毒的抗体,但有5%的注射3针后任不产生抗体,出现免疫无应答或低应答状态。 | |
202 | + </span> | |
203 | + </li> | |
204 | + <li class="header"> | |
205 | + <span>接种禁忌</span> | |
206 | + </li> | |
207 | + <li class="content"> | |
208 | + <span class="line">1.发热或暂缓注射</span> | |
209 | + <span class="line">2.对疫苗已知的任何成分过敏者</span> | |
210 | + <span class="line">3.患有急性或慢性严重疾病者</span> | |
211 | + </li> | |
212 | + <li class="header"> | |
213 | + <span>不良反应</span> | |
214 | + </li> | |
215 | + <li class="content"> | |
216 | + <span class="text"> | |
217 | + 注射部位局部反应-疼痛、红斑(皮肤发红)、硬结、中度、过敏性的发热。 | |
218 | + </span> | |
219 | + </li> | |
220 | + </ul> | |
221 | + </div> | |
222 | + | |
223 | +</div> | |
224 | + | |
225 | +</body> | |
226 | + | |
227 | +<script type="text/javascript"> | |
228 | + function lookMore(target) { | |
229 | + var element = target.nextElementSibling; | |
230 | + if("display:none" == element.getAttribute("style")) { | |
231 | + element.setAttribute("style", "display:block"); | |
232 | + } else { | |
233 | + element.setAttribute("style", "display:none"); | |
234 | + } | |
235 | + | |
236 | + var element2 = target.getElementsByTagName("img")[0]; | |
237 | + if("up" == element2.getAttribute("class")) { | |
238 | + element2.setAttribute("class", ""); | |
239 | + } else { | |
240 | + element2.setAttribute("class", "up"); | |
241 | + } | |
242 | + } | |
243 | + | |
244 | +</script> | |
245 | + | |
246 | + | |
247 | +</html> |
webApi/src/main/webapp/WEB-INF/html/vaccineNameList.vm
View file @
21e6c7f
1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
2 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
3 | +<html xmlns="http://www.w3.org/1999/xhtml" class="mommyboby"> | |
4 | +<head> | |
5 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
6 | + <title>疫苗详情</title> | |
7 | + | |
8 | + <style> | |
9 | + | |
10 | + body { | |
11 | + background-color: #E7E7E7; | |
12 | + } | |
13 | + | |
14 | + .container { | |
15 | + min-width: 200px; | |
16 | + width: 100%; | |
17 | + margin-top: 10px; | |
18 | + } | |
19 | + | |
20 | + .container .title { | |
21 | + height: 25px; | |
22 | + background-color: #A3D1EA; | |
23 | + padding-left: 15px; | |
24 | + padding-bottom: 15px; | |
25 | + padding-top: 20px; | |
26 | + border-radius: 3px 3px 0px 0px; | |
27 | + color: #FFFFFF; | |
28 | + } | |
29 | + | |
30 | + .container .title .t_left { | |
31 | + float: left; | |
32 | + font-size: 23px; | |
33 | + } | |
34 | + | |
35 | + .container .title .t_right { | |
36 | + float: right; | |
37 | + font-size: 11px; | |
38 | + margin-top: 13px; | |
39 | + margin-right: 9px; | |
40 | + } | |
41 | + | |
42 | + .container .title span:first-child { | |
43 | + margin-right: 4px; | |
44 | + } | |
45 | + | |
46 | + .container .body { | |
47 | + clear: both; | |
48 | + } | |
49 | + | |
50 | + .container .body ul { | |
51 | + list-style: none; | |
52 | + margin: 0px; | |
53 | + padding: 0px; | |
54 | + } | |
55 | + | |
56 | + .container .body ul li { | |
57 | + border-bottom: #e7e5df 1px solid; | |
58 | + } | |
59 | + | |
60 | + .container .body ul li.header { | |
61 | + background-color: #fffef2; | |
62 | + height: 40px; | |
63 | + line-height: 40px;; | |
64 | + } | |
65 | + | |
66 | + .container .body ul li.content { | |
67 | + background-color: #ffffff; | |
68 | + } | |
69 | + | |
70 | + .container .body ul li.header span { | |
71 | + font-size: 12px; | |
72 | + line-height: 40px; | |
73 | + padding-left: 15px; | |
74 | + display: inline-block; | |
75 | + width: 45%; | |
76 | + color: #434343; | |
77 | + } | |
78 | + | |
79 | + .container .body ul li.header span.half:first-child { | |
80 | + border-right: #e7e5df 1px solid; | |
81 | + float: left; | |
82 | + } | |
83 | + | |
84 | + .container .body ul li.content span { | |
85 | + line-height: 40px; | |
86 | + padding-left: 15px; | |
87 | + display: inline-block; | |
88 | + width: 45%; | |
89 | + color: #979797; | |
90 | + font-size: 14px; | |
91 | + } | |
92 | + | |
93 | + .container .body ul li.content span.text { | |
94 | + width: 95%; | |
95 | + line-height: 30px;; | |
96 | + padding-top: 10px; | |
97 | + padding-bottom: 10px;; | |
98 | + } | |
99 | + | |
100 | + .container .body ul li.content span.line { | |
101 | + width: 95%; | |
102 | + line-height: 30px; | |
103 | + } | |
104 | + | |
105 | + .container .body .lookMore { | |
106 | + height: 40px; | |
107 | + line-height: 40px; | |
108 | + background-color: #f5f5f5; | |
109 | + color: #BABABA; | |
110 | + font-size: 12px; | |
111 | + text-align: center; | |
112 | + border-radius: 0 0 3px 3px; | |
113 | + } | |
114 | + | |
115 | + .container .body .lookMore img { | |
116 | + height: 16px; | |
117 | + width: 16px; | |
118 | + margin-top: -3px; | |
119 | + vertical-align: middle; | |
120 | + } | |
121 | + | |
122 | + .container .body ul.moreInfo { | |
123 | + margin-top: 10px; | |
124 | + | |
125 | + } | |
126 | + | |
127 | + .container .body ul.moreInfo li:first-child { | |
128 | + border-radius: 3px 3px 0 0; | |
129 | + } | |
130 | + | |
131 | + .container .body ul.moreInfo li:last-child { | |
132 | + border-radius: 0 0 3px 3px; | |
133 | + } | |
134 | + </style> | |
135 | + | |
136 | +<body> | |
137 | + | |
138 | +<div class="container"> | |
139 | + | |
140 | + | |
141 | + #foreach($vaccineName in $!vaccineNameList) | |
142 | + | |
143 | + <div class="title"> | |
144 | + <div class="t_left"> | |
145 | + $!vaccineName.vnName | |
146 | + </div> | |
147 | + <div class="t_right"> | |
148 | + <span>$!vaccineName.typeName</span> | |
149 | + <span>$!vaccineName.vnVaccineTypeName</span> | |
150 | + </div> | |
151 | + </div> | |
152 | + | |
153 | + <div class="body"> | |
154 | + | |
155 | + <ul id="moreInfo"> | |
156 | + <li class="header"> | |
157 | + <span>接种预防疾病</span> | |
158 | + </li> | |
159 | + <li class="content"> | |
160 | + <span>$!vaccineName.vnPreventDisease</span> | |
161 | + </li> | |
162 | + <li class="header"> | |
163 | + <span>接种时间</span> | |
164 | + </li> | |
165 | + <li class="content"> | |
166 | + <span>$!vaccineName.vnMonthAge</span> | |
167 | + </li> | |
168 | + <li class="header"> | |
169 | + <span>接种部位</span> | |
170 | + </li> | |
171 | + <li class="content"> | |
172 | + <span>$!vaccineName.vnPositionName</span> | |
173 | + </li> | |
174 | + <li class="header"> | |
175 | + <span>接种效果</span> | |
176 | + </li> | |
177 | + <li class="content"> | |
178 | + <span class="text"> | |
179 | + 效果 | |
180 | + </span> | |
181 | + </li> | |
182 | + <li class="header"> | |
183 | + <span>接种禁忌</span> | |
184 | + </li> | |
185 | + <li class="content"> | |
186 | + <span>$!vaccineName.vnTaboo</span> | |
187 | + </li> | |
188 | + <li class="header"> | |
189 | + <span>不良反应</span> | |
190 | + </li> | |
191 | + <li class="content"> | |
192 | + <span class="text"> | |
193 | + $!vaccineName.vnDescription | |
194 | + </span> | |
195 | + </li> | |
196 | + </ul> | |
197 | + </div> | |
198 | + | |
199 | + | |
200 | + #end | |
201 | +</div> | |
202 | + | |
203 | +</body> | |
204 | + | |
205 | + | |
206 | + | |
207 | + | |
208 | +</html> |
webApi/src/main/webapp/image/small_arrow_down.png
View file @
21e6c7f
1.69 KB