This commit is contained in:
BLRTTX 2024-12-22 20:50:55 +08:00
parent b889206ab4
commit e1abcbef16
4 changed files with 17 additions and 1 deletions

View File

@ -61,7 +61,7 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
doctorInfo.setDepartmentId(departmentInfoMapper.selectOne(new LambdaQueryWrapper<DepartmentInfo>().eq(DepartmentInfo::getName, doctorInfoVo.getDepartmentName())).getId());
doctorInfo.setHospitalId(hospitalInfoMapper.selectOne(new LambdaQueryWrapper<HospitalInfo>().eq(HospitalInfo::getHospitalName, doctorInfoVo.getHospitalName())).getId());
doctorInfo.setIsDeleted((byte) 0);
doctorInfo.setDoctorName(doctorInfo.getDoctorName());
doctorInfo.setDoctorName(doctorInfoVo.getDoctorName());
doctorInfo.setBriefly(doctorInfoVo.getBriefly());
doctorInfo.setSource(doctorInfoVo.getSource());
doctorInfo.setLevel(doctorInfoVo.getLevel());

View File

@ -8,6 +8,7 @@ import com.atjy.web.admin.mapper.*;
import com.atjy.web.admin.service.HospitalInfoService;
import com.atjy.web.admin.vo.hospital.HospitalInfoVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -80,6 +81,17 @@ public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, Hos
graphInfo.setItemId(hospitalInfo.getId());
graphInfo.setName(hospitalInfoVo.getGraphName());
if (hospitalInfoVo.getUrlId() != null) {
graphInfo.setId(hospitalInfoVo.getUrlId());
graphInfoMapper.insertOrUpdate(graphInfo);
} else {
if (graphInfoMapper.selectOne(new LambdaQueryWrapper<GraphInfo>().eq(GraphInfo::getItemId, hospitalInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.DOCTOR)) != null) {
graphInfoMapper.update(new UpdateWrapper<GraphInfo>().eq("item_type", GraphItemType.HOSPITAL).eq("item_id", hospitalInfo.getId()).set("name", hospitalInfoVo.getGraphName()).set("url", hospitalInfoVo.getUrl()));
} else {
graphInfoMapper.insertOrUpdate(graphInfo);
}
}
graphInfoMapper.insertOrUpdate(graphInfo);
}

View File

@ -1,6 +1,7 @@
package com.atjy.web.admin.vo.doctor;
import com.atjy.model.entity.DoctorInfo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

View File

@ -9,6 +9,9 @@ import lombok.Data;
@Schema(description = "医院信息实体")
public class HospitalInfoVo extends HospitalInfo {
@Schema(description = "图片id")
private Long urlId;
@Schema(description = "图片名称")
private String graphName;