Commit de4347eaa139115a3629d826f51b042a5097ba59
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 6 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PuerperaService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
- platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationLevelEnum.java
- platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationTypeEnum.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EnumsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PuerperaService.java
View file @
de4347e
| ... | ... | @@ -47,7 +47,7 @@ | 
| 47 | 47 | */ | 
| 48 | 48 | public PuerperaModel findOnePuerperaByCardNo(PuerperaModelQuery puerperaQuery) { | 
| 49 | 49 | List<PuerperaModel> result = iPuerperaDao.queryPuerpera(puerperaQuery.convertToQuery()); | 
| 50 | - if(CollectionUtils.isEmpty(result)){ | |
| 50 | + if(CollectionUtils.isNotEmpty(result)){ | |
| 51 | 51 | return result.get(0); | 
| 52 | 52 | } | 
| 53 | 53 | return null; | 
platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
View file @
de4347e
| 1 | 1 | package com.lyms.platform.permission.model; | 
| 2 | 2 | |
| 3 | 3 | |
| 4 | - | |
| 5 | 4 | import com.lyms.platform.common.dao.BaseQuery; | 
| 6 | 5 | |
| 7 | 6 | import java.util.Date; | 
| 8 | 7 | |
| 9 | 8 | |
| 9 | +public class OrganizationQuery extends BaseQuery { | |
| 10 | + private Integer id; | |
| 11 | + private String name; | |
| 12 | + private Integer type; | |
| 13 | + private Integer level; | |
| 14 | + private Integer areaManage; | |
| 15 | + private Integer provinceId; | |
| 16 | + private Integer cityId; | |
| 17 | + private Integer areaId; | |
| 18 | + private String address; | |
| 19 | + private String description; | |
| 20 | + private Integer publishId; | |
| 21 | + private String publishName; | |
| 22 | + private Integer yn; | |
| 23 | + private Date modified; | |
| 24 | + private Date created; | |
| 25 | + private String shortCode; | |
| 10 | 26 | |
| 11 | -public class OrganizationQuery extends BaseQuery {private Integer id;private String name;private Integer type;private Integer level;private Integer areaManage;private Integer provinceId;private Integer cityId;private Integer areaId;private String address;private String description;private Integer publishId;private String publishName;private Integer yn;private Date modified;private Date created;private String shortCode; | |
| 12 | - | |
| 13 | -public Integer getId() { | |
| 27 | + public Integer getId() { | |
| 14 | 28 | return id; | 
| 15 | 29 | } | 
| 16 | 30 | |
| 17 | 31 | |
| 18 | - | |
| 19 | 32 | public void setId(Integer id) { | 
| 20 | 33 | this.id = id; | 
| 21 | 34 | |
| 22 | 35 | } | 
| 23 | 36 | |
| 24 | -public String getName() { | |
| 37 | + public String getName() { | |
| 25 | 38 | return name; | 
| 26 | 39 | } | 
| 27 | 40 | |
| 28 | 41 | |
| 29 | - | |
| 30 | 42 | public void setName(String name) { | 
| 31 | 43 | this.name = name; | 
| 32 | 44 | |
| 33 | 45 | } | 
| 34 | 46 | |
| 35 | -public Integer getType() { | |
| 47 | + public Integer getType() { | |
| 36 | 48 | return type; | 
| 37 | 49 | } | 
| 38 | 50 | |
| 39 | 51 | |
| 40 | - | |
| 41 | 52 | public void setType(Integer type) { | 
| 42 | 53 | this.type = type; | 
| 43 | 54 | |
| 44 | 55 | } | 
| 45 | 56 | |
| 46 | -public Integer getLevel() { | |
| 57 | + public Integer getLevel() { | |
| 47 | 58 | return level; | 
| 48 | 59 | } | 
| 49 | 60 | |
| 50 | 61 | |
| 51 | - | |
| 52 | 62 | public void setLevel(Integer level) { | 
| 53 | 63 | this.level = level; | 
| 54 | 64 | |
| 55 | 65 | } | 
| 56 | 66 | |
| 57 | -public Integer getAreaManage() { | |
| 67 | + public Integer getAreaManage() { | |
| 58 | 68 | return areaManage; | 
| 59 | 69 | } | 
| 60 | 70 | |
| 61 | 71 | |
| 62 | - | |
| 63 | 72 | public void setAreaManage(Integer areaManage) { | 
| 64 | 73 | this.areaManage = areaManage; | 
| 65 | 74 | |
| 66 | 75 | } | 
| 67 | 76 | |
| 68 | -public Integer getProvinceId() { | |
| 77 | + public Integer getProvinceId() { | |
| 69 | 78 | return provinceId; | 
| 70 | 79 | } | 
| 71 | 80 | |
| 72 | 81 | |
| 73 | - | |
| 74 | 82 | public void setProvinceId(Integer provinceId) { | 
| 75 | 83 | this.provinceId = provinceId; | 
| 76 | 84 | |
| 77 | 85 | } | 
| 78 | 86 | |
| 79 | -public Integer getCityId() { | |
| 87 | + public Integer getCityId() { | |
| 80 | 88 | return cityId; | 
| 81 | 89 | } | 
| 82 | 90 | |
| 83 | 91 | |
| 84 | - | |
| 85 | 92 | public void setCityId(Integer cityId) { | 
| 86 | 93 | this.cityId = cityId; | 
| 87 | 94 | |
| 88 | 95 | } | 
| 89 | 96 | |
| 90 | -public Integer getAreaId() { | |
| 97 | + public Integer getAreaId() { | |
| 91 | 98 | return areaId; | 
| 92 | 99 | } | 
| 93 | 100 | |
| 94 | 101 | |
| 95 | - | |
| 96 | 102 | public void setAreaId(Integer areaId) { | 
| 97 | 103 | this.areaId = areaId; | 
| 98 | 104 | |
| 99 | 105 | } | 
| 100 | 106 | |
| 101 | -public String getAddress() { | |
| 107 | + public String getAddress() { | |
| 102 | 108 | return address; | 
| 103 | 109 | } | 
| 104 | 110 | |
| 105 | 111 | |
| 106 | - | |
| 107 | 112 | public void setAddress(String address) { | 
| 108 | 113 | this.address = address; | 
| 109 | 114 | |
| 110 | 115 | } | 
| 111 | 116 | |
| 112 | -public String getDescription() { | |
| 117 | + public String getDescription() { | |
| 113 | 118 | return description; | 
| 114 | 119 | } | 
| 115 | 120 | |
| 116 | 121 | |
| 117 | - | |
| 118 | 122 | public void setDescription(String description) { | 
| 119 | 123 | this.description = description; | 
| 120 | 124 | |
| 121 | 125 | } | 
| 122 | 126 | |
| 123 | -public Integer getPublishId() { | |
| 127 | + public Integer getPublishId() { | |
| 124 | 128 | return publishId; | 
| 125 | 129 | } | 
| 126 | 130 | |
| 127 | 131 | |
| 128 | - | |
| 129 | 132 | public void setPublishId(Integer publishId) { | 
| 130 | 133 | this.publishId = publishId; | 
| 131 | 134 | |
| 132 | 135 | } | 
| 133 | 136 | |
| 134 | -public String getPublishName() { | |
| 137 | + public String getPublishName() { | |
| 135 | 138 | return publishName; | 
| 136 | 139 | } | 
| 137 | 140 | |
| 138 | 141 | |
| 139 | - | |
| 140 | 142 | public void setPublishName(String publishName) { | 
| 141 | 143 | this.publishName = publishName; | 
| 142 | 144 | |
| 143 | 145 | } | 
| 144 | 146 | |
| 145 | -public Integer getYn() { | |
| 147 | + public Integer getYn() { | |
| 146 | 148 | return yn; | 
| 147 | 149 | } | 
| 148 | 150 | |
| 149 | 151 | |
| 150 | - | |
| 151 | 152 | public void setYn(Integer yn) { | 
| 152 | 153 | this.yn = yn; | 
| 153 | 154 | |
| 154 | 155 | } | 
| 155 | 156 | |
| 156 | -public Date getModified() { | |
| 157 | + public Date getModified() { | |
| 157 | 158 | return modified; | 
| 158 | 159 | } | 
| 159 | 160 | |
| 160 | 161 | |
| 161 | - | |
| 162 | 162 | public void setModified(Date modified) { | 
| 163 | 163 | this.modified = modified; | 
| 164 | 164 | |
| 165 | 165 | } | 
| 166 | 166 | |
| 167 | -public Date getCreated() { | |
| 167 | + public Date getCreated() { | |
| 168 | 168 | return created; | 
| 169 | 169 | } | 
| 170 | 170 | |
| 171 | 171 | |
| 172 | - | |
| 173 | 172 | public void setCreated(Date created) { | 
| 174 | 173 | this.created = created; | 
| 175 | 174 | |
| 176 | 175 | } | 
| 177 | 176 | |
| 178 | -public String getShortcode() { | |
| 177 | + public String getShortcode() { | |
| 179 | 178 | return shortCode; | 
| 180 | 179 | } | 
| 181 | - | |
| 182 | 180 | |
| 183 | 181 | |
| 184 | 182 | public void setShortcode(String shortCode) { | 
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationLevelEnum.java
View file @
de4347e
| 1 | +package com.lyms.platform.common.enums; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 机构级别 | |
| 5 | + * Created by Zhang.Rui on 2016/4/7. | |
| 6 | + */ | |
| 7 | +public enum OrganizationLevelEnum { | |
| 8 | + XY(1,"省"), NY(2,"市"),FB(3,"区县"), | |
| 9 | + TY(4, "乡镇"), NJY(5,"村"),JMQY(6,"其他"); | |
| 10 | + | |
| 11 | + private Integer id; | |
| 12 | + | |
| 13 | + public Integer getId() { | |
| 14 | + return id; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public void setId(Integer id) { | |
| 18 | + this.id = id; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public String getText() { | |
| 22 | + return text; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public void setText(String text) { | |
| 26 | + this.text = text; | |
| 27 | + } | |
| 28 | + | |
| 29 | + private String text; | |
| 30 | + | |
| 31 | + | |
| 32 | + OrganizationLevelEnum(int id, String text) { | |
| 33 | + this.id=id; | |
| 34 | + this.text = text; | |
| 35 | + } | |
| 36 | + | |
| 37 | +} | 
platform-common/src/main/java/com/lyms/platform/common/enums/OrganizationTypeEnum.java
View file @
de4347e
| 1 | +package com.lyms.platform.common.enums; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 机构类型 | |
| 5 | + * Created by Zhang.Rui on 2016/4/7. | |
| 6 | + */ | |
| 7 | +public enum OrganizationTypeEnum { | |
| 8 | + XY(1,"卫生与计划生育委员会"), NY(2,"妇幼保健院/站"),FB(3,"妇产(科)医院"), | |
| 9 | + TY(4, "综合医院"), NJY(5,"计生站"),JMQY(6,"卫生院"), | |
| 10 | + GJY(7,"卫生所"), GS(8,"其他"); | |
| 11 | + | |
| 12 | + private Integer id; | |
| 13 | + | |
| 14 | + public Integer getId() { | |
| 15 | + return id; | |
| 16 | + } | |
| 17 | + | |
| 18 | + public void setId(Integer id) { | |
| 19 | + this.id = id; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public String getText() { | |
| 23 | + return text; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public void setText(String text) { | |
| 27 | + this.text = text; | |
| 28 | + } | |
| 29 | + | |
| 30 | + private String text; | |
| 31 | + | |
| 32 | + | |
| 33 | + OrganizationTypeEnum(int id, String text) { | |
| 34 | + this.id=id; | |
| 35 | + this.text = text; | |
| 36 | + } | |
| 37 | + | |
| 38 | +} | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/EnumsController.java
View file @
de4347e
| 1 | 1 | package com.lyms.platform.operate.web.controller; | 
| 2 | 2 | |
| 3 | -import com.lyms.platform.common.enums.AgeUnitEnums; | |
| 4 | -import com.lyms.platform.common.enums.PatientsTypeEnum; | |
| 5 | -import com.lyms.platform.common.enums.SampleTypeEnum; | |
| 6 | -import com.lyms.platform.common.enums.SexEnum; | |
| 3 | +import com.lyms.platform.common.enums.*; | |
| 4 | +import com.lyms.platform.permission.model.Organization; | |
| 7 | 5 | import org.springframework.stereotype.Controller; | 
| 8 | 6 | import org.springframework.web.bind.annotation.RequestMapping; | 
| 9 | 7 | import org.springframework.web.bind.annotation.RequestMethod; | 
| ... | ... | @@ -88,6 +86,40 @@ | 
| 88 | 86 | return list; | 
| 89 | 87 | } | 
| 90 | 88 | |
| 89 | + /** | |
| 90 | + * 获取机构级别 | |
| 91 | + */ | |
| 92 | + @RequestMapping(value = "/getOrganizationLevel", method = RequestMethod.GET) | |
| 93 | + @ResponseBody | |
| 94 | + public List getOrganizationLevel() { | |
| 95 | + List<Object> list = new ArrayList<>(); | |
| 96 | + Map<String, String> m = null; | |
| 97 | + for (OrganizationLevelEnum e : OrganizationLevelEnum.values()) { | |
| 98 | + m = new HashMap<>(); | |
| 99 | + m.put("id", String.valueOf(e.getId())); | |
| 100 | + m.put("text", e.getText()); | |
| 101 | + list.add(m); | |
| 102 | + } | |
| 103 | + return list; | |
| 104 | + } | |
| 105 | + | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * 获取机构类型 | |
| 109 | + */ | |
| 110 | + @RequestMapping(value = "/getOrganizationType", method = RequestMethod.GET) | |
| 111 | + @ResponseBody | |
| 112 | + public List getOrganizationType() { | |
| 113 | + List<Object> list = new ArrayList<>(); | |
| 114 | + Map<String, String> m = null; | |
| 115 | + for (OrganizationTypeEnum e : OrganizationTypeEnum.values()) { | |
| 116 | + m = new HashMap<>(); | |
| 117 | + m.put("id", String.valueOf(e.getId())); | |
| 118 | + m.put("text", e.getText()); | |
| 119 | + list.add(m); | |
| 120 | + } | |
| 121 | + return list; | |
| 122 | + } | |
| 91 | 123 | |
| 92 | 124 | |
| 93 | 125 | public static void main(String a[]) { | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
de4347e
| ... | ... | @@ -119,7 +119,7 @@ | 
| 119 | 119 | @RequestParam(value = "name") String name, | 
| 120 | 120 | @RequestParam(value = "type") Integer type, | 
| 121 | 121 | @RequestParam(value = "level") Integer level, | 
| 122 | - @RequestParam(value = "areaManage") Integer areaManage, | |
| 122 | + @RequestParam(value = "areaManage",required = false) Integer areaManage, | |
| 123 | 123 | @RequestParam(value = "provinceId") Integer provinceId, | 
| 124 | 124 | @RequestParam(value = "cityId") Integer cityId, | 
| 125 | 125 | @RequestParam(value = "areaId") Integer areaId, | 
| ... | ... | @@ -137,6 +137,7 @@ | 
| 137 | 137 | } | 
| 138 | 138 | |
| 139 | 139 | OrganizationQuery organizationQuery = new OrganizationQuery(); | 
| 140 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 140 | 141 | organizationQuery.setName(name); | 
| 141 | 142 | if(0 < organizationService.queryOrganizationCount(organizationQuery)) { | 
| 142 | 143 | ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.NAME_EXIST,"机构名称已存在!"); | 
| ... | ... | @@ -177,6 +178,7 @@ | 
| 177 | 178 | @ResponseBody | 
| 178 | 179 | @TokenRequired | 
| 179 | 180 | public void getOrganization(HttpServletResponse response, | 
| 181 | + @RequestParam(value = "id", required = false) Integer id, | |
| 180 | 182 | @RequestParam(value = "keyword", required = false) String keyword, | 
| 181 | 183 | @RequestParam(value = "page", required = false) Integer page, | 
| 182 | 184 | @RequestParam(value = "limit", required = false) Integer limit, | 
| ... | ... | @@ -187,6 +189,7 @@ | 
| 187 | 189 | |
| 188 | 190 | |
| 189 | 191 | OrganizationQuery organizationQuery = new OrganizationQuery(); | 
| 192 | + organizationQuery.setId(id); | |
| 190 | 193 | organizationQuery.setNeed("true"); | 
| 191 | 194 | organizationQuery.setSort("id desc"); | 
| 192 | 195 | organizationQuery.setYn(YnEnums.YES.getId()); |