|
|
@ -9,7 +9,9 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dao.PhysicianManageDao; |
|
|
|
import com.epmet.dto.PhysicianManageDTO; |
|
|
|
import com.epmet.dto.form.PhysicianManageFormDTO; |
|
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
|
import com.epmet.entity.PhysicianManageEntity; |
|
|
|
import com.epmet.remote.EpmetUserRemoteService; |
|
|
|
import com.epmet.service.PhysicianManageService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
@ -17,6 +19,7 @@ import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
@ -31,6 +34,9 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class PhysicianManageServiceImpl extends BaseServiceImpl<PhysicianManageDao, PhysicianManageEntity> implements PhysicianManageService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
private EpmetUserRemoteService remoteService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<PhysicianManageDTO> page(Map<String, Object> params) { |
|
|
|
IPage<PhysicianManageEntity> page = baseDao.selectPage( |
|
|
@ -49,10 +55,10 @@ public class PhysicianManageServiceImpl extends BaseServiceImpl<PhysicianManageD |
|
|
|
|
|
|
|
private QueryWrapper<PhysicianManageEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
String orgPath = remoteService.getLoginUserDetails().getOrgIdPath(); |
|
|
|
QueryWrapper<PhysicianManageEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
|
|
|
|
wrapper.likeRight(StringUtils.isNotBlank(orgPath), "ORG_ID_PATH", orgPath); |
|
|
|
return wrapper; |
|
|
|
} |
|
|
|
|
|
|
@ -66,6 +72,9 @@ public class PhysicianManageServiceImpl extends BaseServiceImpl<PhysicianManageD |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(PhysicianManageFormDTO dto) { |
|
|
|
PhysicianManageEntity entity = ConvertUtils.sourceToTarget(dto, PhysicianManageEntity.class); |
|
|
|
LoginUserDetailsResultDTO userDetails = remoteService.getLoginUserDetails(); |
|
|
|
String orgIdPath = userDetails.getOrgIdPath();//社区级别的orgIdPath
|
|
|
|
entity.setOrgIdPath(orgIdPath); |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
@ -85,8 +94,11 @@ public class PhysicianManageServiceImpl extends BaseServiceImpl<PhysicianManageD |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<PhysicianManageDTO> search(PhysicianManageFormDTO dto) { |
|
|
|
LoginUserDetailsResultDTO userDetails = remoteService.getLoginUserDetails(); |
|
|
|
String orgIdPath = userDetails.getOrgIdPath();//社区级别的orgIdPath
|
|
|
|
PageInfo<PhysicianManageDTO> pageInfo = PageHelper.startPage(dto.getPageNo(), dto.getPageSize(), dto.getIsPage()) |
|
|
|
.doSelectPageInfo(() -> baseDao.search(dto.getName(), dto.getIdCard(), dto.getLevel(), dto.getSubOrg(), dto.getOrgLevel())); |
|
|
|
.doSelectPageInfo(() -> baseDao.search(dto.getName(), dto.getIdCard(), dto.getLevel(), dto.getSubOrg(), |
|
|
|
dto.getOrgLevel(), orgIdPath)); |
|
|
|
return new PageData<>(pageInfo.getList() == null ? new ArrayList<>() : pageInfo.getList(), pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|