Compare commits

..

No commits in common. "e1abcbef168c71a4642cbbc2e543326d4d695d3b" and "173b482b3ace3e410f69713c7772288dcabeba58" have entirely different histories.

11 changed files with 14 additions and 86 deletions

View File

@ -3,7 +3,7 @@ package com.atjy.model.entity;
import com.atjy.model.enums.ArticleItemType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -30,7 +30,7 @@ public class ArticleInfo extends BaseEntity {
@Schema(description = "发布时间")
@TableField(value = "publish_time")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonIgnore
private Date publishTime;
@Schema(description = "医生id")

View File

@ -3,7 +3,6 @@ package com.atjy.web.admin.service.impl;
import com.atjy.model.entity.AppointmentInfo;
import com.atjy.model.entity.ArticleInfo;
import com.atjy.model.entity.GraphInfo;
import com.atjy.model.enums.ArticleItemType;
import com.atjy.model.enums.BaseStatus;
import com.atjy.model.enums.GraphItemType;
import com.atjy.web.admin.mapper.ArticleInfoMapper;
@ -14,7 +13,6 @@ import com.atjy.web.admin.vo.article.ArticleListVo;
import com.baomidou.mybatisplus.core.conditions.interfaces.Func;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
@ -23,7 +21,6 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Service
public class ArticleInfoServiceImpl extends ServiceImpl<ArticleInfoMapper, ArticleInfo> implements ArticleInfoService {
@ -48,25 +45,14 @@ public class ArticleInfoServiceImpl extends ServiceImpl<ArticleInfoMapper, Artic
@Override
public void saveOrUpdateArticle(ArticleInfoVo articleInfoVo) {
ArticleInfo articleInfo = new ArticleInfo();
if (articleInfoVo.getId() != null) {
articleInfo.setId(articleInfoVo.getId());
}
articleInfo.setPublishTime(new Date());
articleInfo.setIsDeleted((byte) 0);
articleInfo.setType(articleInfoVo.getType());
articleInfo.setTitleBig(articleInfoVo.getTitleBig());
articleInfo.setTitleSmall(articleInfoVo.getTitleSmall());
articleInfo.setContent(articleInfoVo.getContent());
articleInfo.setDoctorId(articleInfoVo.getDoctorId());
articleInfo.setNumber(articleInfoVo.getNumber());
if (ArticleItemType.FIGHT_EPIDEMIC.getName().equals(articleInfoVo.getTypeName())) {
articleInfo.setType(ArticleItemType.FIGHT_EPIDEMIC);
} else if (ArticleItemType.HEALTH.getName().equals(articleInfoVo.getTypeName())) {
articleInfo.setType(ArticleItemType.HEALTH);
} else if (ArticleItemType.MEDICAL.getName().equals(articleInfoVo.getTypeName())) {
articleInfo.setType(ArticleItemType.MEDICAL);
} else {
articleInfo.setType(ArticleItemType.PARENTING);
}
articleInfoMapper.insertOrUpdate(articleInfo);
@ -76,16 +62,8 @@ public class ArticleInfoServiceImpl extends ServiceImpl<ArticleInfoMapper, Artic
graphInfo.setUrl(articleInfoVo.getUrl());
graphInfo.setItemId(articleInfo.getId());
graphInfo.setName(articleInfoVo.getName());
if (articleInfoVo.getUrlId() != null) {
graphInfo.setId(articleInfoVo.getUrlId());
graphInfoMapper.insertOrUpdate(graphInfo);
} else {
if (graphInfoMapper.selectOne(new LambdaQueryWrapper<GraphInfo>().eq(GraphInfo::getItemId, articleInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.ARTICLE)) != null) {
graphInfoMapper.update(new UpdateWrapper<GraphInfo>().eq("item_type", GraphItemType.ARTICLE).eq("item_id", articleInfoVo.getId()).set("name", articleInfoVo.getName()).set("url", articleInfoVo.getUrl()));
} else {
graphInfoMapper.insertOrUpdate(graphInfo);
}
}
graphInfoMapper.insertOrUpdate(graphInfo);
}
@Override

View File

@ -8,7 +8,6 @@ import com.atjy.web.admin.mapper.*;
import com.atjy.web.admin.service.DoctorInfoService;
import com.atjy.web.admin.vo.doctor.DoctorInfoVo;
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;
@ -55,13 +54,10 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
@Override
public void saveOrUpdateDoctor(DoctorInfoVo doctorInfoVo) {
DoctorInfo doctorInfo = new DoctorInfo();
if (doctorInfoVo.getId() != null) {
doctorInfo.setId(doctorInfoVo.getId());
}
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(doctorInfoVo.getDoctorName());
doctorInfo.setDoctorName(doctorInfo.getDoctorName());
doctorInfo.setBriefly(doctorInfoVo.getBriefly());
doctorInfo.setSource(doctorInfoVo.getSource());
doctorInfo.setLevel(doctorInfoVo.getLevel());
@ -77,16 +73,7 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
graphInfo.setItemId(doctorInfo.getId());
graphInfo.setName(doctorInfoVo.getGraphName());
if (doctorInfoVo.getUrlId() != null) {
graphInfo.setId(doctorInfoVo.getUrlId());
graphInfoMapper.insertOrUpdate(graphInfo);
} else {
if (graphInfoMapper.selectOne(new LambdaQueryWrapper<GraphInfo>().eq(GraphInfo::getItemId, doctorInfo.getId()).eq(GraphInfo::getItemType, GraphItemType.DOCTOR)) != null) {
graphInfoMapper.update(new UpdateWrapper<GraphInfo>().eq("item_type", GraphItemType.DOCTOR).eq("item_id", doctorInfo.getId()).set("name", doctorInfoVo.getGraphName()).set("url", doctorInfoVo.getUrl()));
} else {
graphInfoMapper.insertOrUpdate(graphInfo);
}
}
graphInfoMapper.insertOrUpdate(graphInfo);
}
@Override

View File

@ -8,7 +8,6 @@ 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;
@ -81,17 +80,6 @@ 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,8 +1,6 @@
package com.atjy.web.admin.vo.article;
import com.atjy.model.entity.ArticleInfo;
import com.atjy.model.enums.ArticleItemType;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -14,10 +12,4 @@ public class ArticleInfoVo extends ArticleInfo {
@Schema(description = "图片名称")
private String name;
@Schema(description = "医说所属类型")
private String typeName;
@Schema(description = "图片id")
private Long urlId;
}

View File

@ -1,7 +1,7 @@
package com.atjy.web.admin.vo.article;
import com.atjy.web.admin.vo.doctor.DoctorVo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@ -24,7 +24,7 @@ public class ArticleListVo {
private Long id;
@Schema(description = "发布时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonIgnore
private Date publishTime;
@Schema(description = "医生详情")
@ -34,14 +34,11 @@ public class ArticleListVo {
private String content;
@Schema(description = "医说所属类型")
private String typeName;
private String type;
@Schema(description = "图片地址")
private String url;
@Schema(description = "图片名称")
private String name;
@Schema(description = "图片id")
private Long urlId;
}

View File

@ -1,7 +1,6 @@
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;
@ -11,9 +10,6 @@ import java.util.List;
@Schema(description = "医生信息实体")
public class DoctorInfoVo extends DoctorInfo {
@Schema(description = "图片id")
private Long urlId;
@Schema(description = "图片名称")
private String graphName;

View File

@ -7,9 +7,6 @@ import lombok.Data;
@Schema(description = "文件实体")
public class FileVo {
@Schema(description = "图片id")
private Long urlId;
@Schema(description = "图片url")
private String url;

View File

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

View File

@ -21,7 +21,6 @@
ai.content,
di.id doctor_id,
di.doctor_name,
gi.id url_id,
gi.url,
gi.name,
case
@ -29,7 +28,7 @@
when ai.type = 2 then "健康养生"
when ai.type = 3 then "医疗动态"
when ai.type = 4 then "育儿专区"
end as type_name
end as type
from article_info ai
join doctor_info di on ai.doctor_id = di.id and di.is_deleted = 0
join hassle_free.graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0
@ -45,7 +44,6 @@
ai.content,
di.id doctor_id,
di.doctor_name,
gi.id url_id,
gi.url,
gi.name,
case
@ -53,7 +51,7 @@
when ai.type = 2 then "健康养生"
when ai.type = 3 then "医疗动态"
when ai.type = 4 then "育儿专区"
end as type_name
end as type
from article_info ai
join doctor_info di on ai.doctor_id = di.id and di.is_deleted = 0
join hassle_free.graph_info gi on gi.item_type = 4 and gi.item_id = ai.id and gi.is_deleted = 0

View File

@ -14,9 +14,8 @@
di.briefly,
hi.hospital_name,
d.name department_name,
gi.id url_id,
gi.url,
gi.name graph_name
gi.name
from doctor_info di
join hospital_info hi on di.hospital_id = hi.id and hi.is_deleted = 0
join department_info d on di.department_id = d.id and d.is_deleted = 0
@ -35,8 +34,7 @@
di.briefly,
hi.hospital_name,
d.name department_name,
gi.id url_id,
gi.name graph_name,
gi.name,
gi.url
from doctor_info di
join hospital_info hi on di.hospital_id = hi.id and hi.is_deleted = 0