Commit 9a711dd699e59e85b3fdd55979a90f7c0b4b3eea
1 parent
e61c4789db
Exists in
master
and in
6 other branches
辖区卫生院权限字段添加
Showing 3 changed files with 49 additions and 34 deletions
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
View file @
9a711dd
| ... | ... | @@ -37,7 +37,17 @@ |
| 37 | 37 | private String foreignId; |
| 38 | 38 | private Integer orgType; //-1 未设置 0 公司 1 医院 |
| 39 | 39 | private Integer status; |
| 40 | + //乡镇卫生院ID | |
| 41 | + private String townOrgId; | |
| 40 | 42 | |
| 43 | + public String getTownOrgId() { | |
| 44 | + return townOrgId; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setTownOrgId(String townOrgId) { | |
| 48 | + this.townOrgId = townOrgId; | |
| 49 | + } | |
| 50 | + | |
| 41 | 51 | public Integer getbStatus() { |
| 42 | 52 | return bStatus; |
| 43 | 53 | } |
| ... | ... | @@ -139,7 +149,6 @@ |
| 139 | 149 | public String getShortCode() { |
| 140 | 150 | return shortCode; |
| 141 | 151 | } |
| 142 | - | |
| 143 | 152 | |
| 144 | 153 | |
| 145 | 154 | public void setShortCode(String shortCode) { |
platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml
View file @
9a711dd
| ... | ... | @@ -22,20 +22,20 @@ |
| 22 | 22 | <result column="shortCode" property="shortCode" jdbcType="VARCHAR"/> |
| 23 | 23 | <result column="foreign_id" property="foreignId" jdbcType="VARCHAR"/> |
| 24 | 24 | <result column="bStatus" property="bStatus" jdbcType="INTEGER"/> |
| 25 | - | |
| 25 | + <result column="townOrgId" property="townOrgId" jdbcType="VARCHAR"/> | |
| 26 | 26 | </resultMap> |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | <insert id="addOrganization" parameterType="com.lyms.platform.permission.model.Organization"> |
| 30 | 30 | <selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer">SELECT LAST_INSERT_ID()</selectKey> |
| 31 | 31 | insert into organization |
| 32 | - (foreign_id,name,type,level,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id,bStatus | |
| 32 | + (foreign_id,name,type,level,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id,bStatus,townOrgId | |
| 33 | 33 | <if test="id != null and id >= 0"> |
| 34 | 34 | ,id |
| 35 | 35 | </if> |
| 36 | 36 | ) |
| 37 | 37 | values |
| 38 | - (#{foreignId},#{name},#{type},#{level},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId},#{bStatus} | |
| 38 | + (#{foreignId},#{name},#{type},#{level},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId},#{bStatus},#{townOrgId} | |
| 39 | 39 | <if test="id != null and id >= 0"> |
| 40 | 40 | ,#{id} |
| 41 | 41 | </if> |
| ... | ... | @@ -103,6 +103,9 @@ |
| 103 | 103 | <if test="status != null"> |
| 104 | 104 | status = #{status,jdbcType=INTEGER}, |
| 105 | 105 | </if> |
| 106 | + <if test="townOrgId !=null"> | |
| 107 | + townOrgId=#{townOrgId,jdbcType=VARCHAR}, | |
| 108 | + </if> | |
| 106 | 109 | </set> |
| 107 | 110 | where id = #{id,jdbcType=INTEGER} |
| 108 | 111 | </update> |
| ... | ... | @@ -114,7 +117,7 @@ |
| 114 | 117 | |
| 115 | 118 | |
| 116 | 119 | <select id="getOrganization" resultMap="OrganizationResultMap" parameterType="java.lang.Integer"> |
| 117 | -select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus | |
| 120 | +select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus,townOrgId | |
| 118 | 121 | from organization where id = #{id,jdbcType=INTEGER} |
| 119 | 122 | </select> |
| 120 | 123 | |
| ... | ... | @@ -218,7 +221,7 @@ |
| 218 | 221 | <select id="queryOrganization" resultMap="OrganizationResultMap" |
| 219 | 222 | parameterType="com.lyms.platform.permission.model.OrganizationQuery"> |
| 220 | 223 | select |
| 221 | - id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus | |
| 224 | + id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id,status,bStatus,townOrgId | |
| 222 | 225 | from organization |
| 223 | 226 | <include refid="OrganizationCondition"/> |
| 224 | 227 | <include refid="orderAndLimit"/> |
| ... | ... | @@ -261,7 +264,7 @@ |
| 261 | 264 | </select> |
| 262 | 265 | |
| 263 | 266 | <select id="getOrganizationByAreaId" parameterType="string" resultType="map"> |
| 264 | - SELECT id, name FROM `organization` where yn = 1 and area_id = #{areaId} | |
| 267 | + SELECT id, name,townOrgId FROM `organization` where yn = 1 and area_id = #{areaId} | |
| 265 | 268 | </select> |
| 266 | 269 | |
| 267 | 270 | <select id="getOrganizationName" parameterType="java.lang.String" resultType="java.lang.String"> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
9a711dd
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | */ |
| 60 | 60 | @RequestMapping(value = "/organization/{id}", method = RequestMethod.DELETE) |
| 61 | 61 | @TokenRequired |
| 62 | - public void updateOrganization(HttpServletResponse response, @PathVariable(value = "id") Integer id,HttpServletRequest request) { | |
| 62 | + public void updateOrganization(HttpServletResponse response, @PathVariable(value = "id") Integer id, HttpServletRequest request) { | |
| 63 | 63 | if (id == null) { |
| 64 | 64 | ResultUtils.buildParameterErrorResultAndWrite(response); |
| 65 | 65 | return; |
| ... | ... | @@ -133,7 +133,7 @@ |
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if(!organization.getName().equals(name)) { | |
| 136 | + if (!organization.getName().equals(name)) { | |
| 137 | 137 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
| 138 | 138 | organizationQuery.setYn(YnEnums.YES.getId()); |
| 139 | 139 | organizationQuery.setName(name); |
| ... | ... | @@ -184,7 +184,8 @@ |
| 184 | 184 | @RequestParam(value = "streetId", required = false) String streetId, |
| 185 | 185 | @RequestParam(value = "address") String address, |
| 186 | 186 | @RequestParam(value = "description", required = false) String description, |
| 187 | - @RequestParam(value = "shortCode", required = false) String shortCode) { | |
| 187 | + @RequestParam(value = "shortCode", required = false) String shortCode, | |
| 188 | + @RequestParam(value = "townOrgId", required = false) String townOrgId) { | |
| 188 | 189 | |
| 189 | 190 | //获取登录用户 |
| 190 | 191 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 191 | 192 | |
| 192 | 193 | |
| 193 | 194 | |
| ... | ... | @@ -220,17 +221,19 @@ |
| 220 | 221 | organization.setModified(new Date()); |
| 221 | 222 | organization.setPublishName(users.getName()); |
| 222 | 223 | organization.setPublishId(users.getId()); |
| 224 | + //乡镇卫生院ID | |
| 225 | + organization.setTownOrgId(townOrgId); | |
| 223 | 226 | //默认为建档医院 |
| 224 | 227 | organization.setbStatus(1); |
| 225 | - Integer id= organizationService.addOrganization(organization); | |
| 228 | + Integer id = organizationService.addOrganization(organization); | |
| 226 | 229 | |
| 227 | 230 | |
| 228 | 231 | operateLogFacade.addAddOptLog(getUserId(request), id, organization, OptActionEnums.ADD.getId(), "添加机构"); |
| 229 | 232 | |
| 230 | - AccessPermissionAddRequest accessPermissionAddRequest = new AccessPermissionAddRequest(); | |
| 231 | - accessPermissionAddRequest.setUserId(loginState.getId()+""); | |
| 233 | + AccessPermissionAddRequest accessPermissionAddRequest = new AccessPermissionAddRequest(); | |
| 234 | + accessPermissionAddRequest.setUserId(loginState.getId() + ""); | |
| 232 | 235 | accessPermissionAddRequest.setBizId(id + ""); |
| 233 | - accessPermissionAddRequest.setType(PermissionTypeEnums.Type.ADMIN.getId()+""); | |
| 236 | + accessPermissionAddRequest.setType(PermissionTypeEnums.Type.ADMIN.getId() + ""); | |
| 234 | 237 | accessPermissionFacade.addAccessPermission(accessPermissionAddRequest); |
| 235 | 238 | ResultUtils.buildSuccessResultAndWrite(response); |
| 236 | 239 | } |
| 237 | 240 | |
| 238 | 241 | |
| 239 | 242 | |
| ... | ... | @@ -242,25 +245,25 @@ |
| 242 | 245 | @ResponseBody |
| 243 | 246 | @TokenRequired |
| 244 | 247 | public Map getOrganization(HttpServletRequest request, @RequestParam(value = "page", required = false) Integer page, |
| 245 | - @RequestParam(value = "limit", required = false) Integer limit, | |
| 246 | - @RequestParam(value = "keyword", required = false) String keyword, | |
| 247 | - @RequestParam(value = "areaId", required = false) String aId) { | |
| 248 | + @RequestParam(value = "limit", required = false) Integer limit, | |
| 249 | + @RequestParam(value = "keyword", required = false) String keyword, | |
| 250 | + @RequestParam(value = "areaId", required = false) String aId) { | |
| 248 | 251 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 249 | 252 | Users users = usersService.getUsers(loginState.getId()); |
| 250 | 253 | |
| 251 | 254 | List<Integer> areaId = autoMatchFacade.matchAreaOrgId(loginState.getId()); |
| 252 | 255 | List<Object> data = new ArrayList<>(); |
| 253 | 256 | List<Organization> organizations = new ArrayList<>(); |
| 254 | - PageInfo pageInfo = new PageInfo(0,0,0,1); | |
| 257 | + PageInfo pageInfo = new PageInfo(0, 0, 0, 1); | |
| 255 | 258 | if (areaId != null) { |
| 256 | 259 | // 一定要加上自己的机构权限 |
| 257 | 260 | areaId.add(users.getOrgId()); |
| 258 | 261 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
| 259 | - if(null != page && null!=limit) { | |
| 262 | + if (null != page && null != limit) { | |
| 260 | 263 | organizationQuery.setNeed("true"); |
| 261 | 264 | organizationQuery.setPage(page); |
| 262 | 265 | organizationQuery.setLimit(limit); |
| 263 | - if(80 < limit) { //一次请求大于80 则按树排序 | |
| 266 | + if (80 < limit) { //一次请求大于80 则按树排序 | |
| 264 | 267 | organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); |
| 265 | 268 | } else { |
| 266 | 269 | organizationQuery.setSort("modified desc"); |
| ... | ... | @@ -268,7 +271,7 @@ |
| 268 | 271 | } |
| 269 | 272 | |
| 270 | 273 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId); |
| 271 | - if(null != basicConfig) { | |
| 274 | + if (null != basicConfig) { | |
| 272 | 275 | if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) { |
| 273 | 276 | organizationQuery.setProvinceId(aId); |
| 274 | 277 | } else { |
| 275 | 278 | |
| ... | ... | @@ -299,9 +302,9 @@ |
| 299 | 302 | // organizationQuery.setYn(YnEnums.YES.getId()); |
| 300 | 303 | // organizationQuery.setTypeList(list); |
| 301 | 304 | organizations = organizationService.queryOrganization(organizationQuery); |
| 302 | - pageInfo=organizationQuery.getPageInfo(); | |
| 305 | + pageInfo = organizationQuery.getPageInfo(); | |
| 303 | 306 | |
| 304 | - } else if(null == areaId && UserTypeEnum.SUPPER_ADMIN.getId().equals(users.getType())){ | |
| 307 | + } else if (null == areaId && UserTypeEnum.SUPPER_ADMIN.getId().equals(users.getType())) { | |
| 305 | 308 | // UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); |
| 306 | 309 | // userOrganizationMapsQuery.setYn(YnEnums.YES.getId()); |
| 307 | 310 | // userOrganizationMapsQuery.setUserId(loginState.getId()); |
| 308 | 311 | |
| ... | ... | @@ -311,11 +314,11 @@ |
| 311 | 314 | |
| 312 | 315 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
| 313 | 316 | organizationQuery.setKeyword(keyword); |
| 314 | - if(null != page &&null!= limit ) { | |
| 317 | + if (null != page && null != limit) { | |
| 315 | 318 | organizationQuery.setNeed("true"); |
| 316 | 319 | organizationQuery.setPage(page); |
| 317 | 320 | organizationQuery.setLimit(limit); |
| 318 | - if(80 < limit) { //一次请求大于80 则按树排序 | |
| 321 | + if (80 < limit) { //一次请求大于80 则按树排序 | |
| 319 | 322 | organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); |
| 320 | 323 | } else { |
| 321 | 324 | organizationQuery.setSort("modified desc"); |
| ... | ... | @@ -324,7 +327,7 @@ |
| 324 | 327 | |
| 325 | 328 | |
| 326 | 329 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId); |
| 327 | - if(null != basicConfig) { | |
| 330 | + if (null != basicConfig) { | |
| 328 | 331 | if (SystemConfig.CHINA_BASIC_ID.equals(basicConfig.getParentId())) { |
| 329 | 332 | organizationQuery.setProvinceId(aId); |
| 330 | 333 | } else { |
| 331 | 334 | |
| ... | ... | @@ -369,14 +372,14 @@ |
| 369 | 372 | data.add(organization); |
| 370 | 373 | } |
| 371 | 374 | } |
| 372 | - Map<String,Object> map = new HashMap<>(); | |
| 373 | - map.put("data",data); | |
| 374 | - map.put("errormsg","成功"); | |
| 375 | - map.put("errorcode",ErrorCodeConstants.SUCCESS); | |
| 376 | - map.put("pageInfo",pageInfo); | |
| 375 | + Map<String, Object> map = new HashMap<>(); | |
| 376 | + map.put("data", data); | |
| 377 | + map.put("errormsg", "成功"); | |
| 378 | + map.put("errorcode", ErrorCodeConstants.SUCCESS); | |
| 379 | + map.put("pageInfo", pageInfo); | |
| 377 | 380 | List<DataPermissionsModel> dataPermissionsModelList = accessPermissionFacade.findAccessPerminssionByUserId(loginState.getId()); |
| 378 | 381 | if (dataPermissionsModelList != null && dataPermissionsModelList.size() > 0) { |
| 379 | - map.put("areaPermission",dataPermissionsModelList.get(0).getAreaPermission()); | |
| 382 | + map.put("areaPermission", dataPermissionsModelList.get(0).getAreaPermission()); | |
| 380 | 383 | } |
| 381 | 384 | return map; |
| 382 | 385 | } |
| ... | ... | @@ -436,8 +439,8 @@ |
| 436 | 439 | List<Integer> list = autoMatchFacade.matchOrgId(loginState.getId()); |
| 437 | 440 | List<String> a = new ArrayList<>(); |
| 438 | 441 | |
| 439 | - if(CollectionUtils.isNotEmpty(list)){ | |
| 440 | - a = organizationService.queryProvinceIdByOrgId(list); | |
| 442 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 443 | + a = organizationService.queryProvinceIdByOrgId(list); | |
| 441 | 444 | } |
| 442 | 445 | /* for (Integer integer : list) { |
| 443 | 446 | Organization organization = organizationService.getOrganization(integer); |