Commit 5ffb7af99f196ad97748e73882058b983cabae47
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.java
 - platform-dal/src/main/java/com/lyms/platform/pojo/CommunityConfig.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
 - platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
 
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.java
View file @
5ffb7af
platform-dal/src/main/java/com/lyms/platform/pojo/CommunityConfig.java
View file @
5ffb7af
| ... | ... | @@ -12,7 +12,7 @@ | 
| 12 | 12 | private String name; | 
| 13 | 13 | private String parentId; | 
| 14 | 14 | private Integer yn; | 
| 15 | - private Integer type; //1 地名, 2 小区 | |
| 15 | + private Integer type; //1 地名, 2 社区 | |
| 16 | 16 | private CommunityConfig parent; | 
| 17 | 17 | private List<CommunityConfig> nodes; | 
| 18 | 18 | private String gxxq; //管辖小区 | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
5ffb7af
| ... | ... | @@ -10,10 +10,7 @@ | 
| 10 | 10 | import com.lyms.platform.common.enums.YnEnums; | 
| 11 | 11 | import com.lyms.platform.common.utils.ResultUtils; | 
| 12 | 12 | import com.lyms.platform.operate.web.result.FrontEndResult; | 
| 13 | -import com.lyms.platform.permission.model.Organization; | |
| 14 | -import com.lyms.platform.permission.model.OrganizationQuery; | |
| 15 | -import com.lyms.platform.permission.model.Regions; | |
| 16 | -import com.lyms.platform.permission.model.Users; | |
| 13 | +import com.lyms.platform.permission.model.*; | |
| 17 | 14 | import com.lyms.platform.permission.service.*; | 
| 18 | 15 | import org.apache.commons.lang.StringUtils; | 
| 19 | 16 | import org.springframework.beans.factory.annotation.Autowired; | 
| ... | ... | @@ -38,6 +35,8 @@ | 
| 38 | 35 | private OrganizationService organizationService; | 
| 39 | 36 | @Autowired | 
| 40 | 37 | private RegionsService regionsService; | 
| 38 | + @Autowired | |
| 39 | + private DepartmentsService departmentsService; | |
| 41 | 40 | |
| 42 | 41 | |
| 43 | 42 | /** | 
| ... | ... | @@ -58,6 +57,24 @@ | 
| 58 | 57 | return; | 
| 59 | 58 | } | 
| 60 | 59 | |
| 60 | + //机构有使用 不能删除 | |
| 61 | + UsersQuery usersQuery = new UsersQuery(); | |
| 62 | + usersQuery.setOrgId(organization.getId()); | |
| 63 | + usersQuery.setYn(YnEnums.YES.getId()); | |
| 64 | + if(0 < usersService.queryUsersCount(usersQuery)) { | |
| 65 | + ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.DONT_DELETE, "机构下有用户信息,不能删除!"); | |
| 66 | + return; | |
| 67 | + } | |
| 68 | + | |
| 69 | + DepartmentsQuery departmentsQuery = new DepartmentsQuery(); | |
| 70 | + departmentsQuery.setYn(YnEnums.YES.getId()); | |
| 71 | + departmentsQuery.setOrgId(organization.getId()); | |
| 72 | + if(0 < departmentsService.queryDepartmentsCount(departmentsQuery)) { | |
| 73 | + ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.DONT_DELETE, "机构下有部门信息,不能删除!"); | |
| 74 | + return; | |
| 75 | + } | |
| 76 | + | |
| 77 | + //删除机构 | |
| 61 | 78 | organization.setYn(YnEnums.NO.getId()); | 
| 62 | 79 | organization.setModified(new Date()); | 
| 63 | 80 | organizationService.updateOrganization(organization); | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
5ffb7af
| ... | ... | @@ -110,7 +110,7 @@ | 
| 110 | 110 | @RequestParam(value = "page", required = false) Integer page, | 
| 111 | 111 | @RequestParam(value = "limit", required = false) Integer limit, | 
| 112 | 112 | @RequestParam(value = "orgId", required = false) Integer orgId, | 
| 113 | - @RequestParam(value = "ksId", required = false) Integer ksId) { | |
| 113 | + @RequestParam(value = "deptId", required = false) Integer deptId) { | |
| 114 | 114 | |
| 115 | 115 | limit = limit == null ? 10 : limit; | 
| 116 | 116 | page = page == null ? 1 : page; | 
| ... | ... | @@ -119,7 +119,7 @@ | 
| 119 | 119 | usersQuery.setNeed("true"); | 
| 120 | 120 | usersQuery.setSort("id desc"); | 
| 121 | 121 | usersQuery.setYn(YnEnums.YES.getId()); | 
| 122 | - usersQuery.setKsId(ksId); | |
| 122 | + usersQuery.setDeptId(deptId); | |
| 123 | 123 | usersQuery.setKeyword(keyword); | 
| 124 | 124 | usersQuery.setType(1); | 
| 125 | 125 | usersQuery.setOrgId(orgId); | 
| 126 | 126 | |
| ... | ... | @@ -216,12 +216,16 @@ | 
| 216 | 216 | UsersQuery usersQuery = new UsersQuery(); | 
| 217 | 217 | usersQuery.setPhone(phone); | 
| 218 | 218 | usersQuery.setYn(YnEnums.YES.getId()); | 
| 219 | - int count = usersService.queryUsersCount(usersQuery); | |
| 220 | - if(0 == count) { | |
| 219 | + List<Users> list = usersService.queryUsers(usersQuery); | |
| 220 | + if(0 == list.size()) { | |
| 221 | 221 | ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse, "该账户不存在"); | 
| 222 | 222 | return; | 
| 223 | 223 | } | 
| 224 | 224 | |
| 225 | + if(list.get(0).getEnable().equals(2)) { | |
| 226 | + ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse, "该账户已被禁用"); | |
| 227 | + return; | |
| 228 | + } | |
| 225 | 229 | |
| 226 | 230 | LoginContext loginContext = LoginUtil.sendVerCode(phone, typeId, token); | 
| 227 | 231 | if(null != loginContext) { |