|
@@ -50,8 +50,8 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
List<Hospital> records = pages.getRecords();
|
|
|
List<HospitalVO> hospitalVOList = BeanUtil.convertList(records, HospitalVO.class);
|
|
|
|
|
|
- hospitalVOList.forEach(i->{
|
|
|
- if (NumberConstant.ZERO.equals(i.getIsHospital())){
|
|
|
+ hospitalVOList.forEach(i -> {
|
|
|
+ if (NumberConstant.ZERO.equals(i.getIsHospital())) {
|
|
|
i.setParentId(null);
|
|
|
i.setParentName(null);
|
|
|
}
|
|
@@ -142,7 +142,7 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
@Override
|
|
|
public List<HospitalAllVO> getAll() {
|
|
|
List<Hospital> hospitals = baseMapper.selectList(new QueryWrapper<Hospital>().lambda()
|
|
|
- .eq(Hospital::getIsHospital,NumberConstant.ONE));
|
|
|
+ .eq(Hospital::getIsHospital, NumberConstant.ONE));
|
|
|
List<HospitalAllVO> hospitalAllVOList = BeanUtil.convertList(hospitals, HospitalAllVO.class);
|
|
|
return hospitalAllVOList;
|
|
|
}
|
|
@@ -192,5 +192,39 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
return one;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Hospital getByName(String str) {
|
|
|
+ Hospital one = this.getOne(
|
|
|
+ new LambdaQueryWrapper<Hospital>()
|
|
|
+// .select(Hospital::getId, Hospital::getName)
|
|
|
+ .eq(Hospital::getName, str)
|
|
|
+ .last("limit 1")
|
|
|
+ );
|
|
|
+ if (Objects.isNull(one)) {
|
|
|
+ throw new CostException("当前医院名称为:" + str + "不存在");
|
|
|
+ }
|
|
|
+ return one;
|
|
|
+ }
|
|
|
|
|
|
+ // /**
|
|
|
+// * 校验是否是本院下人员,并且返回对应的院区id
|
|
|
+// *
|
|
|
+// * @param hospId
|
|
|
+// * @param str
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @Override
|
|
|
+// public Integer getByNameAndCheck(Integer hospId, String str) {
|
|
|
+// // 得到这个hospId 相关的所有医院或院区id
|
|
|
+// Hospital byId = this.getById(hospId);
|
|
|
+// if (Objects.isNull(byId)) {
|
|
|
+// throw new CostException(500, "当前医院不存在");
|
|
|
+// }
|
|
|
+// Integer isHospital = byId.getIsHospital();
|
|
|
+// List<Integer>
|
|
|
+// // 是医院
|
|
|
+// if (isHospital == 0) {
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|