|
@@ -9,8 +9,6 @@ import com.kcim.controller.response.QualificationManageForDoctor;
|
|
|
import com.kcim.dao.mapper.QualificationApplyMapper;
|
|
|
import com.kcim.dao.model.*;
|
|
|
import com.kcim.dao.repository.*;
|
|
|
-import com.kcim.service.CenterService;
|
|
|
-import com.kcim.service.QualificationApplyService;
|
|
|
import com.kcim.service.QualificationManageService;
|
|
|
import com.kcim.service.QualificationService;
|
|
|
import com.kcim.util.BaseUtil;
|
|
@@ -36,6 +34,7 @@ public class QualificationManageServiceImpl extends ServiceImpl<QualificationApp
|
|
|
UserInfoRepository userInfoRepository;
|
|
|
DepartmentRepository departmentRepository;
|
|
|
DoctorAttachmentRepository doctorAttachmentRepository;
|
|
|
+ QualificationApplyAdjustRepository applyAdjustRepository;
|
|
|
|
|
|
QualificationService qualificationService;
|
|
|
|
|
@@ -61,12 +60,12 @@ public class QualificationManageServiceImpl extends ServiceImpl<QualificationApp
|
|
|
for(QualificationApply qualificationApply : list){
|
|
|
|
|
|
//医生信息
|
|
|
- qualificationApply.setUserInfo(empMap.get(qualificationApply.getUserId()));
|
|
|
+ //qualificationApply.setUserInfo(empMap.get(qualificationApply.getUserId()));
|
|
|
|
|
|
//调整历史-调整人姓名
|
|
|
- for(QualificationApplyAdjust adjust : qualificationApply.getApplyAdjust()){
|
|
|
- adjust.setAdjustUserName(empMap.get(adjust.getUserId()).getName());
|
|
|
- }
|
|
|
+// for(QualificationApplyAdjust adjust : qualificationApply.getApplyAdjust()){
|
|
|
+// adjust.setAdjustUserName(empMap.get(adjust.getUserId()).getName());
|
|
|
+// }
|
|
|
|
|
|
//资质字典
|
|
|
Qualification qualification = qualificationList.stream().filter(q -> q.getCode().equals(qualificationApply.getQualificationCode())).findFirst().get();
|
|
@@ -112,45 +111,93 @@ public class QualificationManageServiceImpl extends ServiceImpl<QualificationApp
|
|
|
//资质字典
|
|
|
newItem.setQualification(qualification);
|
|
|
//医生列表
|
|
|
- if(qualificationApply.getCurrentStatus().equals("授权中")){
|
|
|
- newItem.setDoctorList(qualificationApply.getUserInfo().getName());
|
|
|
- }
|
|
|
- else{
|
|
|
- newItem.setDoctorList(""); //新建时如果不是授权中状态,则给一个空字符串,避免出现null文本
|
|
|
- }
|
|
|
+// if(qualificationApply.getCurrentStatus().equals("授权中")){
|
|
|
+// newItem.setDoctorList(qualificationApply.getUserInfo().getName());
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// newItem.setDoctorList(""); //新建时如果不是授权中状态,则给一个空字符串,避免出现null文本
|
|
|
+// }
|
|
|
//申请列表
|
|
|
- List<QualificationApply> applyList = new ArrayList<>();
|
|
|
- applyList.add(qualificationApply);
|
|
|
- newItem.setApplyList(applyList);
|
|
|
+// List<QualificationApply> applyList = new ArrayList<>();
|
|
|
+// applyList.add(qualificationApply);
|
|
|
+// newItem.setApplyList(applyList);
|
|
|
|
|
|
listReturn.add(newItem);
|
|
|
}
|
|
|
//更新项
|
|
|
- else{
|
|
|
- //医生列表
|
|
|
- if(qualificationApply.getCurrentStatus().equals("授权中")){
|
|
|
- String newDoctorList = returnItem.get().getDoctorList() + "," + qualificationApply.getUserInfo().getName();
|
|
|
- newDoctorList = StringUtils.trimLeadingCharacter(newDoctorList,','); //去掉最左边的逗号
|
|
|
- returnItem.get().setDoctorList(newDoctorList);
|
|
|
- }
|
|
|
- //申请列表
|
|
|
- returnItem.get().getApplyList().add(qualificationApply);
|
|
|
- }
|
|
|
+// else{
|
|
|
+// //医生列表
|
|
|
+// if(qualificationApply.getCurrentStatus().equals("授权中")){
|
|
|
+// String newDoctorList = returnItem.get().getDoctorList() + "," + qualificationApply.getUserInfo().getName();
|
|
|
+// newDoctorList = StringUtils.trimLeadingCharacter(newDoctorList,','); //去掉最左边的逗号
|
|
|
+// returnItem.get().setDoctorList(newDoctorList);
|
|
|
+// }
|
|
|
+// //申请列表
|
|
|
+// returnItem.get().getApplyList().add(qualificationApply);
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
//设置「允许重新授权状态」,已过期的授权,如果没有对应的授权中的人时,才可以重新授权
|
|
|
- for(QualificationManage item : listReturn ){
|
|
|
- for(QualificationApply apply : item.getApplyList()){
|
|
|
+// for(QualificationManage item : listReturn ){
|
|
|
+// for(QualificationApply apply : item.getApplyList()){
|
|
|
+// if(apply.getCurrentStatus().equals("已过期")) {
|
|
|
+// if(item.getApplyList().stream().filter(a -> a.getCurrentStatus().equals("授权中"))
|
|
|
+// .noneMatch(a -> a.getUserId().equals(apply.getUserId()))) {
|
|
|
+// apply.setAllowReAuthorize(NumberConstant.ONE);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+ return new PageUtils(listReturn, Math.toIntExact(listReturn.size()),pageSize,current);
|
|
|
+ }
|
|
|
+
|
|
|
+ @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));
|
|
|
+
|
|
|
+ List<QualificationApply> list = qualificationApplyRepository.listByQualification(null,userId);
|
|
|
+ return geneQualificationList(empMap, 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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(QualificationApplyAdjust adjust : qualificationApply.getApplyAdjust()){
|
|
|
+ adjust.setAdjustUserName(empMap.get(adjust.getUserId()).getName());
|
|
|
+ }
|
|
|
+
|
|
|
+ //设置「允许重新授权状态」,已过期的授权,如果没有对应的授权中的人时,才可以重新授权
|
|
|
+ for(QualificationApply apply : list){
|
|
|
if(apply.getCurrentStatus().equals("已过期")) {
|
|
|
- if(item.getApplyList().stream().filter(a -> a.getCurrentStatus().equals("授权中"))
|
|
|
- .noneMatch(a -> a.getUserId().equals(apply.getUserId()))) {
|
|
|
+ if(list.stream().filter(a -> a.getCurrentStatus().equals("授权中"))
|
|
|
+ .noneMatch(a -> a.getUserId().equals(apply.getUserId()))) {
|
|
|
apply.setAllowReAuthorize(NumberConstant.ONE);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- return new PageUtils(listReturn, Math.toIntExact(listReturn.size()),pageSize,current);
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -404,6 +451,11 @@ public class QualificationManageServiceImpl extends ServiceImpl<QualificationApp
|
|
|
return qualificationApplyRepository.listMyAvailableQualification(qualificationName, operationLevelCode, techFlag, operationFlag, current, pageSize);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Object getMyQualificationHistory(String qualificationCode) {
|
|
|
+ return qualificationApplyRepository.getMyQualificationHistory(qualificationCode);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Object saveDoctorAttachment(DoctorAttachment doctorAttachments) {
|
|
|
doctorAttachments.setHospId(BaseUtil.getCurrentLoginHospId());
|