445555
This commit is contained in:
parent
3f94685c77
commit
45682cac23
@ -1,6 +1,7 @@
|
|||||||
package com.example.caseData.request.CaseClinicalVideoRequest;
|
package com.example.caseData.request.CaseClinicalVideoRequest;
|
||||||
|
|
||||||
import com.example.caseData.request.clinicalRequest.getClinicalArticleSearchPage;
|
import com.example.caseData.request.clinicalRequest.getClinicalArticleSearchPage;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -23,26 +24,32 @@ public class addClinicalVideoApp {
|
|||||||
|
|
||||||
// 是否外部链接(0:否 1:是)
|
// 是否外部链接(0:否 1:是)
|
||||||
@JsonProperty("isLink")
|
@JsonProperty("isLink")
|
||||||
private Integer isLink = 0;
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
private Integer isLink;
|
||||||
|
|
||||||
// 外部链接地址
|
// 外部链接地址
|
||||||
@JsonProperty("isLinkUrl")
|
@JsonProperty("isLinkUrl")
|
||||||
private String isLinkUrl = "";
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
private String isLinkUrl;
|
||||||
|
|
||||||
// 标题
|
// 标题
|
||||||
@JsonProperty("videoTitle")
|
@JsonProperty("videoTitle")
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private String videoTitle;
|
private String videoTitle;
|
||||||
|
|
||||||
// 发布时间
|
// 发布时间
|
||||||
@JsonProperty("pushDate")
|
@JsonProperty("pushDate")
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private String pushDate;
|
private String pushDate;
|
||||||
|
|
||||||
// 作者
|
// 作者
|
||||||
@JsonProperty("author")
|
@JsonProperty("author")
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private List<Author> author;
|
private List<Author> author;
|
||||||
|
|
||||||
// 标签
|
// 标签
|
||||||
@JsonProperty("label")
|
@JsonProperty("label")
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
private List<Label> label;
|
private List<Label> label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -592,130 +592,131 @@ public class CaseClinicalVideoService {
|
|||||||
// 检测签名
|
// 检测签名
|
||||||
Video.checkSign(request,"26e8675f44565b1ed4eaaa0fcf3531d7",r,objectMapper);
|
Video.checkSign(request,"26e8675f44565b1ed4eaaa0fcf3531d7",r,objectMapper);
|
||||||
|
|
||||||
// 获取视频数据
|
|
||||||
LambdaQueryWrapper<CaseClinicalVideoModel> videoQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
videoQueryWrapper.eq(CaseClinicalVideoModel::getVideoNo, r.getVideoNo());
|
|
||||||
CaseClinicalVideoModel caseClinicalVideo = caseClinicalVideoDao.selectOne(videoQueryWrapper);
|
|
||||||
|
|
||||||
// 修改
|
// // 获取视频数据
|
||||||
if (Objects.equals(r.getAction(), "update")){
|
// LambdaQueryWrapper<CaseClinicalVideoModel> videoQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
if (caseClinicalVideo == null){
|
// videoQueryWrapper.eq(CaseClinicalVideoModel::getVideoNo, r.getVideoNo());
|
||||||
r.setAction("add");
|
// CaseClinicalVideoModel caseClinicalVideo = caseClinicalVideoDao.selectOne(videoQueryWrapper);
|
||||||
}
|
//
|
||||||
}
|
// // 修改
|
||||||
|
// if (Objects.equals(r.getAction(), "update")){
|
||||||
// 新增
|
// if (caseClinicalVideo == null){
|
||||||
if (Objects.equals(r.getAction(), "add")){
|
// r.setAction("add");
|
||||||
if (caseClinicalVideo != null){
|
// }
|
||||||
// 已存在该视频
|
// }
|
||||||
return true;
|
//
|
||||||
}
|
// // 新增
|
||||||
|
// if (Objects.equals(r.getAction(), "add")){
|
||||||
// 新增视频
|
// if (caseClinicalVideo != null){
|
||||||
caseClinicalVideo = new CaseClinicalVideoModel();
|
// // 已存在该视频
|
||||||
caseClinicalVideo.setVideoTitle(r.getVideoTitle());
|
// return true;
|
||||||
caseClinicalVideo.setVideoNo(r.getVideoNo());
|
// }
|
||||||
caseClinicalVideo.setPushDate(LocalDateTime.parse(r.getPushDate()));
|
//
|
||||||
caseClinicalVideo.setIsLink(r.getIsLink());
|
// // 新增视频
|
||||||
caseClinicalVideo.setIsLinkUrl(r.getIsLinkUrl());
|
// caseClinicalVideo = new CaseClinicalVideoModel();
|
||||||
int res = caseClinicalVideoDao.insert(caseClinicalVideo);
|
// caseClinicalVideo.setVideoTitle(r.getVideoTitle());
|
||||||
if (res <= 0){
|
// caseClinicalVideo.setVideoNo(r.getVideoNo());
|
||||||
throw new BusinessException("-1", "内部错误,添加视频失败");
|
// caseClinicalVideo.setPushDate(LocalDateTime.parse(r.getPushDate()));
|
||||||
}
|
// caseClinicalVideo.setIsLink(r.getIsLink());
|
||||||
|
// caseClinicalVideo.setIsLinkUrl(r.getIsLinkUrl());
|
||||||
// 新增标签
|
// int res = caseClinicalVideoDao.insert(caseClinicalVideo);
|
||||||
for (addClinicalVideoApp.Label label : r.getLabel()){
|
// if (res <= 0){
|
||||||
CaseClinicalVideoLabelModel caseClinicalVideoLabel = new CaseClinicalVideoLabelModel();
|
// throw new BusinessException("-1", "内部错误,添加视频失败");
|
||||||
caseClinicalVideoLabel.setVideoId(caseClinicalVideo.getVideoId());
|
// }
|
||||||
caseClinicalVideoLabel.setAppIden(label.getAppIden());
|
//
|
||||||
caseClinicalVideoLabel.setLabelName(label.getLabelName());
|
// // 新增标签
|
||||||
res = caseClinicalVideoLabelDao.insert(caseClinicalVideoLabel);
|
// for (addClinicalVideoApp.Label label : r.getLabel()){
|
||||||
if (res <= 0){
|
// CaseClinicalVideoLabelModel caseClinicalVideoLabel = new CaseClinicalVideoLabelModel();
|
||||||
throw new BusinessException("-1", "内部错误,添加视频标签失败");
|
// caseClinicalVideoLabel.setVideoId(caseClinicalVideo.getVideoId());
|
||||||
}
|
// caseClinicalVideoLabel.setAppIden(label.getAppIden());
|
||||||
|
// caseClinicalVideoLabel.setLabelName(label.getLabelName());
|
||||||
// 新增标签统计
|
// res = caseClinicalVideoLabelDao.insert(caseClinicalVideoLabel);
|
||||||
caseClinicalService.AddStatsCaseClinicalLabel(label.getAppIden(),label.getLabelName());
|
// if (res <= 0){
|
||||||
}
|
// throw new BusinessException("-1", "内部错误,添加视频标签失败");
|
||||||
|
// }
|
||||||
// 新增作者
|
//
|
||||||
for (addClinicalVideoApp.Author author : r.getAuthor()){
|
// // 新增标签统计
|
||||||
// 获取app用户数据
|
// caseClinicalService.AddStatsCaseClinicalLabel(label.getAppIden(),label.getLabelName());
|
||||||
GetUserInfoResponse result = userInfo.getUserInfoByUuid(author.getDoctorIden());
|
// }
|
||||||
CaseClinicalDoctorModel caseClinicalDoctor = userService.GetCaseClinicalDoctor(result);
|
//
|
||||||
|
// // 新增作者
|
||||||
CaseClinicalVideoAuthorModel caseClinicalVideoAuthor = new CaseClinicalVideoAuthorModel();
|
// for (addClinicalVideoApp.Author author : r.getAuthor()){
|
||||||
caseClinicalVideoAuthor.setVideoId(caseClinicalVideo.getVideoId());
|
// // 获取app用户数据
|
||||||
caseClinicalVideoAuthor.setDoctorId(String.valueOf(caseClinicalDoctor.getDoctorId()));
|
// GetUserInfoResponse result = userInfo.getUserInfoByUuid(author.getDoctorIden());
|
||||||
caseClinicalVideoAuthorDao.insert(caseClinicalVideoAuthor);
|
// CaseClinicalDoctorModel caseClinicalDoctor = userService.GetCaseClinicalDoctor(result);
|
||||||
|
//
|
||||||
// 新增作者统计
|
// CaseClinicalVideoAuthorModel caseClinicalVideoAuthor = new CaseClinicalVideoAuthorModel();
|
||||||
caseClinicalService.AddStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()));
|
// caseClinicalVideoAuthor.setVideoId(caseClinicalVideo.getVideoId());
|
||||||
|
// caseClinicalVideoAuthor.setDoctorId(String.valueOf(caseClinicalDoctor.getDoctorId()));
|
||||||
// 新增医院统计
|
// caseClinicalVideoAuthorDao.insert(caseClinicalVideoAuthor);
|
||||||
caseClinicalService.AddStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
//
|
||||||
}
|
// // 新增作者统计
|
||||||
|
// caseClinicalService.AddStatsCaseClinicalDoctor(String.valueOf(caseClinicalDoctor.getDoctorId()));
|
||||||
// 新增统计
|
//
|
||||||
IncClinicalVideoStats(String.valueOf(caseClinicalVideo.getVideoId()),4);
|
// // 新增医院统计
|
||||||
}
|
// caseClinicalService.AddStatsCaseClinicalHospital(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||||
|
// }
|
||||||
// 修改
|
//
|
||||||
if (Objects.equals(r.getAction(), "update")){
|
// // 新增统计
|
||||||
if (caseClinicalVideo == null){
|
// IncClinicalVideoStats(String.valueOf(caseClinicalVideo.getVideoId()),4);
|
||||||
throw new BusinessException("-1", "无法完成此操作");
|
// }
|
||||||
}
|
//
|
||||||
|
// // 修改
|
||||||
// 文章主体
|
// if (Objects.equals(r.getAction(), "update")){
|
||||||
if (!Objects.equals(caseClinicalVideo.getVideoNo(), r.getVideoNo())){
|
// if (caseClinicalVideo == null){
|
||||||
caseClinicalVideo.setVideoNo(r.getVideoNo());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Objects.equals(caseClinicalVideo.getIsLink(), r.getIsLink())){
|
|
||||||
caseClinicalVideo.setIsLink(r.getIsLink());
|
|
||||||
|
|
||||||
if (!Objects.equals(caseClinicalVideo.getIsLinkUrl(), r.getIsLinkUrl())){
|
|
||||||
caseClinicalVideo.setIsLinkUrl(r.getIsLinkUrl());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
caseClinicalVideoDao.updateById(caseClinicalVideo);
|
|
||||||
|
|
||||||
// 作者
|
|
||||||
// 获取全部作者
|
|
||||||
LambdaQueryWrapper<CaseClinicalVideoAuthorModel> authorQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
authorQueryWrapper.eq(CaseClinicalVideoAuthorModel::getVideoId, caseClinicalVideo.getVideoId());
|
|
||||||
List<CaseClinicalVideoAuthorModel> caseClinicalVideoAuthors = caseClinicalVideoAuthorDao.selectList(authorQueryWrapper);
|
|
||||||
|
|
||||||
List<addClinicalVideoApp.Author> addList = new ArrayList<>();
|
|
||||||
List<CaseClinicalVideoAuthorModel> deleteList = new ArrayList<>();
|
|
||||||
|
|
||||||
// 新增的
|
|
||||||
for (addClinicalVideoApp.Author a : r.getAuthor()){
|
|
||||||
for (CaseClinicalVideoAuthorModel b: caseClinicalVideoAuthors){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除的
|
|
||||||
|
|
||||||
|
|
||||||
// // 获取医生数据
|
|
||||||
// LambdaQueryWrapper<CaseClinicalDoctorModel> doctorQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
// doctorQueryWrapper.eq(CaseClinicalDoctorModel::getDoctorId, a.getDoctorId());
|
|
||||||
// CaseClinicalDoctorModel caseClinicalDoctor = caseClinicalDoctorDao.selectOne(doctorQueryWrapper);
|
|
||||||
// if (caseClinicalDoctor == null) {
|
|
||||||
// throw new BusinessException("-1", "无法完成此操作");
|
// throw new BusinessException("-1", "无法完成此操作");
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
System.out.println(addList);
|
// // 文章主体
|
||||||
System.out.println(deleteList);
|
// if (!Objects.equals(caseClinicalVideo.getVideoNo(), r.getVideoNo())){
|
||||||
}
|
// caseClinicalVideo.setVideoNo(r.getVideoNo());
|
||||||
|
// }
|
||||||
// 删除
|
//
|
||||||
if (Objects.equals(r.getAction(), "delete")){
|
// if (!Objects.equals(caseClinicalVideo.getIsLink(), r.getIsLink())){
|
||||||
|
// caseClinicalVideo.setIsLink(r.getIsLink());
|
||||||
}
|
//
|
||||||
|
// if (!Objects.equals(caseClinicalVideo.getIsLinkUrl(), r.getIsLinkUrl())){
|
||||||
|
// caseClinicalVideo.setIsLinkUrl(r.getIsLinkUrl());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// caseClinicalVideoDao.updateById(caseClinicalVideo);
|
||||||
|
//
|
||||||
|
// // 作者
|
||||||
|
// // 获取全部作者
|
||||||
|
// LambdaQueryWrapper<CaseClinicalVideoAuthorModel> authorQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// authorQueryWrapper.eq(CaseClinicalVideoAuthorModel::getVideoId, caseClinicalVideo.getVideoId());
|
||||||
|
// List<CaseClinicalVideoAuthorModel> caseClinicalVideoAuthors = caseClinicalVideoAuthorDao.selectList(authorQueryWrapper);
|
||||||
|
//
|
||||||
|
// List<addClinicalVideoApp.Author> addList = new ArrayList<>();
|
||||||
|
// List<CaseClinicalVideoAuthorModel> deleteList = new ArrayList<>();
|
||||||
|
//
|
||||||
|
// // 新增的
|
||||||
|
// for (addClinicalVideoApp.Author a : r.getAuthor()){
|
||||||
|
// for (CaseClinicalVideoAuthorModel b: caseClinicalVideoAuthors){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 删除的
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//// // 获取医生数据
|
||||||
|
//// LambdaQueryWrapper<CaseClinicalDoctorModel> doctorQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//// doctorQueryWrapper.eq(CaseClinicalDoctorModel::getDoctorId, a.getDoctorId());
|
||||||
|
//// CaseClinicalDoctorModel caseClinicalDoctor = caseClinicalDoctorDao.selectOne(doctorQueryWrapper);
|
||||||
|
//// if (caseClinicalDoctor == null) {
|
||||||
|
//// throw new BusinessException("-1", "无法完成此操作");
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// System.out.println(addList);
|
||||||
|
// System.out.println(deleteList);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 删除
|
||||||
|
// if (Objects.equals(r.getAction(), "delete")){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
throw new BusinessException("-1", "错误");
|
throw new BusinessException("-1", "错误");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user