|
@@ -153,42 +153,24 @@ public class QualificationManageServiceImpl extends ServiceImpl<QualificationApp
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Object listQualificationApplyByDoctor(String userId)
|
|
|
- {
|
|
|
- //人员列表
|
|
|
- List<UserInfo> empList = userInfoRepository.list();
|
|
|
- Map<Long,UserInfo> empMap = empList.stream().collect(Collectors.toMap(UserInfo::getId, vo -> vo, (a, b) -> b));
|
|
|
-
|
|
|
+ public Object listQualificationApplyByDoctor(String userId){
|
|
|
List<QualificationApply> list = qualificationApplyRepository.listByQualification(null,userId);
|
|
|
- return geneQualificationList(empMap, list);
|
|
|
+ return geneQualificationStatus(list);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Object listQualificationApply(String qualificationCode){
|
|
|
-
|
|
|
- //人员列表
|
|
|
- List<UserInfo> empList = userInfoRepository.list();
|
|
|
- Map<Long,UserInfo> empMap = empList.stream().collect(Collectors.toMap(UserInfo::getId, vo -> vo, (a, b) -> b));
|
|
|
-
|
|
|
List<QualificationApply> list = qualificationApplyRepository.listByQualification(qualificationCode,null);
|
|
|
- return geneQualificationList(empMap, list);
|
|
|
+ return geneQualificationStatus(list);
|
|
|
}
|
|
|
|
|
|
- private Object geneQualificationList(Map<Long, UserInfo> empMap, List<QualificationApply> list) {
|
|
|
- for(QualificationApply qualificationApply : list){
|
|
|
- //医生信息
|
|
|
- qualificationApply.setUserInfo(empMap.get(qualificationApply.getUserId()));
|
|
|
-
|
|
|
- //调整历史
|
|
|
- //qualificationApply.setApplyAdjust(applyAdjustRepository.listByApplyId(qualificationApply.getId()));
|
|
|
-
|
|
|
- //设置「允许重新授权状态」,已过期的授权,如果没有对应的授权中的人时,才可以重新授权
|
|
|
- for(QualificationApply apply : list){
|
|
|
- if(apply.getCurrentStatus().equals("已过期")) {
|
|
|
- if(list.stream().filter(a -> a.getCurrentStatus().equals("授权中"))
|
|
|
- .noneMatch(a -> a.getUserId().equals(apply.getUserId()))) {
|
|
|
- apply.setAllowReAuthorize(NumberConstant.ONE);
|
|
|
- }
|
|
|
+ private Object geneQualificationStatus(List<QualificationApply> list) {
|
|
|
+ //设置「允许重新授权状态」,已过期的授权,如果没有对应的授权中的人时,才可以重新授权
|
|
|
+ for(QualificationApply apply : list){
|
|
|
+ if(apply.getCurrentStatus().equals("已过期")) {
|
|
|
+ if(list.stream().filter(a -> a.getCurrentStatus().equals("授权中"))
|
|
|
+ .noneMatch(a -> a.getUserId().equals(apply.getUserId()))) {
|
|
|
+ apply.setAllowReAuthorize(NumberConstant.ONE);
|
|
|
}
|
|
|
}
|
|
|
}
|