|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.imed.costaccount.common.exception.CostException;
|
|
|
import com.imed.costaccount.common.util.PageUtils;
|
|
|
+import com.imed.costaccount.constants.NumberConstant;
|
|
|
import com.imed.costaccount.mapper.HospitalMapper;
|
|
|
import com.imed.costaccount.model.Hospital;
|
|
|
import com.imed.costaccount.model.dto.HospitalDto;
|
|
@@ -47,6 +48,14 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
.like(!StringUtils.isEmpty(name), Hospital::getName, name));
|
|
|
List<Hospital> records = pages.getRecords();
|
|
|
List<HospitalVO> hospitalVOList = BeanUtil.convertList(records, HospitalVO.class);
|
|
|
+
|
|
|
+ hospitalVOList.forEach(i->{
|
|
|
+ if (NumberConstant.ZERO.equals(i.getIsHospital())){
|
|
|
+ i.setParentId(null);
|
|
|
+ i.setParentName(null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
PageUtils pageUtils = new PageUtils(pages);
|
|
|
pageUtils.setList(hospitalVOList);
|
|
|
return pageUtils;
|
|
@@ -116,7 +125,8 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
*/
|
|
|
@Override
|
|
|
public List<HospitalAllVO> getAll() {
|
|
|
- List<Hospital> hospitals = baseMapper.selectList(null);
|
|
|
+ List<Hospital> hospitals = baseMapper.selectList(new QueryWrapper<Hospital>().lambda()
|
|
|
+ .eq(Hospital::getIsHospital,NumberConstant.ONE));
|
|
|
List<HospitalAllVO> hospitalAllVOList = BeanUtil.convertList(hospitals, HospitalAllVO.class);
|
|
|
return hospitalAllVOList;
|
|
|
}
|
|
@@ -156,7 +166,7 @@ public class HospitalServiceImpl extends ServiceImpl<HospitalMapper, Hospital> i
|
|
|
Hospital one = this.getOne(
|
|
|
new LambdaQueryWrapper<Hospital>()
|
|
|
.select(Hospital::getId, Hospital::getName)
|
|
|
- .eq(Hospital::getIsHospital, 0)
|
|
|
+ .eq(Hospital::getIsHospital, 1)
|
|
|
.eq(Hospital::getSign, hospSign)
|
|
|
.last("limit 1")
|
|
|
);
|