|
@@ -36,13 +36,16 @@ public class DoctorServiceImpl implements DoctorService {
|
|
private String imageDomain;
|
|
private String imageDomain;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
+ public ResponseJson<PageInfo<DoctorListVo>> getDoctorList(Integer listType, Integer authUserId, Integer doctorType, String doctorName, String certificateNo, Integer status, Integer auditStatus, Integer pageNum, Integer pageSize) {
|
|
if (null == authUserId) {
|
|
if (null == authUserId) {
|
|
return ResponseJson.error("参数异常,请输入供应商用户id", null);
|
|
return ResponseJson.error("参数异常,请输入供应商用户id", null);
|
|
}
|
|
}
|
|
|
|
+ if (null == doctorType) {
|
|
|
|
+ return ResponseJson.error("参数异常,医师类型不能为空", null);
|
|
|
|
+ }
|
|
listType = null == listType ? 1 : listType;
|
|
listType = null == listType ? 1 : listType;
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
- List<DoctorListVo> doctorList = doctorMapper.getDoctorList(listType, authUserId, doctorName, certificateNo, status, auditStatus);
|
|
|
|
|
|
+ List<DoctorListVo> doctorList = doctorMapper.getDoctorList(listType, authUserId, doctorType, doctorName, certificateNo, status, auditStatus);
|
|
PageInfo<DoctorListVo> pageData = new PageInfo<>(doctorList);
|
|
PageInfo<DoctorListVo> pageData = new PageInfo<>(doctorList);
|
|
return ResponseJson.success(pageData);
|
|
return ResponseJson.success(pageData);
|
|
}
|
|
}
|
|
@@ -74,6 +77,10 @@ public class DoctorServiceImpl implements DoctorService {
|
|
doctorMapper.deleteBanner(doctorId);
|
|
doctorMapper.deleteBanner(doctorId);
|
|
// 删除仪器
|
|
// 删除仪器
|
|
doctorMapper.deleteEquipment(doctorId);
|
|
doctorMapper.deleteEquipment(doctorId);
|
|
|
|
+ // 删除标签
|
|
|
|
+ doctorMapper.deleteTag(doctorId);
|
|
|
|
+ // 删除属性
|
|
|
|
+ doctorMapper.deleteParam(doctorId);
|
|
return ResponseJson.success("删除医师成功");
|
|
return ResponseJson.success("删除医师成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,11 +101,17 @@ public class DoctorServiceImpl implements DoctorService {
|
|
// 仪器
|
|
// 仪器
|
|
List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
|
|
List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
|
|
doctorFormVo.setEquipmentList(equipmentList);
|
|
doctorFormVo.setEquipmentList(equipmentList);
|
|
|
|
+ // 标签
|
|
|
|
+ List<String> tagList = doctorMapper.getTagList(doctorId);
|
|
|
|
+ doctorFormVo.setTagList(tagList);
|
|
|
|
+ // 属性
|
|
|
|
+ List<ParamVo> paramList = doctorMapper.getParamList(doctorId);
|
|
|
|
+ doctorFormVo.setParamList(paramList);
|
|
return ResponseJson.success(doctorFormVo);
|
|
return ResponseJson.success(doctorFormVo);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String,Object>> equipmentList) {
|
|
|
|
|
|
+ public ResponseJson saveDoctor(CmBrandDoctorPo doctor, List<String> bannerList, List<Map<String, Object>> equipmentList, List<String> tagList, List<Map<String, String>> paramList) {
|
|
Integer doctorId = doctor.getId();
|
|
Integer doctorId = doctor.getId();
|
|
Integer authUserId = doctor.getAuthUserId();
|
|
Integer authUserId = doctor.getAuthUserId();
|
|
String certificateNo = doctor.getCertificateNo();
|
|
String certificateNo = doctor.getCertificateNo();
|
|
@@ -115,9 +128,12 @@ public class DoctorServiceImpl implements DoctorService {
|
|
if (null != doctorIdByCertificateNo && !doctorIdByCertificateNo.equals(doctorId)) {
|
|
if (null != doctorIdByCertificateNo && !doctorIdByCertificateNo.equals(doctorId)) {
|
|
return ResponseJson.error("参数异常,该从业资格证编号已存在,请重新输入", null);
|
|
return ResponseJson.error("参数异常,该从业资格证编号已存在,请重新输入", null);
|
|
}
|
|
}
|
|
- if (StringUtils.isBlank(doctor.getClubName())) {
|
|
|
|
|
|
+ if (StringUtils.isBlank(doctor.getClubName()) && null == doctor.getAuthId()) {
|
|
return ResponseJson.error("参数异常,请输入所属机构");
|
|
return ResponseJson.error("参数异常,请输入所属机构");
|
|
}
|
|
}
|
|
|
|
+ if (null == doctor.getDoctorType()) {
|
|
|
|
+ return ResponseJson.error("参数异常,请输入医师类型");
|
|
|
|
+ }
|
|
if (StringUtils.isBlank(doctor.getImage())) {
|
|
if (StringUtils.isBlank(doctor.getImage())) {
|
|
return ResponseJson.error("参数异常,请上传医师照片");
|
|
return ResponseJson.error("参数异常,请上传医师照片");
|
|
}
|
|
}
|
|
@@ -144,13 +160,19 @@ public class DoctorServiceImpl implements DoctorService {
|
|
doctorMapper.deleteBanner(doctor.getId());
|
|
doctorMapper.deleteBanner(doctor.getId());
|
|
// 删除原有的设备
|
|
// 删除原有的设备
|
|
doctorMapper.deleteEquipment(doctor.getId());
|
|
doctorMapper.deleteEquipment(doctor.getId());
|
|
|
|
+ // 删除原有的标签
|
|
|
|
+ doctorMapper.deleteTag(doctor.getId());
|
|
|
|
+ // 删除原有的属性
|
|
|
|
+ doctorMapper.deleteParam(doctor.getId());
|
|
}
|
|
}
|
|
// 保存轮播图
|
|
// 保存轮播图
|
|
bannerList.forEach(banner-> doctorMapper.insertBanner(doctor.getId(), banner));
|
|
bannerList.forEach(banner-> doctorMapper.insertBanner(doctor.getId(), banner));
|
|
// 保存设备
|
|
// 保存设备
|
|
- equipmentList.forEach(equipment-> {
|
|
|
|
- doctorMapper.insertEquipment(doctor.getId(), (String) equipment.get("equipmentName"), (String) equipment.get("brand"), (String) equipment.get("image"));
|
|
|
|
- });
|
|
|
|
|
|
+ equipmentList.forEach(equipment-> doctorMapper.insertEquipment(doctor.getId(), (String) equipment.get("equipmentName"), (String) equipment.get("brand"), (String) equipment.get("image")));
|
|
|
|
+ // 保存标签
|
|
|
|
+ tagList.forEach(tag -> doctorMapper.insertTag(doctor.getId(), tag));
|
|
|
|
+ // 保存属性
|
|
|
|
+ paramList.forEach(param -> doctorMapper.insertParam(doctor.getId(), param.get("name"), param.get("content")));
|
|
return ResponseJson.success("保存医师成功", doctor);
|
|
return ResponseJson.success("保存医师成功", doctor);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -183,13 +205,17 @@ public class DoctorServiceImpl implements DoctorService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, String doctorName, Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
+ public ResponseJson<PageInfo<WxDoctorListVo>> getWxDoctorList(String appId, Integer doctorType, String doctorName, Integer pageNum, Integer pageSize) {
|
|
if (null == appId) {
|
|
if (null == appId) {
|
|
return ResponseJson.error("参数异常,请输入供应商appId", null);
|
|
return ResponseJson.error("参数异常,请输入供应商appId", null);
|
|
}
|
|
}
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
- List<WxDoctorListVo> productList = doctorMapper.getWxDoctorList(appId, doctorName);
|
|
|
|
- PageInfo<WxDoctorListVo> pageData = new PageInfo<>(productList);
|
|
|
|
|
|
+ List<WxDoctorListVo> doctorList = doctorMapper.getWxDoctorList(appId, doctorType, doctorName);
|
|
|
|
+ doctorList.forEach(doctor->{
|
|
|
|
+ List<String> tagList = doctorMapper.getTagList(doctor.getDoctorId());
|
|
|
|
+ doctor.setTagList(tagList);
|
|
|
|
+ });
|
|
|
|
+ PageInfo<WxDoctorListVo> pageData = new PageInfo<>(doctorList);
|
|
return ResponseJson.success(pageData);
|
|
return ResponseJson.success(pageData);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -208,6 +234,12 @@ public class DoctorServiceImpl implements DoctorService {
|
|
// 仪器
|
|
// 仪器
|
|
List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
|
|
List<DoctorEquipmentVo> equipmentList = doctorMapper.getEquipmentList(doctorId);
|
|
doctor.setEquipmentList(equipmentList);
|
|
doctor.setEquipmentList(equipmentList);
|
|
|
|
+ // 标签
|
|
|
|
+ List<String> tagList = doctorMapper.getTagList(doctorId);
|
|
|
|
+ doctor.setTagList(tagList);
|
|
|
|
+ // 属性
|
|
|
|
+ List<ParamVo> paramList = doctorMapper.getParamList(doctorId);
|
|
|
|
+ doctor.setParamList(paramList);
|
|
return ResponseJson.success(doctor);
|
|
return ResponseJson.success(doctor);
|
|
}
|
|
}
|
|
}
|
|
}
|