zqy
2 天以前 28cf0afe5cb951bf34a60a1ee0f36d38c592a8c0
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java
@@ -39,7 +39,7 @@
 */
@Service
@Slf4j
public class ZfDoctorServiceImpl extends ServiceImpl<ZfDoctorMapper, ZfDoctor> implements ZfDoctorService {
public class ZfDoctorServiceImpl extends ServiceImpl<ZfDoctorMapper, ZfDoctor> implements ZfDoctorService,ModuleSearchable {
    @Resource
    ZInfoUserService zInfoUserService;
@@ -61,6 +61,9 @@
    @Resource
    ZfDoctorShareService zfDoctorShareService;
    @Resource
    ZfDoctorDownloadService zfDoctorDownloadService;
    @Override
@@ -87,7 +90,7 @@
            fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId();
        Long motherFaId = 0L;
        if(myself.getMomId()!=null)
            motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId();
            motherFaId = zInfoUserService.getInfoById(myself.getMomId()).getFamilyId();
        //也要查别人授权的
        List<ZAuthority> authority = zAuthorityService.getAuthority();
@@ -98,7 +101,11 @@
        //加上父母家族id
        idList.add(fatherFaId);
        idList.add(motherFaId);
        List<Long> fms = zInfoUserService.findByUaidToFaid(myself.getUaid()).stream().map(ZInfoUser::getFamilyId).collect(Collectors.toList());
        if(!fms.isEmpty())
        {
            idList.addAll(fms);
        }
//        String familyIds = listFamilyIds();
//        String secondFamilyAuthority = listSecondFamilyIds()
        LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList);
@@ -153,7 +160,7 @@
    public List<ZfDoctor> markOwnData(Long familyId,Long fatherFamilyId, Long motherFamilyId, List<ZfDoctor> beanRecords) {
        return beanRecords.stream().peek(
                bean -> {
                    if (bean.getFamilyId() == familyId||(fatherFamilyId!=0L && fatherFamilyId==familyId)||(motherFamilyId!=0L && motherFamilyId==familyId)) {
                    if (Objects.equals(bean.getFamilyId(), familyId) ||(fatherFamilyId!=0L && fatherFamilyId.equals(familyId))||(motherFamilyId!=0L && motherFamilyId.equals(familyId))) {
                        bean.setOwnData(1);
                    } else {
                        bean.setOwnData(0);
@@ -383,7 +390,9 @@
            }
        }
        List<ZfDoctor> zfDoctors = listByIds(Arrays.asList(ids));
        if (! (zfDoctorDownloadService.deleteData(ids) && zfDoctorShareService.deleteByContentId(ids)  ) ){
            return AjaxResult.error();
        }
        if (zfDoctorService.removeByIds(Arrays.asList(ids))) {
            //删除es中的数据
@@ -456,6 +465,9 @@
                .like(StringUtils.isNotEmpty(zfDoctor.getWmedical()), ZfDoctor::getWmedical, zfDoctor.getWmedical())
                .like(StringUtils.isNotEmpty(zfDoctor.getCmedical()), ZfDoctor::getCmedical, zfDoctor.getCmedical())
                .like(StringUtils.isNotEmpty(zfDoctor.getRemark()), ZfDoctor::getRemark, zfDoctor.getRemark());
        lqw.like(StringUtils.isNotEmpty(zfDoctor.getCompanion()),ZfDoctor::getCompanion,zfDoctor.getCompanion());
        lqw.between(zfDoctor.getHappenStartTime() != null && zfDoctor.getHappenEndTime() != null, ZfDoctor::getCreateTime, zfDoctor.getHappenStartTime(), zfDoctor.getHappenEndTime());
        if (StringUtils.isNotEmpty(zfDoctor.getPrescription())) {
            lqw.and(wrapper -> {
                wrapper.like(StringUtils.isNotEmpty(zfDoctor.getPrescription()), ZfDoctor::getWmedical, zfDoctor.getPrescription())
@@ -464,6 +476,21 @@
            });
        }
        return lqw;
    }
    @Override
    public String getModuleCode() {
        return "2043";
    }
    @Override
    public List<?> search(String companion, Date happenStartTime, Date happenEndTime) {
        ZfDoctor zfDoctor = new ZfDoctor();
        zfDoctor.setCompanion(companion);
        zfDoctor.setHappenStartTime(happenStartTime);
        zfDoctor.setHappenEndTime(happenEndTime);
        return selectByCondition(zfDoctor);
    }
//    public LambdaQueryWrapper<ZfDoctor> buildCondition2(List<Long> ids) {
@@ -507,4 +534,4 @@
//    }
}
}