Compare commits
2 Commits
126b878f3d
...
6a2742d539
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a2742d539 | |||
| d8e89ca0d7 |
@ -106,6 +106,7 @@ public class ClinicalController extends BaseController {
|
|||||||
request.getHospitalId(),
|
request.getHospitalId(),
|
||||||
request.getDoctorId(),
|
request.getDoctorId(),
|
||||||
request.getLabelIden(),
|
request.getLabelIden(),
|
||||||
|
request.getIsNeedLink(),
|
||||||
request.handleOrder()
|
request.handleOrder()
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ public class ClinicalController extends BaseController {
|
|||||||
request.getHospitalId(),
|
request.getHospitalId(),
|
||||||
request.getDoctorId(),
|
request.getDoctorId(),
|
||||||
request.getLabelIden(),
|
request.getLabelIden(),
|
||||||
|
request.getIsNeedLink(),
|
||||||
request.handleOrder()
|
request.handleOrder()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ public interface CaseClinicalArticleDao extends BaseMapper<CaseClinicalArticleMo
|
|||||||
@Param("hospitalId") String hospitalId,
|
@Param("hospitalId") String hospitalId,
|
||||||
@Param("doctorId") String doctorId,
|
@Param("doctorId") String doctorId,
|
||||||
@Param("labelIden") String labelIden,
|
@Param("labelIden") String labelIden,
|
||||||
|
@Param("isNeedLink") Integer isNeedLink,
|
||||||
@Param("order") Map<String, String> order
|
@Param("order") Map<String, String> order
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ public interface CaseClinicalVideoDao extends BaseMapper<CaseClinicalVideoModel>
|
|||||||
@Param("hospitalId") String hospitalId,
|
@Param("hospitalId") String hospitalId,
|
||||||
@Param("doctorId") String doctorId,
|
@Param("doctorId") String doctorId,
|
||||||
@Param("labelIden") String labelIden,
|
@Param("labelIden") String labelIden,
|
||||||
|
@Param("isNeedLink") Integer isNeedLink,
|
||||||
@Param("order") Map<String, String> order
|
@Param("order") Map<String, String> order
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,9 @@ public class getClinicalArticleSearchPage {
|
|||||||
@JsonProperty("is_need_num")
|
@JsonProperty("is_need_num")
|
||||||
private Integer isNeedNum = 0;
|
private Integer isNeedNum = 0;
|
||||||
|
|
||||||
|
// 是否需要外部链接(0:否 1:是)
|
||||||
|
@JsonProperty("is_need_link")
|
||||||
|
private Integer isNeedLink = 1;
|
||||||
|
|
||||||
// 排序字段
|
// 排序字段
|
||||||
private OrderRequest order;
|
private OrderRequest order;
|
||||||
|
|||||||
@ -41,6 +41,10 @@ public class getClinicalVideoSearchPage {
|
|||||||
@JsonProperty("is_need_num")
|
@JsonProperty("is_need_num")
|
||||||
private Integer isNeedNum = 0;
|
private Integer isNeedNum = 0;
|
||||||
|
|
||||||
|
// 是否需要外部链接(0:否 1:是)
|
||||||
|
@JsonProperty("is_need_link")
|
||||||
|
private Integer isNeedLink = 1;
|
||||||
|
|
||||||
// 排序字段
|
// 排序字段
|
||||||
private OrderRequest order;
|
private OrderRequest order;
|
||||||
|
|
||||||
|
|||||||
@ -919,51 +919,53 @@ public class CaseClinicalVideoService {
|
|||||||
// 增加需要增加的医院数据
|
// 增加需要增加的医院数据
|
||||||
addHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
addHospitalSet.add(String.valueOf(caseClinicalDoctor.getHospitalId()));
|
||||||
|
|
||||||
// 生成用户证书-文章/视频
|
if (caseClinicalVideo.getIsLink() != 1){
|
||||||
if (qrCodeByte == null || qrCodeByte.length == 0) {
|
// 生成用户证书-文章/视频
|
||||||
// 生成二维码图片
|
if (qrCodeByte == null || qrCodeByte.length == 0) {
|
||||||
if (caseClinicalVideo.getShareQrcode() == null){
|
// 生成二维码图片
|
||||||
try {
|
if (caseClinicalVideo.getShareQrcode() == null){
|
||||||
// 生成用户分享二维码-文章/视频
|
try {
|
||||||
qrCodeByte = userService.CreateUserCaseClinicalUnlimitedQrcode(String.valueOf(caseClinicalVideo.getVideoId()),2);
|
// 生成用户分享二维码-文章/视频
|
||||||
} catch (Exception e) {
|
qrCodeByte = userService.CreateUserCaseClinicalUnlimitedQrcode(String.valueOf(caseClinicalVideo.getVideoId()),2);
|
||||||
// 不处理
|
} catch (Exception e) {
|
||||||
throw new BusinessException("-1", "无法完成此操作1");
|
// 不处理
|
||||||
|
throw new BusinessException("-1", "无法完成此操作1");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
// 下载二维码图片
|
||||||
|
qrCodeByte = Oss.getObjectToByte(caseClinicalVideo.getShareQrcode().replaceFirst("^/+", ""));
|
||||||
|
if (qrCodeByte == null) {
|
||||||
|
throw new BusinessException("-1", "无法完成此操作2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载头像
|
||||||
|
byte[] avatarByte = new byte[0];
|
||||||
|
if (caseClinicalDoctor.getAvatar() != null && !caseClinicalDoctor.getAvatar().isEmpty()) {
|
||||||
|
avatarByte = Oss.getObjectToByte(caseClinicalDoctor.getAvatar().replaceFirst("^/+", ""));
|
||||||
}else{
|
}else{
|
||||||
// 下载二维码图片
|
try {
|
||||||
qrCodeByte = Oss.getObjectToByte(caseClinicalVideo.getShareQrcode().replaceFirst("^/+", ""));
|
avatarByte = ImageUtil.readImageToBytes("static/cert/avatar.png");
|
||||||
if (qrCodeByte == null) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException("-1", "无法完成此操作2");
|
throw new BusinessException("-1", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (avatarByte == null) {
|
||||||
}
|
throw new BusinessException("-1", "无法完成此操作");
|
||||||
|
|
||||||
// 下载头像
|
|
||||||
byte[] avatarByte = new byte[0];
|
|
||||||
if (caseClinicalDoctor.getAvatar() != null && !caseClinicalDoctor.getAvatar().isEmpty()) {
|
|
||||||
avatarByte = Oss.getObjectToByte(caseClinicalDoctor.getAvatar().replaceFirst("^/+", ""));
|
|
||||||
}else{
|
|
||||||
try {
|
|
||||||
avatarByte = ImageUtil.readImageToBytes("static/cert/avatar.png");
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new BusinessException("-1", e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (avatarByte == null) {
|
userService.CreateUserCert(
|
||||||
throw new BusinessException("-1", "无法完成此操作");
|
String.valueOf(caseClinicalVideo.getVideoId()),
|
||||||
|
2,
|
||||||
|
String.valueOf(caseClinicalDoctor.getDoctorId()),
|
||||||
|
qrCodeByte,
|
||||||
|
avatarByte
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
userService.CreateUserCert(
|
|
||||||
String.valueOf(caseClinicalVideo.getVideoId()),
|
|
||||||
2,
|
|
||||||
String.valueOf(caseClinicalDoctor.getDoctorId()),
|
|
||||||
qrCodeByte,
|
|
||||||
avatarByte
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!addHospitalSet.isEmpty()){
|
if (!addHospitalSet.isEmpty()){
|
||||||
|
|||||||
@ -120,7 +120,9 @@ public class IndexService {
|
|||||||
|
|
||||||
// 医院病例库推荐-2条
|
// 医院病例库推荐-2条
|
||||||
QueryWrapper<StatsCaseClinicalHospitalModel> statsCaseClinicalHospitalQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<StatsCaseClinicalHospitalModel> statsCaseClinicalHospitalQueryWrapper = new QueryWrapper<>();
|
||||||
statsCaseClinicalHospitalQueryWrapper.orderByDesc("article_num + video_num") // 按文章数量倒序
|
statsCaseClinicalHospitalQueryWrapper
|
||||||
|
.apply("article_num + video_num > {0}", 10) // 添加条件
|
||||||
|
.orderByDesc("article_num + video_num") // 按文章数量倒序
|
||||||
.orderByDesc("last_push_date")
|
.orderByDesc("last_push_date")
|
||||||
.last("LIMIT 3"); // 只取2条记录
|
.last("LIMIT 3"); // 只取2条记录
|
||||||
List<StatsCaseClinicalHospitalModel> statsCaseClinicalHospitals = statsCaseClinicalHospitalDao.selectList(statsCaseClinicalHospitalQueryWrapper);
|
List<StatsCaseClinicalHospitalModel> statsCaseClinicalHospitals = statsCaseClinicalHospitalDao.selectList(statsCaseClinicalHospitalQueryWrapper);
|
||||||
@ -132,7 +134,9 @@ public class IndexService {
|
|||||||
|
|
||||||
// 医生病例库推荐-2条
|
// 医生病例库推荐-2条
|
||||||
QueryWrapper<StatsCaseClinicalDoctorModel> statsCaseClinicalDoctorQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<StatsCaseClinicalDoctorModel> statsCaseClinicalDoctorQueryWrapper = new QueryWrapper<>();
|
||||||
statsCaseClinicalDoctorQueryWrapper.orderByDesc("article_num + video_num") // 按文章数量倒序
|
statsCaseClinicalDoctorQueryWrapper
|
||||||
|
.apply("article_num + video_num > {0}", 5) // 添加条件
|
||||||
|
.orderByDesc("article_num + video_num") // 按文章数量倒序
|
||||||
.orderByDesc("last_push_date")
|
.orderByDesc("last_push_date")
|
||||||
.last("LIMIT 3"); // 只取2条记录
|
.last("LIMIT 3"); // 只取2条记录
|
||||||
List<StatsCaseClinicalDoctorModel> statsCaseClinicalDoctors = statsCaseClinicalDoctorDao.selectList(statsCaseClinicalDoctorQueryWrapper);
|
List<StatsCaseClinicalDoctorModel> statsCaseClinicalDoctors = statsCaseClinicalDoctorDao.selectList(statsCaseClinicalDoctorQueryWrapper);
|
||||||
|
|||||||
@ -77,6 +77,9 @@
|
|||||||
<if test="labelIden != null and labelIden != ''">
|
<if test="labelIden != null and labelIden != ''">
|
||||||
AND l.app_iden = #{labelIden}
|
AND l.app_iden = #{labelIden}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isNeedLink == 0">
|
||||||
|
AND l.is_link = 0
|
||||||
|
</if>
|
||||||
) AS result
|
) AS result
|
||||||
JOIN case_clinical_article a ON a.article_id = result.article_id
|
JOIN case_clinical_article a ON a.article_id = result.article_id
|
||||||
<if test="order != null and !order.isEmpty()">
|
<if test="order != null and !order.isEmpty()">
|
||||||
|
|||||||
@ -45,6 +45,9 @@
|
|||||||
<if test="labelIden != null and labelIden != ''">
|
<if test="labelIden != null and labelIden != ''">
|
||||||
AND l.app_iden = #{labelIden}
|
AND l.app_iden = #{labelIden}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="isNeedLink == 0">
|
||||||
|
AND l.is_link = 0
|
||||||
|
</if>
|
||||||
<if test="order != null and !order.isEmpty()">
|
<if test="order != null and !order.isEmpty()">
|
||||||
ORDER BY
|
ORDER BY
|
||||||
<foreach item="entry" index="key" collection="order" separator=",">
|
<foreach item="entry" index="key" collection="order" separator=",">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user