Commit f10b186b41c156969b2831cdc2640f0672964bfc
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 7 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
f10b186
... | ... | @@ -239,12 +239,37 @@ |
239 | 239 | * @param patients |
240 | 240 | */ |
241 | 241 | public void validata(Patients patients) { |
242 | - //修改产筛 | |
242 | + //修改产筛s | |
243 | 243 | updateSieve(patients); |
244 | 244 | //修改转诊 |
245 | 245 | updateRefer(patients); |
246 | - | |
246 | + //修改产检管理信息 | |
247 | 247 | updateExRecord(patients); |
248 | + } | |
249 | + | |
250 | + /** | |
251 | + * 修改非建档医院基本信息 | |
252 | + */ | |
253 | + private void updateBaseData(Patients patients){ | |
254 | + PatientsQuery patientsQuery2=new PatientsQuery(); | |
255 | + patientsQuery2.setPid(patients.getPid()); | |
256 | + patientsQuery2.setEnable("0"); | |
257 | + | |
258 | + //查询出其他医院的隐藏建档 | |
259 | + List<Patients> patientses=queryPatient(patientsQuery2); | |
260 | + if(CollectionUtils.isNotEmpty(patientses)){ | |
261 | + for(Patients patients1:patientses){ | |
262 | + patients.setId(patients1.getId()); | |
263 | + patients.setBookbuildingDate(patients1.getBookbuildingDate()); | |
264 | + patients.setHospitalId(patients1.getHospitalId()); | |
265 | + patients.setBookbuildingDoctor(patients1.getBookbuildingDoctor()); | |
266 | + patients.setCreated(patients1.getCreated()); | |
267 | + //修改隐藏建档的基本信息 | |
268 | + updatePatient(patients); | |
269 | + //修改其他依赖此建档的信息 | |
270 | + validata(patients); | |
271 | + } | |
272 | + } | |
248 | 273 | } |
249 | 274 | //修改产检管理的孕妇基本信息 |
250 | 275 | private void updateExRecord(Patients patients){ |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
f10b186
... | ... | @@ -108,17 +108,29 @@ |
108 | 108 | //医院id |
109 | 109 | private List<String> hospitalList; |
110 | 110 | |
111 | - //档案编号 | |
112 | - private String fileCode; | |
111 | + //0 隐藏 1 显示 | |
112 | + private String enable="1"; | |
113 | + //区域来源 | |
114 | + private String source; | |
113 | 115 | |
114 | - public String getFileCode() { | |
115 | - return fileCode; | |
116 | + public String getSource() { | |
117 | + return source; | |
116 | 118 | } |
117 | 119 | |
118 | - public void setFileCode(String fileCode) { | |
119 | - this.fileCode = fileCode; | |
120 | + public void setSource(String source) { | |
121 | + this.source = source; | |
120 | 122 | } |
121 | 123 | |
124 | + public String getEnable() { | |
125 | + return enable; | |
126 | + } | |
127 | + | |
128 | + public void setEnable(String enable) { | |
129 | + this.enable = enable; | |
130 | + } | |
131 | + | |
132 | + | |
133 | + | |
122 | 134 | public String getProvinceRegisterId() { |
123 | 135 | return provinceRegisterId; |
124 | 136 | } |
... | ... | @@ -346,6 +358,17 @@ |
346 | 358 | //建档医生 |
347 | 359 | private String bookbuildingDoctor; |
348 | 360 | |
361 | + //档案编号 | |
362 | + private String fileCode; | |
363 | + | |
364 | + public String getFileCode() { | |
365 | + return fileCode; | |
366 | + } | |
367 | + | |
368 | + public void setFileCode(String fileCode) { | |
369 | + this.fileCode = fileCode; | |
370 | + } | |
371 | + | |
349 | 372 | public boolean isNorFactor() { |
350 | 373 | return norFactor; |
351 | 374 | } |
352 | 375 | |
... | ... | @@ -749,14 +772,14 @@ |
749 | 772 | } |
750 | 773 | if (buildType != -1) { |
751 | 774 | MongoCondition mongoCondition = MongoCondition.newInstance("buildType", 3, MongoOper.IS); |
752 | - MongoCondition condition1 = mongoCondition.and("enable", "1", MongoOper.IS); | |
775 | + MongoCondition condition1 = mongoCondition.and("enable", enable, MongoOper.IS); | |
753 | 776 | |
754 | 777 | MongoCondition condition12 = MongoCondition.newInstance("buildType", buildType, MongoOper.NE); |
755 | 778 | |
756 | 779 | condition = condition.orCondition(new MongoCondition[]{condition12, condition1}); |
757 | 780 | } else if (null != buildTypeList) { |
758 | 781 | MongoCondition mongoCondition = MongoCondition.newInstance("buildType", 3, MongoOper.IS); |
759 | - MongoCondition condition1 = mongoCondition.and("enable", "1", MongoOper.IS); | |
782 | + MongoCondition condition1 = mongoCondition.and("enable", enable, MongoOper.IS); | |
760 | 783 | MongoCondition condition2 = MongoCondition.newInstance("buildType", buildTypeList, MongoOper.IN); |
761 | 784 | condition = condition.orCondition(new MongoCondition[]{condition1, condition2}); |
762 | 785 | } |
... | ... | @@ -875,6 +898,9 @@ |
875 | 898 | |
876 | 899 | if (null != serviceType) { |
877 | 900 | condition = condition.and("serviceType", serviceType, MongoOper.IS); |
901 | + } | |
902 | + if(null!=source){ | |
903 | + condition = condition.and("source", source, MongoOper.IS); | |
878 | 904 | } |
879 | 905 | |
880 | 906 | if (null != serviceStatus) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
f10b186
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | import com.lyms.platform.common.enums.ZhiChenEnums; |
14 | 14 | import com.lyms.platform.common.utils.*; |
15 | 15 | import com.lyms.platform.operate.web.facade.AccessPermissionFacade; |
16 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
16 | 17 | import com.lyms.platform.operate.web.result.FrontEndResult; |
17 | 18 | import com.lyms.platform.operate.web.session.SessionProvider; |
18 | 19 | import com.lyms.platform.operate.web.session.strategy.ISessionProvider; |
... | ... | @@ -21,6 +22,8 @@ |
21 | 22 | import com.lyms.platform.pojo.DataPermissionsModel; |
22 | 23 | import org.apache.commons.collections.CollectionUtils; |
23 | 24 | import org.apache.commons.lang.StringUtils; |
25 | +import org.apache.commons.lang.math.*; | |
26 | +import org.apache.commons.lang.math.NumberUtils; | |
24 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
25 | 28 | import org.springframework.beans.factory.annotation.Value; |
26 | 29 | import org.springframework.http.MediaType; |
27 | 30 | |
28 | 31 | |
... | ... | @@ -69,15 +72,17 @@ |
69 | 72 | private AccessPermissionFacade accessPermissionFacade; |
70 | 73 | @Autowired |
71 | 74 | private SessionProvider iSessionProvider; |
75 | + @Autowired | |
76 | + private AutoMatchFacade autoMatchFacade; | |
72 | 77 | |
73 | 78 | private static final String LYMS = "龙源美生"; |
74 | 79 | |
75 | - private static final String ADMIN="管理员"; | |
76 | - private static final String replacePwd = "[$#&/]-+"; | |
80 | + private static final String ADMIN = "管理员"; | |
81 | + private static final String replacePwd = "[$#&/]-+"; | |
77 | 82 | |
78 | 83 | @RequestMapping(value = "/rebuildUserRoles", method = RequestMethod.GET) |
79 | 84 | @ResponseBody |
80 | - public String rebuildUserRoles(@RequestParam(value = "hospitalId")Integer hospitalId) { | |
85 | + public String rebuildUserRoles(@RequestParam(value = "hospitalId") Integer hospitalId) { | |
81 | 86 | StringBuffer sb = new StringBuffer(); |
82 | 87 | Organization organization = organizationService.getOrganization(hospitalId); |
83 | 88 | if (organization != null) { |
84 | 89 | |
... | ... | @@ -88,11 +93,11 @@ |
88 | 93 | rolesQuery.setOrgIds(orgids); |
89 | 94 | List<Roles> rolesList = rolesService.queryRoles(rolesQuery); |
90 | 95 | if (rolesList == null || rolesList.size() == 0) { |
91 | - sb.append("机构下权限不存在:"+hospitalId); | |
96 | + sb.append("机构下权限不存在:" + hospitalId); | |
92 | 97 | } else { |
93 | - Map<Integer,Roles> rolesMap = new HashMap<>(); | |
94 | - for (Roles r:rolesList) { | |
95 | - rolesMap.put(Integer.valueOf(r.getRemarks().split("_")[1 ]), r); | |
98 | + Map<Integer, Roles> rolesMap = new HashMap<>(); | |
99 | + for (Roles r : rolesList) { | |
100 | + rolesMap.put(Integer.valueOf(r.getRemarks().split("_")[1]), r); | |
96 | 101 | } |
97 | 102 | UsersQuery usersQuery = new UsersQuery(); |
98 | 103 | usersQuery.setOrgId(hospitalId); |
... | ... | @@ -105,7 +110,7 @@ |
105 | 110 | for (UserRoleMaps maps : mapsList) { |
106 | 111 | Roles roles = rolesMap.get(maps.getRoleId()); |
107 | 112 | if (roles == null) { |
108 | - sb.append("<br>roles is null "+JsonUtil.obj2JsonString(maps)+" -- "+users.getId()); | |
113 | + sb.append("<br>roles is null " + JsonUtil.obj2JsonString(maps) + " -- " + users.getId()); | |
109 | 114 | } else { |
110 | 115 | UserRoleMaps dbmaps = new UserRoleMaps(); |
111 | 116 | dbmaps.setYn(1); |
112 | 117 | |
... | ... | @@ -113,13 +118,13 @@ |
113 | 118 | dbmaps.setUserId(users.getId()); |
114 | 119 | userRoleMapsService.addUserRoleMaps(dbmaps); |
115 | 120 | userRoleMapsService.deleteUserRoleMaps(maps.getId()); |
116 | - sb.append("<br>success userid:"+users.getId()+" -- "+JsonUtil.obj2JsonString(dbmaps)+" -- "+JsonUtil.obj2JsonString(maps)); | |
121 | + sb.append("<br>success userid:" + users.getId() + " -- " + JsonUtil.obj2JsonString(dbmaps) + " -- " + JsonUtil.obj2JsonString(maps)); | |
117 | 122 | } |
118 | 123 | } |
119 | 124 | } |
120 | 125 | } |
121 | 126 | } else { |
122 | - sb.append("机构不存在:"+hospitalId); | |
127 | + sb.append("机构不存在:" + hospitalId); | |
123 | 128 | } |
124 | 129 | return sb.toString(); |
125 | 130 | } |
... | ... | @@ -131,10 +136,10 @@ |
131 | 136 | @ResponseBody |
132 | 137 | @TokenRequired |
133 | 138 | public FrontEndResult getAdminList(HttpServletResponse response, |
134 | - @RequestParam(value = "keyword", required = false) String keyword, | |
135 | - @RequestParam(value = "rolesId", required = false) Integer rolesId, | |
136 | - @RequestParam(value = "page", required = false) Integer page, | |
137 | - @RequestParam(value = "limit", required = false) Integer limit) { | |
139 | + @RequestParam(value = "keyword", required = false) String keyword, | |
140 | + @RequestParam(value = "rolesId", required = false) Integer rolesId, | |
141 | + @RequestParam(value = "page", required = false) Integer page, | |
142 | + @RequestParam(value = "limit", required = false) Integer limit) { | |
138 | 143 | |
139 | 144 | limit = limit == null ? 10 : limit; |
140 | 145 | page = page == null ? 1 : page; |
... | ... | @@ -151,7 +156,7 @@ |
151 | 156 | |
152 | 157 | List<Users> users = usersService.queryUsers2(usersQuery); |
153 | 158 | //设置用户角色信息 |
154 | - for(Users user : users) { | |
159 | + for (Users user : users) { | |
155 | 160 | user.setRoles(this.getUserRoles(user.getId())); |
156 | 161 | user.setDepartmentses(departmentsService.getDepartments(user.getDeptId())); |
157 | 162 | List<DataPermissionsModel> permissionsModelList = accessPermissionFacade.findAccessPerminssionByUserId(user.getId()); |
158 | 163 | |
... | ... | @@ -168,12 +173,12 @@ |
168 | 173 | return frontEndResult; |
169 | 174 | } |
170 | 175 | |
171 | - @RequestMapping(value = "/users/enums",method = RequestMethod.GET) | |
176 | + @RequestMapping(value = "/users/enums", method = RequestMethod.GET) | |
172 | 177 | @ResponseBody |
173 | - public Map getEnums(){ | |
174 | - Map<Integer,Object> map=new HashMap(); | |
175 | - for(ZhiChenEnums zhiChenEnums:ZhiChenEnums.values()){ | |
176 | - map.put(zhiChenEnums.getId(),zhiChenEnums.getName()); | |
178 | + public Map getEnums() { | |
179 | + Map<Integer, Object> map = new HashMap(); | |
180 | + for (ZhiChenEnums zhiChenEnums : ZhiChenEnums.values()) { | |
181 | + map.put(zhiChenEnums.getId(), zhiChenEnums.getName()); | |
177 | 182 | } |
178 | 183 | return map; |
179 | 184 | } |
180 | 185 | |
181 | 186 | |
182 | 187 | |
183 | 188 | |
184 | 189 | |
185 | 190 | |
186 | 191 | |
187 | 192 | |
... | ... | @@ -186,42 +191,42 @@ |
186 | 191 | @ResponseBody |
187 | 192 | public FrontEndResult getPermissions(HttpServletResponse response, |
188 | 193 | HttpServletRequest request, |
189 | - @RequestParam(value = "keyword", required = false) String keyword, | |
190 | - @RequestParam(value = "rolesId", required = false) Integer rolesId, | |
191 | - @RequestParam(value = "page", required = false) Integer page, | |
192 | - @RequestParam(value = "limit", required = false) Integer limit, | |
193 | - @RequestParam(value = "orgId", required = false) Integer orgId, | |
194 | - @RequestParam(value = "deptId", required = false) Integer deptId) { | |
194 | + @RequestParam(value = "keyword", required = false) String keyword, | |
195 | + @RequestParam(value = "rolesId", required = false) Integer rolesId, | |
196 | + @RequestParam(value = "page", required = false) Integer page, | |
197 | + @RequestParam(value = "limit", required = false) Integer limit, | |
198 | + @RequestParam(value = "orgId", required = false) Integer orgId, | |
199 | + @RequestParam(value = "deptId", required = false) Integer deptId) { | |
195 | 200 | LoginContext loginContext = (LoginContext) request.getAttribute("loginContext"); |
196 | 201 | Users u = usersService.getUsers(loginContext.getId()); |
197 | 202 | |
198 | 203 | |
199 | 204 | List<Integer> ids = null; |
200 | - if(u.getType().equals(UserTypeEnum.NORMAL_USER.getId())) { | |
201 | - if(null != u.getOrgId()) { | |
205 | + if (u.getType().equals(UserTypeEnum.NORMAL_USER.getId())) { | |
206 | + if (null != u.getOrgId()) { | |
202 | 207 | orgId = u.getOrgId(); |
203 | 208 | } else { |
204 | 209 | FrontEndResult frontEndResult = new FrontEndResult(); |
205 | - frontEndResult.setPageInfo(new PageInfo(0,0,0,10)); | |
210 | + frontEndResult.setPageInfo(new PageInfo(0, 0, 0, 10)); | |
206 | 211 | frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
207 | - return frontEndResult; | |
212 | + return frontEndResult; | |
208 | 213 | } |
209 | - }else if(u.getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId())) { | |
214 | + } else if (u.getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId())) { | |
210 | 215 | List<Organization> organizations = accessPermissionFacade.getOrganization(accessPermissionFacade.findAccessPerminssionByUserId(u.getId())); |
211 | 216 | ids = new ArrayList<>(); |
212 | - if(CollectionUtils.isNotEmpty(organizations)) { | |
213 | - for(Organization organization : organizations) { | |
217 | + if (CollectionUtils.isNotEmpty(organizations)) { | |
218 | + for (Organization organization : organizations) { | |
214 | 219 | ids.add(organization.getId()); |
215 | 220 | } |
216 | 221 | } else { |
217 | 222 | FrontEndResult frontEndResult = new FrontEndResult(); |
218 | - frontEndResult.setPageInfo(new PageInfo(0,0,0,10)); | |
223 | + frontEndResult.setPageInfo(new PageInfo(0, 0, 0, 10)); | |
219 | 224 | frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
220 | - return frontEndResult; | |
225 | + return frontEndResult; | |
221 | 226 | } |
222 | 227 | } |
223 | 228 | |
224 | - if(null != orgId) { | |
229 | + if (null != orgId) { | |
225 | 230 | ids = new ArrayList<>(); |
226 | 231 | ids.add(orgId); |
227 | 232 | } |
... | ... | @@ -245,7 +250,7 @@ |
245 | 250 | List<Users> users = usersService.queryUsers2(usersQuery); |
246 | 251 | List<Organization> organizations = null; |
247 | 252 | //设置用户角色信息 |
248 | - for(Users user : users) { | |
253 | + for (Users user : users) { | |
249 | 254 | organizations = new ArrayList<>(); |
250 | 255 | Organization organization = organizationService.getOrganization(user.getOrgId()); |
251 | 256 | user.setOrganization(organization); |
... | ... | @@ -254,7 +259,7 @@ |
254 | 259 | |
255 | 260 | user.setRoles(this.getUserRoles(user.getId())); |
256 | 261 | user.setDepartmentses(departmentsService.getDepartments(user.getDeptId())); |
257 | - if(null!=user.getZhiChenId()){ | |
262 | + if (null != user.getZhiChenId()) { | |
258 | 263 | user.setZhiChen(ZhiChenEnums.getById(user.getZhiChenId())); |
259 | 264 | } |
260 | 265 | List<DataPermissionsModel> permissionsModelList = accessPermissionFacade.findAccessPerminssionByUserId(user.getId()); |
261 | 266 | |
... | ... | @@ -276,13 +281,13 @@ |
276 | 281 | } |
277 | 282 | |
278 | 283 | //获取用户角色信息 |
279 | - private List<Roles> getUserRoles(Integer userId) { | |
284 | + private List<Roles> getUserRoles(Integer userId) { | |
280 | 285 | UserRoleMapsQuery query = new UserRoleMapsQuery(); |
281 | 286 | query.setUserId(userId); |
282 | 287 | query.setYn(YnEnums.YES.getId()); |
283 | 288 | List<UserRoleMaps> userRoleMapses = userRoleMapsService.queryUserRoleMaps(query); |
284 | 289 | List<Roles> roles = new ArrayList<>(); |
285 | - for(UserRoleMaps roleMaps : userRoleMapses) { | |
290 | + for (UserRoleMaps roleMaps : userRoleMapses) { | |
286 | 291 | roles.add(rolesService.getRoles(roleMaps.getRoleId())); |
287 | 292 | } |
288 | 293 | return roles; |
289 | 294 | |
290 | 295 | |
291 | 296 | |
292 | 297 | |
293 | 298 | |
294 | 299 | |
... | ... | @@ -309,37 +314,37 @@ |
309 | 314 | //code 不为空使用手机登录, password不为空时使用帐号登录 |
310 | 315 | UsersQuery usersQuery = new UsersQuery(); |
311 | 316 | usersQuery.setYn(YnEnums.YES.getId()); |
312 | - if(null != code) { | |
317 | + if (null != code) { | |
313 | 318 | usersQuery.setPhone(account); |
314 | 319 | } |
315 | - if(null != password) { | |
320 | + if (null != password) { | |
316 | 321 | usersQuery.setAccount(account); |
317 | 322 | } |
318 | 323 | List<Users> users = usersService.queryUsers(usersQuery); |
319 | - if(0 == users.size()) { | |
324 | + if (0 == users.size()) { | |
320 | 325 | ResultUtils.buildParameterErrorResultAndWrite(response, "该账户不存在"); |
321 | 326 | return; |
322 | 327 | } |
323 | 328 | |
324 | 329 | Users u = users.get(0); |
325 | - if(!u.getEnable().equals(1)) { | |
330 | + if (!u.getEnable().equals(1)) { | |
326 | 331 | ResultUtils.buildParameterErrorResultAndWrite(response, "该账户已被禁用"); |
327 | 332 | return; |
328 | 333 | } |
329 | - if(null!=u.getOrgId()){ | |
334 | + if (null != u.getOrgId()) { | |
330 | 335 | Organization organization = organizationService.getOrganization(u.getOrgId()); |
331 | - if(null!=organization){ | |
332 | - if(null!=organization.getStatus() && HospitalStatusEnums.TZYX.getId()==organization.getStatus()){ | |
333 | - ResultUtils.buildParameterErrorResultAndWrite(response, "该账户已被禁用"); | |
334 | - return; | |
335 | - } | |
336 | + if (null != organization) { | |
337 | + if (null != organization.getStatus() && HospitalStatusEnums.TZYX.getId() == organization.getStatus()) { | |
338 | + ResultUtils.buildParameterErrorResultAndWrite(response, "该账户已被禁用"); | |
339 | + return; | |
340 | + } | |
336 | 341 | } |
337 | 342 | } |
338 | 343 | |
339 | 344 | |
340 | 345 | LoginContext loginContext = new LoginContext(); |
341 | 346 | loginContext.setErrormsg("服务器内部错误!"); |
342 | - loginContext= iSessionProvider.login(account,password,code); | |
347 | + loginContext = iSessionProvider.login(account, password, code); | |
343 | 348 | /* if(null != code) { |
344 | 349 | loginContext =LoginUtil.loginByPhone(account, code, typeId, token); |
345 | 350 | } |
... | ... | @@ -347,7 +352,7 @@ |
347 | 352 | loginContext = LoginUtil.loginByAccount(account, password, typeId, token); |
348 | 353 | }*/ |
349 | 354 | |
350 | - if(null != loginContext && loginContext.getErrorcode().equals(0)) { | |
355 | + if (null != loginContext && loginContext.getErrorcode().equals(0)) { | |
351 | 356 | if (u.getLastLoginTime() != null) { |
352 | 357 | Users users1 = new Users(); |
353 | 358 | users1.setId(u.getId()); |
... | ... | @@ -358,7 +363,7 @@ |
358 | 363 | Map<String, Object> result = new HashMap<>(); |
359 | 364 | result.put("token", loginContext.getToken()); |
360 | 365 | ResultUtils.buildSuccessResultAndWrite(response, result); |
361 | - }else { | |
366 | + } else { | |
362 | 367 | ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.PARAMETER_ERROR, loginContext.getErrormsg()); |
363 | 368 | } |
364 | 369 | } |
... | ... | @@ -376,7 +381,7 @@ |
376 | 381 | ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse); |
377 | 382 | return; |
378 | 383 | } |
379 | - if(!phone.matches("^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$")) { | |
384 | + if (!phone.matches("^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$")) { | |
380 | 385 | ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse, "手机号不正确!"); |
381 | 386 | return; |
382 | 387 | } |
383 | 388 | |
384 | 389 | |
... | ... | @@ -385,18 +390,18 @@ |
385 | 390 | usersQuery.setPhone(phone); |
386 | 391 | usersQuery.setYn(YnEnums.YES.getId()); |
387 | 392 | List<Users> list = usersService.queryUsers(usersQuery); |
388 | - if(null == list || 0 == list.size()) { | |
393 | + if (null == list || 0 == list.size()) { | |
389 | 394 | ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse, "该账户不存在"); |
390 | 395 | return; |
391 | 396 | } |
392 | 397 | |
393 | - if(!list.get(0).getEnable().equals(1)) { | |
398 | + if (!list.get(0).getEnable().equals(1)) { | |
394 | 399 | ResultUtils.buildParameterErrorResultAndWrite(httpServletResponse, "该账户已被禁用"); |
395 | 400 | return; |
396 | 401 | } |
397 | 402 | |
398 | 403 | LoginContext loginContext = LoginUtil.sendVerCode(phone, typeId, token); |
399 | - if(null != loginContext) { | |
404 | + if (null != loginContext) { | |
400 | 405 | ResultUtils.buildResultAndWrite(httpServletResponse, loginContext.getErrorcode(), loginContext.getErrormsg()); |
401 | 406 | return; |
402 | 407 | } |
403 | 408 | |
... | ... | @@ -413,14 +418,14 @@ |
413 | 418 | public void usersLoginMsg(HttpServletResponse response, HttpServletRequest request) { |
414 | 419 | LoginContext loginContext = (LoginContext) request.getAttribute("loginContext"); |
415 | 420 | Users users = null; |
416 | - if(null != loginContext) { | |
421 | + if (null != loginContext) { | |
417 | 422 | users = usersService.getUsers(loginContext.getId()); |
418 | 423 | } |
419 | 424 | |
420 | 425 | List<Permissions2> permissions = null; |
421 | 426 | List<Roles> roles = new ArrayList<>(); |
422 | 427 | //超级管理员拥有所有角色和权限 |
423 | - if(users.getType().equals(UserTypeEnum.SUPPER_ADMIN.getId())) { | |
428 | + if (users.getType().equals(UserTypeEnum.SUPPER_ADMIN.getId())) { | |
424 | 429 | RolesQuery rolesQuery = new RolesQuery(); |
425 | 430 | rolesQuery.setYn(YnEnums.YES.getId()); |
426 | 431 | roles = rolesService.queryRoles(rolesQuery); |
427 | 432 | |
428 | 433 | |
429 | 434 | |
430 | 435 | |
... | ... | @@ -432,41 +437,28 @@ |
432 | 437 | |
433 | 438 | } |
434 | 439 | //其他用户 |
435 | - else if(users.getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId()) || users.getType().equals(UserTypeEnum.NORMAL_USER.getId())){ | |
440 | + else if (users.getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId()) || users.getType().equals(UserTypeEnum.NORMAL_USER.getId())) { | |
436 | 441 | //获取用户角色信息 |
437 | 442 | UserRoleMapsQuery query = new UserRoleMapsQuery(); |
438 | 443 | query.setUserId(users.getId()); |
439 | 444 | query.setYn(YnEnums.YES.getId()); |
440 | 445 | List<Integer> userRoleMapses = userRoleMapsService.queryUserRoleList(query); |
441 | - RolePermissionMapsQuery rolePermissionMapsQuery ; | |
446 | + | |
442 | 447 | List<Integer> permissionIds = new ArrayList<>(); |
443 | - permissions = new ArrayList<>(); | |
444 | - for(Integer roleMaps : userRoleMapses) { | |
445 | - roles.add(rolesService.getRoles(roleMaps)); | |
448 | + permissions = new ArrayList<>(); | |
449 | + String orgId = autoMatchFacade.getHospitalId(loginContext.getId()); | |
446 | 450 | |
447 | - //获取角色权限信息 | |
448 | - /* rolePermissionMapsQuery = new RolePermissionMapsQuery(); | |
449 | - rolePermissionMapsQuery.setRoleId(roleMaps); | |
450 | - rolePermissionMapsQuery.setYn(YnEnums.YES.getId()); | |
451 | - List<RolePermissionMaps> rolePermissionMapses = rolePermissionMapsService.queryRolePermissionMaps(rolePermissionMapsQuery); | |
452 | - | |
453 | - for(RolePermissionMaps rolePermissionMaps : rolePermissionMapses) { | |
454 | - Permissions permissions1 = permissionsService.getPermissions(rolePermissionMaps.getPermissionId()); | |
455 | - if(null != permissions1) { | |
456 | - if(null == permissions) { | |
457 | - permissions = new ArrayList<>(); | |
458 | - } | |
459 | - if(!permissionIds.contains(permissions1.getId())) { | |
460 | - permissions.add(permissions1); | |
461 | - permissionIds.add(permissions1.getId()); | |
462 | - } | |
463 | - } | |
464 | - }*/ | |
451 | + int rog = NumberUtils.toInt(orgId); | |
452 | + for (Integer roleMaps : userRoleMapses) { | |
453 | + Roles roles1 = rolesService.getRoles(roleMaps); | |
454 | + if (roles1 != null && StringUtils.isNotEmpty(orgId) && roles1.getOrgId() == rog) { | |
455 | + roles.add(roles1); | |
456 | + } | |
465 | 457 | } |
466 | 458 | List<Permissions2> local = permissions2Service.queryPermissionByRoleIds(userRoleMapses); |
467 | - if(CollectionUtils.isNotEmpty(local)){ | |
468 | - for(Permissions2 permissions1:local){ | |
469 | - if(!permissionIds.contains(permissions1.getId())) { | |
459 | + if (CollectionUtils.isNotEmpty(local)) { | |
460 | + for (Permissions2 permissions1 : local) { | |
461 | + if (!permissionIds.contains(permissions1.getId())) { | |
470 | 462 | permissionIds.add(permissions1.getId()); |
471 | 463 | permissions.add(permissions1); |
472 | 464 | } |
... | ... | @@ -487,9 +479,9 @@ |
487 | 479 | Organization organization = organizationService.getOrganization(users.getOrgId()); |
488 | 480 | organizations.add(organization); |
489 | 481 | users.setOrganization(organization); |
490 | - List<Organization> list2 = accessPermissionFacade.getOrganization(permissionsModelList); | |
491 | - if(CollectionUtils.isNotEmpty(list2)){ | |
492 | - for(Organization o:list2){ | |
482 | + List<Organization> list2 = accessPermissionFacade.getOrganization(permissionsModelList); | |
483 | + if (CollectionUtils.isNotEmpty(list2)) { | |
484 | + for (Organization o : list2) { | |
493 | 485 | organizations.add(o); |
494 | 486 | } |
495 | 487 | } |
... | ... | @@ -498,7 +490,7 @@ |
498 | 490 | |
499 | 491 | Map<String, Object> map = new HashMap<>(); |
500 | 492 | map.put("user", users); |
501 | - map.put("watermark", CompressEncodeingUtil.compressNumber(users.getId().toString()+DateUtil.getymd6())); | |
493 | + map.put("watermark", CompressEncodeingUtil.compressNumber(users.getId().toString() + DateUtil.getymd6())); | |
502 | 494 | map.put("roles", roles); |
503 | 495 | map.put("permissions", permissions); |
504 | 496 | |
505 | 497 | |
... | ... | @@ -511,12 +503,12 @@ |
511 | 503 | @RequestMapping(value = "/users/userRole/{id}", method = RequestMethod.GET) |
512 | 504 | @TokenRequired |
513 | 505 | public void userRole(HttpServletResponse response, HttpServletRequest request, @PathVariable(value = "id") Integer id) { |
514 | - UserRoleMapsQuery query = new UserRoleMapsQuery(); | |
506 | + UserRoleMapsQuery query = new UserRoleMapsQuery(); | |
515 | 507 | query.setUserId(id); |
516 | 508 | query.setYn(YnEnums.YES.getId()); |
517 | 509 | List<UserRoleMaps> userRoleMapses = userRoleMapsService.queryUserRoleMaps(query); |
518 | 510 | List<Roles> roles = new ArrayList<>(); |
519 | - for(UserRoleMaps roleMaps : userRoleMapses) { | |
511 | + for (UserRoleMaps roleMaps : userRoleMapses) { | |
520 | 512 | roles.add(rolesService.getRoles(roleMaps.getRoleId())); |
521 | 513 | } |
522 | 514 | |
523 | 515 | |
... | ... | @@ -524,13 +516,12 @@ |
524 | 516 | } |
525 | 517 | |
526 | 518 | |
527 | - | |
528 | 519 | /** |
529 | 520 | * 管理员权限设置 |
530 | 521 | */ |
531 | 522 | @RequestMapping(value = "/adminPermissions", method = RequestMethod.POST) |
532 | 523 | @TokenRequired |
533 | - public void adminPermissions(HttpServletResponse response,@RequestParam(value = "userId") Integer userId, @RequestParam(value = "ids") String ids){ | |
524 | + public void adminPermissions(HttpServletResponse response, @RequestParam(value = "userId") Integer userId, @RequestParam(value = "ids") String ids) { | |
534 | 525 | |
535 | 526 | if (ids == null) { |
536 | 527 | ResultUtils.buildParameterErrorResultAndWrite(response); |
... | ... | @@ -549,7 +540,7 @@ |
549 | 540 | return; |
550 | 541 | } |
551 | 542 | |
552 | - if(!usersList.get(0).getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId())) { | |
543 | + if (!usersList.get(0).getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId())) { | |
553 | 544 | ResultUtils.buildParameterErrorResultAndWrite(response, "用户错误"); |
554 | 545 | return; |
555 | 546 | } |
... | ... | @@ -558,8 +549,8 @@ |
558 | 549 | UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); |
559 | 550 | userOrganizationMapsQuery.setUserId(userId); |
560 | 551 | List<UserOrganizationMaps> userOrganizationMapsList = userOrganizationMapsService.queryUserOrganizationMaps(userOrganizationMapsQuery); |
561 | - if(0 < userOrganizationMapsList.size()) { | |
562 | - for(UserOrganizationMaps userOrganizationMaps : userOrganizationMapsList) { | |
552 | + if (0 < userOrganizationMapsList.size()) { | |
553 | + for (UserOrganizationMaps userOrganizationMaps : userOrganizationMapsList) { | |
563 | 554 | userOrganizationMaps.setYn(YnEnums.NO.getId()); |
564 | 555 | userOrganizationMapsService.updateUserOrganizationMaps(userOrganizationMaps); |
565 | 556 | } |
566 | 557 | |
... | ... | @@ -567,12 +558,12 @@ |
567 | 558 | |
568 | 559 | //添加最新权限映射 |
569 | 560 | String[] roleArrayIds = ids.split(","); |
570 | - Users user = usersList.get(0); | |
561 | + Users user = usersList.get(0); | |
571 | 562 | UserOrganizationMaps userOrganizationMaps = null; |
572 | 563 | Organization organization = null; |
573 | 564 | for (String id : roleArrayIds) { |
574 | 565 | organization = organizationService.getOrganization(Integer.valueOf(id)); |
575 | - if(null != organization) { | |
566 | + if (null != organization) { | |
576 | 567 | userOrganizationMaps = new UserOrganizationMaps(); |
577 | 568 | userOrganizationMaps.setUserId(user.getId()); |
578 | 569 | userOrganizationMaps.setOrgId(Integer.valueOf(id)); |
... | ... | @@ -591,7 +582,7 @@ |
591 | 582 | |
592 | 583 | |
593 | 584 | private Boolean isPhone(String phone) { |
594 | - return phone.matches("^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$"); | |
585 | + return phone.matches("^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$"); | |
595 | 586 | } |
596 | 587 | |
597 | 588 | /** |
... | ... | @@ -602,7 +593,7 @@ |
602 | 593 | public void addAdmin(HttpServletResponse response, |
603 | 594 | HttpServletRequest request, |
604 | 595 | @RequestParam(value = "name", required = false) String name, |
605 | - @RequestParam(value = "account", required = false)String account, | |
596 | + @RequestParam(value = "account", required = false) String account, | |
606 | 597 | @RequestParam(value = "phone") String phone, |
607 | 598 | @RequestParam(value = "enable", required = false) Integer enable, |
608 | 599 | @RequestParam(value = "remarks", required = false) String remarks, |
... | ... | @@ -615,7 +606,7 @@ |
615 | 606 | |
616 | 607 | |
617 | 608 | if (StringUtils.isBlank(roleIds) || |
618 | - StringUtils.isBlank(name) || StringUtils.isBlank(phone) || null == user ) { | |
609 | + StringUtils.isBlank(name) || StringUtils.isBlank(phone) || null == user) { | |
619 | 610 | ResultUtils.buildParameterErrorResultAndWrite(response); |
620 | 611 | return; |
621 | 612 | } |
622 | 613 | |
... | ... | @@ -669,9 +660,9 @@ |
669 | 660 | //关联登录中心ID |
670 | 661 | LoginContext loginContext = null; |
671 | 662 | // loginContext = LoginUtil.register(null, phone, null, null, token, typeId); |
672 | - loginContext = iSessionProvider.register(null,phone,null,null); | |
663 | + loginContext = iSessionProvider.register(null, phone, null, null); | |
673 | 664 | //0 成功 4009 已注册 |
674 | - if(loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
665 | + if (loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
675 | 666 | users.setLogincenterId(loginContext.getId()); |
676 | 667 | usersService.addUsers(users); |
677 | 668 | |
... | ... | @@ -680,7 +671,7 @@ |
680 | 671 | |
681 | 672 | |
682 | 673 | String[] roleArrayIds = roleIds.split(","); |
683 | - List<Users> user1 = usersService.queryUsers(usersQuery); | |
674 | + List<Users> user1 = usersService.queryUsers(usersQuery); | |
684 | 675 | for (String id : roleArrayIds) { |
685 | 676 | Roles roles = rolesService.getRoles(Integer.valueOf(id)); |
686 | 677 | if (roles == null || roles.getYn() == YnEnums.NO.getId()) { |
687 | 678 | |
... | ... | @@ -716,13 +707,13 @@ |
716 | 707 | @RequestParam(value = "deptId", required = false) Integer deptId, |
717 | 708 | @RequestParam(value = "ksId", required = false) Integer ksId, |
718 | 709 | @RequestParam(value = "name", required = false) String name, |
719 | - @RequestParam(value = "account", required = false)String account, | |
710 | + @RequestParam(value = "account", required = false) String account, | |
720 | 711 | @RequestParam(value = "password", required = false) String password, |
721 | 712 | @RequestParam(value = "phone", required = false) String phone, |
722 | 713 | @RequestParam(value = "enable", required = false) Integer enable, |
723 | 714 | @RequestParam(value = "remarks", required = false) String remarks, |
724 | 715 | @RequestParam(value = "roleIds") String roleIds, |
725 | - @RequestParam(value = "zhiCId")Integer zhiCId) { | |
716 | + @RequestParam(value = "zhiCId") Integer zhiCId) { | |
726 | 717 | |
727 | 718 | |
728 | 719 | //获取登录用户 |
729 | 720 | |
730 | 721 | |
731 | 722 | |
... | ... | @@ -730,19 +721,19 @@ |
730 | 721 | Users user = usersService.getUsers(loginState.getId()); |
731 | 722 | |
732 | 723 | |
733 | - if (StringUtils.isBlank(roleIds) || null == user|| (StringUtils.isBlank(account) && StringUtils.isBlank(phone))) { | |
724 | + if (StringUtils.isBlank(roleIds) || null == user || (StringUtils.isBlank(account) && StringUtils.isBlank(phone))) { | |
734 | 725 | ResultUtils.buildParameterErrorResultAndWrite(response); |
735 | 726 | return; |
736 | 727 | } |
737 | 728 | |
738 | - if( StringUtils.isNotBlank(phone) && !isPhone(phone)) { | |
729 | + if (StringUtils.isNotBlank(phone) && !isPhone(phone)) { | |
739 | 730 | ResultUtils.buildParameterErrorResultAndWrite(response, "手机号格式不正确"); |
740 | 731 | return; |
741 | - } else if(StringUtils.isNotBlank(account) && StringUtils.isBlank(password)) { | |
732 | + } else if (StringUtils.isNotBlank(account) && StringUtils.isBlank(password)) { | |
742 | 733 | password = defaultPwd; |
743 | 734 | } |
744 | 735 | |
745 | - if(deptId == null && ksId == null) { | |
736 | + if (deptId == null && ksId == null) { | |
746 | 737 | ResultUtils.buildParameterErrorResultAndWrite(response, "deptId or ksId required"); |
747 | 738 | return; |
748 | 739 | } |
... | ... | @@ -757,7 +748,7 @@ |
757 | 748 | }*/ |
758 | 749 | if (user != null) { |
759 | 750 | UsersQuery usersQuery = new UsersQuery(); |
760 | - if(StringUtils.isNotBlank(phone)) { | |
751 | + if (StringUtils.isNotBlank(phone)) { | |
761 | 752 | //检查注册账户是否存在 |
762 | 753 | usersQuery.setPhone(phone); |
763 | 754 | usersQuery.setYn(YnEnums.YES.getId()); |
764 | 755 | |
... | ... | @@ -771,11 +762,11 @@ |
771 | 762 | } |
772 | 763 | } |
773 | 764 | |
774 | - if(StringUtils.isNotBlank(account)) { | |
765 | + if (StringUtils.isNotBlank(account)) { | |
775 | 766 | usersQuery = new UsersQuery(); |
776 | 767 | usersQuery.setAccount(account); |
777 | 768 | usersQuery.setYn(YnEnums.YES.getId()); |
778 | - if(0 != usersService.queryUsersCount(usersQuery)) { | |
769 | + if (0 != usersService.queryUsersCount(usersQuery)) { | |
779 | 770 | Map<String, Object> map = new HashMap<>(); |
780 | 771 | map.put(ResultUtils.ERROR_CODE, ConstantInterface.PARAMETER_ERROR); |
781 | 772 | map.put(ResultUtils.ERROR_MSG, "该账户已存在"); |
782 | 773 | |
783 | 774 | |
784 | 775 | |
... | ... | @@ -810,24 +801,25 @@ |
810 | 801 | loginContext.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
811 | 802 | loginContext.setErrormsg("系统错误"); |
812 | 803 | //关联登录中心ID |
813 | - if(StringUtils.isNotBlank(phone) || StringUtils.isNotBlank(account)) { | |
814 | - /**/ String pwd = null; | |
815 | - if(StringUtils.isNotBlank(password)) { | |
804 | + if (StringUtils.isNotBlank(phone) || StringUtils.isNotBlank(account)) { | |
805 | + /**/ | |
806 | + String pwd = null; | |
807 | + if (StringUtils.isNotBlank(password)) { | |
816 | 808 | pwd = MD5Utils.md5(password).toUpperCase(); |
817 | 809 | } |
818 | 810 | // loginContext = LoginUtil.register(null, phone,account, pwd, token, typeId); |
819 | - loginContext= iSessionProvider.register(null,phone,account, pwd); | |
811 | + loginContext = iSessionProvider.register(null, phone, account, pwd); | |
820 | 812 | } |
821 | 813 | |
822 | 814 | //0 成功 4009 已注册 |
823 | - if(loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
815 | + if (loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
824 | 816 | users.setLogincenterId(loginContext.getId()); |
825 | 817 | usersService.addUsers(users); |
826 | 818 | |
827 | 819 | //如有角色,则对用户角色中间表新增 |
828 | 820 | |
829 | 821 | String[] roleArrayIds = roleIds.split(","); |
830 | - List<Users> user1 = usersService.queryUsers(usersQuery); | |
822 | + List<Users> user1 = usersService.queryUsers(usersQuery); | |
831 | 823 | for (String id : roleArrayIds) { |
832 | 824 | Roles roles = rolesService.getRoles(Integer.valueOf(id)); |
833 | 825 | if (roles == null || roles.getYn() == YnEnums.NO.getId()) { |
834 | 826 | |
835 | 827 | |
836 | 828 | |
... | ... | @@ -858,28 +850,28 @@ |
858 | 850 | public void updateUsers(HttpServletResponse response, |
859 | 851 | HttpServletRequest request, |
860 | 852 | @PathVariable(value = "id") Integer id, |
861 | - @RequestParam(value = "name",required = false) String name, | |
862 | - @RequestParam(value = "account",required = false)String account, | |
863 | - @RequestParam(value = "password",required = false)String password, | |
864 | - @RequestParam(value = "phone",required = false) String phone, | |
865 | - @RequestParam(value = "enable",required = false) Integer enable, | |
866 | - @RequestParam(value = "remarks",required = false) String remarks, | |
867 | - @RequestParam(value = "roleIds",required = false) String roleIds, | |
868 | - @RequestParam(value = "orgId",required = false) Integer orgId, | |
869 | - @RequestParam(value = "deptId",required = false) Integer deptId, | |
870 | - @RequestParam(value = "zhiCId")Integer zhiCId) { | |
853 | + @RequestParam(value = "name", required = false) String name, | |
854 | + @RequestParam(value = "account", required = false) String account, | |
855 | + @RequestParam(value = "password", required = false) String password, | |
856 | + @RequestParam(value = "phone", required = false) String phone, | |
857 | + @RequestParam(value = "enable", required = false) Integer enable, | |
858 | + @RequestParam(value = "remarks", required = false) String remarks, | |
859 | + @RequestParam(value = "roleIds", required = false) String roleIds, | |
860 | + @RequestParam(value = "orgId", required = false) Integer orgId, | |
861 | + @RequestParam(value = "deptId", required = false) Integer deptId, | |
862 | + @RequestParam(value = "zhiCId") Integer zhiCId) { | |
871 | 863 | |
872 | - if(StringUtils.isBlank(phone) && StringUtils.isBlank(account)) { | |
864 | + if (StringUtils.isBlank(phone) && StringUtils.isBlank(account)) { | |
873 | 865 | ResultUtils.buildParameterErrorResultAndWrite(response, "帐号和手机号不能同时为空"); |
874 | 866 | return; |
875 | 867 | } |
876 | 868 | |
877 | - if(null == roleIds) { | |
869 | + if (null == roleIds) { | |
878 | 870 | ResultUtils.buildParameterErrorResultAndWrite(response, "roleIds不能为空"); |
879 | 871 | return; |
880 | 872 | } |
881 | 873 | |
882 | - if(!(null != enable && (1 == enable || 2 == enable))) { | |
874 | + if (!(null != enable && (1 == enable || 2 == enable))) { | |
883 | 875 | ResultUtils.buildParameterErrorResultAndWrite(response, "enable参数错误"); |
884 | 876 | return; |
885 | 877 | } |
886 | 878 | |
... | ... | @@ -890,10 +882,10 @@ |
890 | 882 | if (user != null) { |
891 | 883 | |
892 | 884 | Users users = usersService.getUsers(id); |
893 | - if(null!=users.getOtherAccount()&&"1".equals(user.getOtherAccount()+"")){ | |
885 | + if (null != users.getOtherAccount() && "1".equals(user.getOtherAccount() + "")) { | |
894 | 886 | return; |
895 | 887 | } |
896 | - if(StringUtils.isNotBlank(password) && password.equals(replacePwd)) { | |
888 | + if (StringUtils.isNotBlank(password) && password.equals(replacePwd)) { | |
897 | 889 | password = users.getPwd(); |
898 | 890 | } |
899 | 891 | |
... | ... | @@ -906,7 +898,7 @@ |
906 | 898 | writeJson(response, JsonUtil.obj2JsonString(map)); |
907 | 899 | return; |
908 | 900 | }*/ |
909 | - if(null == users) { | |
901 | + if (null == users) { | |
910 | 902 | Map<String, Object> map = new HashMap<>(); |
911 | 903 | map.put(ResultUtils.ERROR_CODE, ConstantInterface.PARAMETER_ERROR); |
912 | 904 | map.put(ResultUtils.ERROR_MSG, "用户不存在"); |
913 | 905 | |
... | ... | @@ -916,11 +908,11 @@ |
916 | 908 | |
917 | 909 | |
918 | 910 | //修改了手机号, 帐号 密码 |
919 | - if(!new Integer(1).equals(users.getOtherAccount())) { | |
920 | - if((StringUtils.isNotBlank(account) && !account.equals(users.getAccount())) || (StringUtils.isNotBlank(phone) && !phone.equals(users.getPhone())) || (StringUtils.isNotBlank(password) && !password.equals(users.getPwd()))) { | |
911 | + if (!new Integer(1).equals(users.getOtherAccount())) { | |
912 | + if ((StringUtils.isNotBlank(account) && !account.equals(users.getAccount())) || (StringUtils.isNotBlank(phone) && !phone.equals(users.getPhone())) || (StringUtils.isNotBlank(password) && !password.equals(users.getPwd()))) { | |
921 | 913 | UsersQuery usersQuery = new UsersQuery(); |
922 | 914 | List<Users> usersList; |
923 | - if(StringUtils.isNotBlank(phone) && !phone.equals(users.getPhone())) { | |
915 | + if (StringUtils.isNotBlank(phone) && !phone.equals(users.getPhone())) { | |
924 | 916 | //检查手机号是否存在 |
925 | 917 | usersQuery.setPhone(phone); |
926 | 918 | usersQuery.setYn(YnEnums.YES.getId()); |
... | ... | @@ -934,7 +926,7 @@ |
934 | 926 | } |
935 | 927 | } |
936 | 928 | |
937 | - if(StringUtils.isNotBlank(account) && !account.equals(users.getAccount())) { | |
929 | + if (StringUtils.isNotBlank(account) && !account.equals(users.getAccount())) { | |
938 | 930 | //检查账户是否存在 |
939 | 931 | usersQuery = new UsersQuery(); |
940 | 932 | usersQuery.setAccount(account); |
941 | 933 | |
942 | 934 | |
... | ... | @@ -950,11 +942,10 @@ |
950 | 942 | } |
951 | 943 | |
952 | 944 | |
953 | - | |
954 | 945 | // LoginContext loginContext = LoginUtil.register(users.getLogincenterId().toString(), phone, account, MD5Utils.md5(password).toUpperCase(), token, typeId); |
955 | - LoginContext loginContext = iSessionProvider.register(users.getLogincenterId(), phone, account, StringUtils.isNotBlank(password) ? MD5Utils.md5(password).toUpperCase() : null); | |
946 | + LoginContext loginContext = iSessionProvider.register(users.getLogincenterId(), phone, account, StringUtils.isNotBlank(password) ? MD5Utils.md5(password).toUpperCase() : null); | |
956 | 947 | //0 成功 4009 已注册 |
957 | - if(loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
948 | + if (loginContext.getErrorcode().equals(0) || loginContext.getErrorcode().equals(4009)) { | |
958 | 949 | users.setPhone(phone); |
959 | 950 | users.setAccount(account); |
960 | 951 | users.setLogincenterId(loginContext.getId()); |
... | ... | @@ -979,7 +970,7 @@ |
979 | 970 | |
980 | 971 | |
981 | 972 | //如有角色,则对用户角色中间表先删除后新增 |
982 | - if(StringUtils.isNotBlank(roleIds)) { | |
973 | + if (StringUtils.isNotBlank(roleIds)) { | |
983 | 974 | |
984 | 975 | UserRoleMapsQuery userRoleMapsQuery = new UserRoleMapsQuery(); |
985 | 976 | userRoleMapsQuery.setUserId(users.getId()); |
986 | 977 | |
987 | 978 | |
988 | 979 | |
... | ... | @@ -990,23 +981,24 @@ |
990 | 981 | String[] roleArrayIds = roleIds.split(","); |
991 | 982 | //判断角色是否有更新 |
992 | 983 | Boolean flag = false; |
993 | - if(CollectionUtils.isEmpty(userRoleMapses) || roleArrayIds.length != userRoleMapses.size()) flag = true; | |
994 | - if(!flag) { | |
984 | + if (CollectionUtils.isEmpty(userRoleMapses) || roleArrayIds.length != userRoleMapses.size()) | |
985 | + flag = true; | |
986 | + if (!flag) { | |
995 | 987 | for (String s : roleArrayIds) { |
996 | 988 | boolean exist = false; |
997 | - for(UserRoleMaps role : userRoleMapses) { | |
998 | - if(s.equals(role.getRoleId().toString())) { | |
989 | + for (UserRoleMaps role : userRoleMapses) { | |
990 | + if (s.equals(role.getRoleId().toString())) { | |
999 | 991 | exist = true; |
1000 | 992 | } |
1001 | 993 | } |
1002 | - if(!exist) { | |
994 | + if (!exist) { | |
1003 | 995 | flag = true; |
1004 | 996 | break; |
1005 | 997 | } |
1006 | 998 | } |
1007 | 999 | } |
1008 | 1000 | |
1009 | - if(flag) { | |
1001 | + if (flag) { | |
1010 | 1002 | Integer _userId = users.getId(); |
1011 | 1003 | userRoleMapsQuery = new UserRoleMapsQuery(); |
1012 | 1004 | userRoleMapsQuery.setUserId(_userId); |
... | ... | @@ -1018,7 +1010,7 @@ |
1018 | 1010 | |
1019 | 1011 | |
1020 | 1012 | for (String tmp : roleArrayIds) { |
1021 | - if(StringUtils.isEmpty(tmp)){ | |
1013 | + if (StringUtils.isEmpty(tmp)) { | |
1022 | 1014 | continue; |
1023 | 1015 | } |
1024 | 1016 | Roles roles = rolesService.getRoles(Integer.valueOf(tmp)); |
... | ... | @@ -1045,7 +1037,7 @@ |
1045 | 1037 | */ |
1046 | 1038 | @RequestMapping(value = "/users/enable", method = RequestMethod.POST) |
1047 | 1039 | @TokenRequired |
1048 | - public void enableUsers(HttpServletResponse response,@RequestParam Integer id, @RequestParam Integer flag) { | |
1040 | + public void enableUsers(HttpServletResponse response, @RequestParam Integer id, @RequestParam Integer flag) { | |
1049 | 1041 | |
1050 | 1042 | |
1051 | 1043 | //检查账户是否存在 |
... | ... | @@ -1059,10 +1051,10 @@ |
1059 | 1051 | writeJson(response, JsonUtil.obj2JsonString(map)); |
1060 | 1052 | return; |
1061 | 1053 | } |
1062 | - Users users =null; | |
1063 | - if(CollectionUtils.isNotEmpty(usersList)){ | |
1064 | - users =usersList.get(0); | |
1065 | - if(null!=users.getOtherAccount()&&"1".equals(users.getOtherAccount()+"")){ | |
1054 | + Users users = null; | |
1055 | + if (CollectionUtils.isNotEmpty(usersList)) { | |
1056 | + users = usersList.get(0); | |
1057 | + if (null != users.getOtherAccount() && "1".equals(users.getOtherAccount() + "")) { | |
1066 | 1058 | return; |
1067 | 1059 | } |
1068 | 1060 | } |
1069 | 1061 | |
... | ... | @@ -1076,14 +1068,12 @@ |
1076 | 1068 | } |
1077 | 1069 | |
1078 | 1070 | |
1079 | - | |
1080 | - | |
1081 | 1071 | /** |
1082 | 1072 | * 用户删除 |
1083 | 1073 | */ |
1084 | 1074 | @RequestMapping(value = "/users/{id}", method = RequestMethod.DELETE) |
1085 | 1075 | @TokenRequired |
1086 | - public void deleteUsers(HttpServletResponse response,@PathVariable Integer id) { | |
1076 | + public void deleteUsers(HttpServletResponse response, @PathVariable Integer id) { | |
1087 | 1077 | if (null == id) { |
1088 | 1078 | ResultUtils.buildIdIsNull(response); |
1089 | 1079 | return; |
... | ... | @@ -1125,9 +1115,6 @@ |
1125 | 1115 | } |
1126 | 1116 | |
1127 | 1117 | |
1128 | - | |
1129 | - | |
1130 | - | |
1131 | 1118 | /** |
1132 | 1119 | * 重置用户密码 |
1133 | 1120 | */ |
... | ... | @@ -1142,7 +1129,7 @@ |
1142 | 1129 | } |
1143 | 1130 | if (StringUtils.isNotBlank(pwd)) { |
1144 | 1131 | if (MD5Utils.md5(pwd).equals(users.getPwd())) { |
1145 | - ResultUtils.buildResultAndWrite(response,ErrorCodeConstants.USER_PASSWORD_ERROR, "新密码不能和初始密码相同"); | |
1132 | + ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.USER_PASSWORD_ERROR, "新密码不能和初始密码相同"); | |
1146 | 1133 | return; |
1147 | 1134 | } |
1148 | 1135 | users.setPwd(MD5Utils.md5(pwd)); |
1149 | 1136 | |
... | ... | @@ -1152,11 +1139,11 @@ |
1152 | 1139 | users.setModified(new Date()); |
1153 | 1140 | users.setLastLoginTime(users.getModified()); |
1154 | 1141 | usersService.updateUsers(users); |
1155 | - LoginContext loginContext = iSessionProvider.register(users.getLogincenterId(), users.getPhone(),users.getAccount(), users.getPwd().toUpperCase()); | |
1156 | - if(loginContext.getErrorcode().equals(0)) { | |
1142 | + LoginContext loginContext = iSessionProvider.register(users.getLogincenterId(), users.getPhone(), users.getAccount(), users.getPwd().toUpperCase()); | |
1143 | + if (loginContext.getErrorcode().equals(0)) { | |
1157 | 1144 | ResultUtils.buildSuccessResultAndWrite(response); |
1158 | 1145 | } else { |
1159 | - ResultUtils.buildResultAndWrite(response,ErrorCodeConstants.SYSTEM_ERROR, "系统错误"); | |
1146 | + ResultUtils.buildResultAndWrite(response, ErrorCodeConstants.SYSTEM_ERROR, "系统错误"); | |
1160 | 1147 | } |
1161 | 1148 | |
1162 | 1149 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
View file @
f10b186
... | ... | @@ -140,8 +140,8 @@ |
140 | 140 | archiveMap.put("sex", archiveModel.getSex()); |
141 | 141 | archiveMap.put("birthday", getBirthday(archiveModel.getBirthday())); |
142 | 142 | archiveMap.put("phone", archiveModel.getPhone()); |
143 | - archiveMap.put("residence", CommonsHelper.getResidence(archiveModel.getProvinceId(), archiveModel.getCityId(), | |
144 | - archiveModel.getAreaId(), archiveModel.getStreetId(), archiveModel.getAddress(), basicConfigService)); | |
143 | + archiveMap.put("residence", CommonsHelper.getResidence(archiveModel.getProvinceRegisterId(), archiveModel.getCityRegisterId(), | |
144 | + archiveModel.getAreaRegisterId(), archiveModel.getStreetRegisterId(), archiveModel.getAddressRegister(), basicConfigService)); | |
145 | 145 | archiveMap.put("workUnit", archiveModel.getWorkUnit()); |
146 | 146 | } |
147 | 147 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java
View file @
f10b186
... | ... | @@ -63,6 +63,20 @@ |
63 | 63 | //胎数 |
64 | 64 | private String tireNumber; |
65 | 65 | |
66 | + //建档号 | |
67 | + private String fileCode; | |
68 | + | |
69 | + public String getFileCode() { | |
70 | + if(null==fileCode){ | |
71 | + return SPIT; | |
72 | + } | |
73 | + return fileCode; | |
74 | + } | |
75 | + | |
76 | + public void setFileCode(String fileCode) { | |
77 | + this.fileCode = fileCode; | |
78 | + } | |
79 | + | |
66 | 80 | public String getTireNumber() { |
67 | 81 | if(StringUtils.isEmpty(tireNumber)){ |
68 | 82 | return SPIT; |
... | ... | @@ -285,7 +299,7 @@ |
285 | 299 | setName(destModel.getUsername()); |
286 | 300 | setRealPhone(destModel.getPhone()); |
287 | 301 | setPhone(StringUtils.encryPhone(destModel.getPhone())); |
288 | - | |
302 | + setFileCode(destModel.getFileCode()); | |
289 | 303 | if (null != destModel.getFmDate()) { |
290 | 304 | Integer dueStatus = destModel.getDueStatus(); |
291 | 305 | if(null==dueStatus){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java
View file @
f10b186
... | ... | @@ -70,7 +70,20 @@ |
70 | 70 | private String currentCh; |
71 | 71 | //建档时间 |
72 | 72 | private String bTime; |
73 | + //建档号 | |
74 | + private String fileCode; | |
73 | 75 | |
76 | + public String getFileCode() { | |
77 | + if(null==fileCode){ | |
78 | + return SPIT; | |
79 | + } | |
80 | + return fileCode; | |
81 | + } | |
82 | + | |
83 | + public void setFileCode(String fileCode) { | |
84 | + this.fileCode = fileCode; | |
85 | + } | |
86 | + | |
74 | 87 | public String getbTime() { |
75 | 88 | if(StringUtils.isEmpty(bTime)){ |
76 | 89 | return SPIT; |
... | ... | @@ -305,6 +318,7 @@ |
305 | 318 | if(null!=destModel.getDueDate()){ |
306 | 319 | setDueDate(DateUtil.getyyyy_MM_dd(destModel.getDueDate())); |
307 | 320 | } |
321 | + setFileCode(destModel.getFileCode()); | |
308 | 322 | setPid(destModel.getPid()); |
309 | 323 | setPhone(StringUtils.encryPhone(destModel.getPhone())); |
310 | 324 | setCheckDoctor(destModel.getLastReportDoctorName()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java
View file @
f10b186
... | ... | @@ -81,7 +81,19 @@ |
81 | 81 | private String currentCh; |
82 | 82 | //建档时间 |
83 | 83 | private String bTime; |
84 | + //建档号 | |
85 | + private String fileCode; | |
84 | 86 | |
87 | + public String getFileCode() { | |
88 | + if(null==fileCode){ | |
89 | + return SPIT; | |
90 | + } | |
91 | + return fileCode; | |
92 | + } | |
93 | + | |
94 | + public void setFileCode(String fileCode) { | |
95 | + this.fileCode = fileCode; | |
96 | + } | |
85 | 97 | public String getbTime() { |
86 | 98 | if(StringUtils.isEmpty(bTime)){ |
87 | 99 | return SPIT; |
... | ... | @@ -316,6 +328,7 @@ |
316 | 328 | if(null!=age){ |
317 | 329 | setAge(age+""); |
318 | 330 | } |
331 | + setFileCode(destModel.getFileCode()); | |
319 | 332 | setRealPhone(destModel.getPhone()); |
320 | 333 | // setrFactor(destModel.getRiskFactorId() == null ? "" : JsonUtil.array2JsonString(destModel.getRiskFactorId())); |
321 | 334 | sethScore(destModel.getRiskScore()); |