66 changed files with 8097 additions and 1976 deletions
@ -1,30 +1,481 @@ |
|||||
<template> |
<template> |
||||
<view class="content"> |
<view class="content"> |
||||
<!-- <web-view src="https://rs.sxyfrs.com/ruisi/clienths/#/"></web-view> --> |
<view |
||||
<!-- <web-view src="https://rs.sxyfrs.com/ruisi/training/"></web-view> --> |
v-if="type" |
||||
<!-- <web-view src="https://test.tall.wiki/ruisiCga/client/#/"></web-view> --> |
class="relative column align-center justify-center full-height bg-white" |
||||
<!-- 罗湖医院 --> |
> |
||||
<web-view src="http://172.16.40.155/cga/v2/api/client/#/"></web-view> |
<view class="last-time-box"> |
||||
</view> |
<button |
||||
</view> |
class="last-time last-time1" |
||||
|
shape="circle" |
||||
|
size="mini" |
||||
|
:plain="true" |
||||
|
@click="handleFast" |
||||
|
> |
||||
|
外网快捷 |
||||
|
</button> |
||||
|
<button |
||||
|
class="last-time" |
||||
|
:style="{ |
||||
|
'pointer-events': isUps ? 'none' : '', |
||||
|
opacity: isUps ? 0.5 : 1, |
||||
|
}" |
||||
|
shape="circle" |
||||
|
size="mini" |
||||
|
:plain="true" |
||||
|
@click="openPage" |
||||
|
> |
||||
|
跳过 {{ leftTime }} |
||||
|
</button> |
||||
|
</view> |
||||
|
|
||||
|
<view class="icon-setting" @click="zzcNo"> |
||||
|
<image src="./sz.png" alt="" mode="widthFix" /> |
||||
|
</view> |
||||
|
|
||||
|
<view> |
||||
|
<div |
||||
|
style=" |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
" |
||||
|
> |
||||
|
<image |
||||
|
src="./appbg.png" |
||||
|
alt="" |
||||
|
style="width: 100%; height: 100%" |
||||
|
mode="widthFix" |
||||
|
/> |
||||
|
</div> |
||||
|
|
||||
|
<view class="ups" v-if="isUps"> |
||||
|
<view class="ups-box"> |
||||
|
<view class="header"> 老年综合评估系统 </view> |
||||
|
<uni-forms |
||||
|
ref="formRef" |
||||
|
:modelValue="formData" |
||||
|
:label-width="70" |
||||
|
:rules="rules" |
||||
|
> |
||||
|
<uni-forms-item label="访问域名" name="APP_ACCESS_HOST"> |
||||
|
<view class="view-item"> |
||||
|
<view class="view-item-hz"> |
||||
|
<uni-data-select |
||||
|
style="flex: 2" |
||||
|
v-model="value" |
||||
|
:localdata="range" |
||||
|
></uni-data-select> |
||||
|
</view> |
||||
|
<uni-easyinput |
||||
|
type="text" |
||||
|
v-model="formData.APP_ACCESS_HOST" |
||||
|
placeholder="请输入域名" |
||||
|
/> |
||||
|
<view class="view-item-hz view-item-hz1"> |
||||
|
<uni-easyinput |
||||
|
type="text" |
||||
|
v-model="formData.APP_ACCESS_ROOT" |
||||
|
placeholder="请输入根路径" |
||||
|
/> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-forms-item> |
||||
|
<uni-forms-item label="页面地址" name="APP_ACCESS_HOST"> |
||||
|
<view class="view-item"> |
||||
|
<view class="view-item-title"> |
||||
|
{{ value }}{{ formData.APP_ACCESS_HOST |
||||
|
}}{{ formData.APP_ACCESS_ROOT }}</view |
||||
|
> |
||||
|
</view> |
||||
|
</uni-forms-item> |
||||
|
<view |
||||
|
class="btn-box" |
||||
|
style="display: flex; justify-content: space-between" |
||||
|
> |
||||
|
<view class="borrad"> |
||||
|
<button type="default" style="color: #000" @click="onCancel"> |
||||
|
取消 |
||||
|
</button> |
||||
|
</view> |
||||
|
<view class="borrad"> |
||||
|
<button class="bul" type="default" @click="onConfirm"> |
||||
|
确定 |
||||
|
</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-forms> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view v-if="webViewUrl"> |
||||
|
<web-view @message="handleH5Message" :src="webViewUrl"></web-view> |
||||
|
</view> |
||||
|
</view> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
export default { |
export default { |
||||
data() { |
data() { |
||||
return {} |
const HOSTROOT = (rule, value, callback) => { |
||||
}, |
if (!this.formData.APP_ACCESS_HOST) { |
||||
onLoad() {}, |
callback(new Error("域名不能为空")); |
||||
onReady() {}, |
} else if (!this.formData.APP_ACCESS_ROOT) { |
||||
methods: { |
callback(new Error("根路径不能为空")); |
||||
}, |
} else { |
||||
created() { |
callback(); |
||||
}, |
} |
||||
onShow() {} |
}; |
||||
} |
return { |
||||
|
type: true, |
||||
|
value: "http://", |
||||
|
range: [ |
||||
|
{ value: "http://", text: "http://" }, |
||||
|
{ value: "https://", text: "https://" }, |
||||
|
], |
||||
|
title: "Hello", |
||||
|
showCreateBtn: true, |
||||
|
isUps: false, |
||||
|
formData: { |
||||
|
APP_ACCESS_HOST: "", |
||||
|
APP_ACCESS_ROOT: "", |
||||
|
}, |
||||
|
leftTime: 5, |
||||
|
rules: { |
||||
|
APP_ACCESS_HOST: { |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
errorMessage: "域名不能为空", |
||||
|
}, |
||||
|
{ |
||||
|
validateFunction: (rule, value, data, callback) => { |
||||
|
if (!this.formData.APP_ACCESS_HOST) { |
||||
|
callback("域名不能为空"); |
||||
|
} else if (!this.formData.APP_ACCESS_ROOT) { |
||||
|
callback("根路径不能为空"); |
||||
|
} |
||||
|
|
||||
|
return true; |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
timer: null, // 左上角倒计时 |
||||
|
timer1: null, // 有数据默认跳转倒计时 |
||||
|
state: true, |
||||
|
webViewUrl: null, |
||||
|
}; |
||||
|
}, |
||||
|
onShow() {}, |
||||
|
onLoad() { |
||||
|
let HOST = uni.getStorageSync("APP_ACCESS_HOST") || null; // 域名 |
||||
|
let ROOT = uni.getStorageSync("APP_ACCESS_ROOT") || null; // 根路径 |
||||
|
this.value = uni.getStorageSync("APP_HOST") || "http://"; // 域名前缀 |
||||
|
this.isUps = true; |
||||
|
if (HOST && ROOT) { |
||||
|
this.isUps = false; |
||||
|
} |
||||
|
this.formData.APP_ACCESS_HOST = HOST; |
||||
|
this.formData.APP_ACCESS_ROOT = ROOT || "/cga/v2/client/#/"; |
||||
|
|
||||
|
// 倒计时 |
||||
|
this.init(); |
||||
|
// 判断是否需要默认弹窗 |
||||
|
if (!HOST || !ROOT) { |
||||
|
this.isUps = true; |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
isUps(newVal, oldVal) { |
||||
|
if (newVal) { |
||||
|
clearInterval(this.timer); |
||||
|
this.timer = undefined; |
||||
|
} else { |
||||
|
this.init(); |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
methods: { |
||||
|
// 接收H5消息 |
||||
|
handleH5Message(e) { |
||||
|
let APP_HOST = uni.getStorageSync("APP_HOST"); |
||||
|
let APP_ACCESS_HOST = uni.getStorageSync("APP_ACCESS_HOST"); |
||||
|
let url = `${APP_HOST}${APP_ACCESS_HOST}${e.detail.data[0].filePath}`; |
||||
|
this.handlexz(url); |
||||
|
}, |
||||
|
// 下载文件并预览 |
||||
|
handlexz(url) { |
||||
|
console.log("下载", url); |
||||
|
uni.downloadFile({ |
||||
|
url: url, |
||||
|
success: (res) => { |
||||
|
console.log("下载成功", res); |
||||
|
if (res.statusCode === 200) { |
||||
|
// 下载成功后调用打开文件方法 |
||||
|
uni.openDocument({ |
||||
|
filePath: res.tempFilePath, |
||||
|
// fileType: "pdf", |
||||
|
success: function (res) { |
||||
|
console.log("打开文档成功"); |
||||
|
}, |
||||
|
fail: function (err) { |
||||
|
console.log("打开文档失败", err); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
fail: (err) => { |
||||
|
console.log("下载失败:", err); |
||||
|
uni.showToast({ |
||||
|
title: "下载失败", |
||||
|
icon: "none", |
||||
|
}); |
||||
|
}, |
||||
|
}); |
||||
|
}, |
||||
|
// 外网快捷 |
||||
|
handleFast() { |
||||
|
this.value = "https://"; |
||||
|
this.formData.APP_ACCESS_HOST = "www.ylinno.com"; |
||||
|
this.formData.APP_ACCESS_ROOT = "/cga/v2/client/#/"; |
||||
|
}, |
||||
|
// |
||||
|
onCancel() { |
||||
|
this.isUps = false; |
||||
|
}, |
||||
|
onConfirm() { |
||||
|
if (!this.$refs.formRef) return; |
||||
|
this.$refs.formRef |
||||
|
.validate() |
||||
|
.then(async () => { |
||||
|
uni.setStorageSync("APP_ACCESS_HOST", this.formData.APP_ACCESS_HOST); |
||||
|
uni.setStorageSync("APP_HOST", this.value); |
||||
|
uni.setStorageSync("APP_ACCESS_ROOT", this.formData.APP_ACCESS_ROOT); |
||||
|
this.isUps = false; |
||||
|
this.openPage(); |
||||
|
}) |
||||
|
.catch((error) => { |
||||
|
console.error(error); |
||||
|
}); |
||||
|
}, |
||||
|
init() { |
||||
|
this.timer = setInterval(() => { |
||||
|
if (this.leftTime === 0) { |
||||
|
clearInterval(this.timer); |
||||
|
this.timer = undefined; |
||||
|
if (!this.isUps) { |
||||
|
this.openPage(); |
||||
|
} |
||||
|
return; |
||||
|
} |
||||
|
this.leftTime -= 1; |
||||
|
}, 1000); |
||||
|
}, |
||||
|
openPage() { |
||||
|
let HOST = this.formData.APP_ACCESS_HOST || null; |
||||
|
let ROOT = this.formData.APP_ACCESS_ROOT || null; |
||||
|
if (HOST && ROOT) { |
||||
|
this.webViewUrl = `${this.value}${HOST}${ROOT}`; |
||||
|
this.type = false; |
||||
|
} else { |
||||
|
this.isUps = true; |
||||
|
} |
||||
|
}, |
||||
|
// 关闭弹窗 |
||||
|
zzcoff() { |
||||
|
this.isUps = false; |
||||
|
}, |
||||
|
// 打开弹窗 |
||||
|
zzcNo() { |
||||
|
clearInterval(this.timer1); |
||||
|
this.isUps = true; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
|
.view-item { |
||||
|
position: relative; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
.view-item-title { |
||||
|
width: 100%; |
||||
|
border: 1px solid #e5e5e5; |
||||
|
padding: 0 10px; |
||||
|
line-height: 35px; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
.view-item-hz1 { |
||||
|
flex: 1; |
||||
|
height: 37px; |
||||
|
line-height: 37px; |
||||
|
background: #f5f7fa; |
||||
|
width: 80px; |
||||
|
text-align: center; |
||||
|
border-radius: 4px 0 0 4px; |
||||
|
border-right: none !important; |
||||
|
margin-left: 4px; |
||||
|
} |
||||
|
} |
||||
|
.btn-box { |
||||
|
button { |
||||
|
width: 160px; |
||||
|
height: 44px; |
||||
|
line-height: 44px; |
||||
|
border-radius: 22px; |
||||
|
border: none !important; |
||||
|
} |
||||
|
|
||||
|
.bul { |
||||
|
background: #5cc0be; |
||||
|
color: #fff; |
||||
|
} |
||||
|
|
||||
|
.fff { |
||||
|
border: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.btn { |
||||
|
display: block; |
||||
|
height: 50px; |
||||
|
box-sizing: border-box; |
||||
|
background: #5cc0be; |
||||
|
color: #fff; |
||||
|
text-align: center; |
||||
|
line-height: 50px; |
||||
|
} |
||||
|
|
||||
|
.fild-cned { |
||||
|
width: 196 * 3rpx; |
||||
|
height: 215 * 3rpx; |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
margin: auto; |
||||
|
} |
||||
|
.last-time-box { |
||||
|
position: absolute; |
||||
|
right: 48rpx; |
||||
|
top: 68rpx; |
||||
|
z-index: 2; |
||||
|
} |
||||
|
.last-time { |
||||
|
} |
||||
|
.last-time1 { |
||||
|
margin-right: 10px; |
||||
|
} |
||||
|
.loading-img { |
||||
|
width: 450 * 1.5px; |
||||
|
height: 370 * 1.5px; |
||||
|
margin-bottom: 50rpx; |
||||
|
} |
||||
|
|
||||
|
// .btn-create { |
||||
|
// width: 560rpx; |
||||
|
// height: 100rpx; |
||||
|
// } |
||||
|
|
||||
|
.icon-setting { |
||||
|
position: fixed; |
||||
|
right: 48rpx; |
||||
|
bottom: 68rpx; |
||||
|
z-index: 1; |
||||
|
} |
||||
|
|
||||
|
.icon-setting uni-image { |
||||
|
width: 50px; |
||||
|
height: 50px; |
||||
|
} |
||||
|
/* 弹窗样式 */ |
||||
|
.ups { |
||||
|
// height: 280px; |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
right: 0; |
||||
|
left: 0; |
||||
|
bottom: 0; |
||||
|
margin: auto; |
||||
|
z-index: 1; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
justify-content: center; |
||||
|
} |
||||
|
|
||||
|
.ups-box { |
||||
|
width: 600px; |
||||
|
padding: 24px 50px; |
||||
|
box-sizing: border-box; |
||||
|
background: #fff; |
||||
|
border-radius: 10px; |
||||
|
border: 1px solid #e3e3e3; |
||||
|
} |
||||
|
|
||||
|
.ups scroll-view { |
||||
|
height: 97%; |
||||
|
box-sizing: border-box; |
||||
|
padding-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.ups >>> .checklist-text { |
||||
|
display: none !important; |
||||
|
} |
||||
|
|
||||
|
>>> .uni-switch-input:before { |
||||
|
background-color: #a3acbf; |
||||
|
} |
||||
|
|
||||
|
.header { |
||||
|
text-align: center; |
||||
|
font-weight: 600; |
||||
|
font-size: 36px; |
||||
|
margin: 15px 0; |
||||
|
margin-bottom: 30px; |
||||
|
} |
||||
</style> |
</style> |
||||
<style scoped> |
<style scoped> |
||||
|
>>> .box img { |
||||
|
margin-left: 0; |
||||
|
} |
||||
|
>>> .is-input-border { |
||||
|
/* border-left: none !important; */ |
||||
|
border-radius: 0 4px 4px 0; |
||||
|
} |
||||
|
>>> .uni-select { |
||||
|
height: 37px; |
||||
|
line-height: 37px; |
||||
|
background: #f5f7fa; |
||||
|
width: 80px; |
||||
|
text-align: center; |
||||
|
border-radius: 4px 0 0 4px; |
||||
|
border-right: none !important; |
||||
|
} |
||||
|
>>> .uni-icons { |
||||
|
display: none !important; |
||||
|
} |
||||
|
.content { |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
background: #5cc0be; |
||||
|
/* background: url("./appbg.png"); |
||||
|
background-size: cover; */ |
||||
|
} |
||||
|
uni-button { |
||||
|
color: #fff; |
||||
|
} |
||||
|
uni-button:after { |
||||
|
border: 1px solid #fff; |
||||
|
} |
||||
|
uni-button[plain] { |
||||
|
border: 1px solid #fff; |
||||
|
} |
||||
</style> |
</style> |
||||
|
|||||
@ -0,0 +1,173 @@ |
|||||
|
package com.ccsens.system.domain.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class EmsEvaluationScaleCognitiveRelevance implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long evaluationId; |
||||
|
|
||||
|
private String scaleCode; |
||||
|
|
||||
|
private Long parentId; |
||||
|
|
||||
|
private String cognitiveCode; |
||||
|
|
||||
|
private BigDecimal score; |
||||
|
|
||||
|
private BigDecimal totalScore; |
||||
|
|
||||
|
private Long comboId; |
||||
|
|
||||
|
private Integer sort; |
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
private Byte delFlag; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getEvaluationId() { |
||||
|
return evaluationId; |
||||
|
} |
||||
|
|
||||
|
public void setEvaluationId(Long evaluationId) { |
||||
|
this.evaluationId = evaluationId; |
||||
|
} |
||||
|
|
||||
|
public String getScaleCode() { |
||||
|
return scaleCode; |
||||
|
} |
||||
|
|
||||
|
public void setScaleCode(String scaleCode) { |
||||
|
this.scaleCode = scaleCode == null ? null : scaleCode.trim(); |
||||
|
} |
||||
|
|
||||
|
public Long getParentId() { |
||||
|
return parentId; |
||||
|
} |
||||
|
|
||||
|
public void setParentId(Long parentId) { |
||||
|
this.parentId = parentId; |
||||
|
} |
||||
|
|
||||
|
public String getCognitiveCode() { |
||||
|
return cognitiveCode; |
||||
|
} |
||||
|
|
||||
|
public void setCognitiveCode(String cognitiveCode) { |
||||
|
this.cognitiveCode = cognitiveCode == null ? null : cognitiveCode.trim(); |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getScore() { |
||||
|
return score; |
||||
|
} |
||||
|
|
||||
|
public void setScore(BigDecimal score) { |
||||
|
this.score = score; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getTotalScore() { |
||||
|
return totalScore; |
||||
|
} |
||||
|
|
||||
|
public void setTotalScore(BigDecimal totalScore) { |
||||
|
this.totalScore = totalScore; |
||||
|
} |
||||
|
|
||||
|
public Long getComboId() { |
||||
|
return comboId; |
||||
|
} |
||||
|
|
||||
|
public void setComboId(Long comboId) { |
||||
|
this.comboId = comboId; |
||||
|
} |
||||
|
|
||||
|
public Integer getSort() { |
||||
|
return sort; |
||||
|
} |
||||
|
|
||||
|
public void setSort(Integer sort) { |
||||
|
this.sort = sort; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy == null ? null : createBy.trim(); |
||||
|
} |
||||
|
|
||||
|
public Date getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Date createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy == null ? null : updateBy.trim(); |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateTime() { |
||||
|
return updateTime; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateTime(Date updateTime) { |
||||
|
this.updateTime = updateTime; |
||||
|
} |
||||
|
|
||||
|
public Byte getDelFlag() { |
||||
|
return delFlag; |
||||
|
} |
||||
|
|
||||
|
public void setDelFlag(Byte delFlag) { |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", evaluationId=").append(evaluationId); |
||||
|
sb.append(", scaleCode=").append(scaleCode); |
||||
|
sb.append(", parentId=").append(parentId); |
||||
|
sb.append(", cognitiveCode=").append(cognitiveCode); |
||||
|
sb.append(", score=").append(score); |
||||
|
sb.append(", totalScore=").append(totalScore); |
||||
|
sb.append(", comboId=").append(comboId); |
||||
|
sb.append(", sort=").append(sort); |
||||
|
sb.append(", createBy=").append(createBy); |
||||
|
sb.append(", createTime=").append(createTime); |
||||
|
sb.append(", updateBy=").append(updateBy); |
||||
|
sb.append(", updateTime=").append(updateTime); |
||||
|
sb.append(", delFlag=").append(delFlag); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.system.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance; |
||||
|
import com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface EmsEvaluationScaleCognitiveRelevanceMapper { |
||||
|
long countByExample(EmsEvaluationScaleCognitiveRelevanceExample example); |
||||
|
|
||||
|
int deleteByExample(EmsEvaluationScaleCognitiveRelevanceExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(EmsEvaluationScaleCognitiveRelevance record); |
||||
|
|
||||
|
int insertSelective(EmsEvaluationScaleCognitiveRelevance record); |
||||
|
|
||||
|
List<EmsEvaluationScaleCognitiveRelevance> selectByExample(EmsEvaluationScaleCognitiveRelevanceExample example); |
||||
|
|
||||
|
EmsEvaluationScaleCognitiveRelevance selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") EmsEvaluationScaleCognitiveRelevance record, @Param("example") EmsEvaluationScaleCognitiveRelevanceExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(EmsEvaluationScaleCognitiveRelevance record); |
||||
|
|
||||
|
int updateByPrimaryKey(EmsEvaluationScaleCognitiveRelevance record); |
||||
|
} |
||||
@ -0,0 +1,353 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.system.persist.mapper.EmsEvaluationScaleCognitiveRelevanceMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="evaluation_id" jdbcType="BIGINT" property="evaluationId" /> |
||||
|
<result column="scale_code" jdbcType="VARCHAR" property="scaleCode" /> |
||||
|
<result column="parent_id" jdbcType="BIGINT" property="parentId" /> |
||||
|
<result column="cognitive_code" jdbcType="VARCHAR" property="cognitiveCode" /> |
||||
|
<result column="score" jdbcType="DECIMAL" property="score" /> |
||||
|
<result column="total_score" jdbcType="DECIMAL" property="totalScore" /> |
||||
|
<result column="combo_id" jdbcType="BIGINT" property="comboId" /> |
||||
|
<result column="sort" jdbcType="INTEGER" property="sort" /> |
||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, evaluation_id, scale_code, parent_id, cognitive_code, score, total_score, combo_id, |
||||
|
sort, create_by, create_time, update_by, update_time, del_flag |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from ems_evaluation_scale_cognitive_relevance |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from ems_evaluation_scale_cognitive_relevance |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from ems_evaluation_scale_cognitive_relevance |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample"> |
||||
|
delete from ems_evaluation_scale_cognitive_relevance |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance"> |
||||
|
insert into ems_evaluation_scale_cognitive_relevance (id, evaluation_id, scale_code, |
||||
|
parent_id, cognitive_code, score, |
||||
|
total_score, combo_id, sort, |
||||
|
create_by, create_time, update_by, |
||||
|
update_time, del_flag) |
||||
|
values (#{id,jdbcType=BIGINT}, #{evaluationId,jdbcType=BIGINT}, #{scaleCode,jdbcType=VARCHAR}, |
||||
|
#{parentId,jdbcType=BIGINT}, #{cognitiveCode,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, |
||||
|
#{totalScore,jdbcType=DECIMAL}, #{comboId,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, |
||||
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, |
||||
|
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance"> |
||||
|
insert into ems_evaluation_scale_cognitive_relevance |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="evaluationId != null"> |
||||
|
evaluation_id, |
||||
|
</if> |
||||
|
<if test="scaleCode != null"> |
||||
|
scale_code, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
parent_id, |
||||
|
</if> |
||||
|
<if test="cognitiveCode != null"> |
||||
|
cognitive_code, |
||||
|
</if> |
||||
|
<if test="score != null"> |
||||
|
score, |
||||
|
</if> |
||||
|
<if test="totalScore != null"> |
||||
|
total_score, |
||||
|
</if> |
||||
|
<if test="comboId != null"> |
||||
|
combo_id, |
||||
|
</if> |
||||
|
<if test="sort != null"> |
||||
|
sort, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="evaluationId != null"> |
||||
|
#{evaluationId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="scaleCode != null"> |
||||
|
#{scaleCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
#{parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="cognitiveCode != null"> |
||||
|
#{cognitiveCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="score != null"> |
||||
|
#{score,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="totalScore != null"> |
||||
|
#{totalScore,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="comboId != null"> |
||||
|
#{comboId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="sort != null"> |
||||
|
#{sort,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
#{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
#{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
#{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
#{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
#{delFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevanceExample" resultType="java.lang.Long"> |
||||
|
select count(*) from ems_evaluation_scale_cognitive_relevance |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update ems_evaluation_scale_cognitive_relevance |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.evaluationId != null"> |
||||
|
evaluation_id = #{record.evaluationId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.scaleCode != null"> |
||||
|
scale_code = #{record.scaleCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.parentId != null"> |
||||
|
parent_id = #{record.parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.cognitiveCode != null"> |
||||
|
cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.score != null"> |
||||
|
score = #{record.score,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.totalScore != null"> |
||||
|
total_score = #{record.totalScore,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.comboId != null"> |
||||
|
combo_id = #{record.comboId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.sort != null"> |
||||
|
sort = #{record.sort,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.createBy != null"> |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createTime != null"> |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updateBy != null"> |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.updateTime != null"> |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.delFlag != null"> |
||||
|
del_flag = #{record.delFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update ems_evaluation_scale_cognitive_relevance |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
evaluation_id = #{record.evaluationId,jdbcType=BIGINT}, |
||||
|
scale_code = #{record.scaleCode,jdbcType=VARCHAR}, |
||||
|
parent_id = #{record.parentId,jdbcType=BIGINT}, |
||||
|
cognitive_code = #{record.cognitiveCode,jdbcType=VARCHAR}, |
||||
|
score = #{record.score,jdbcType=DECIMAL}, |
||||
|
total_score = #{record.totalScore,jdbcType=DECIMAL}, |
||||
|
combo_id = #{record.comboId,jdbcType=BIGINT}, |
||||
|
sort = #{record.sort,jdbcType=INTEGER}, |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{record.delFlag,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance"> |
||||
|
update ems_evaluation_scale_cognitive_relevance |
||||
|
<set> |
||||
|
<if test="evaluationId != null"> |
||||
|
evaluation_id = #{evaluationId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="scaleCode != null"> |
||||
|
scale_code = #{scaleCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
parent_id = #{parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="cognitiveCode != null"> |
||||
|
cognitive_code = #{cognitiveCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="score != null"> |
||||
|
score = #{score,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="totalScore != null"> |
||||
|
total_score = #{totalScore,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="comboId != null"> |
||||
|
combo_id = #{comboId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="sort != null"> |
||||
|
sort = #{sort,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag = #{delFlag,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.EmsEvaluationScaleCognitiveRelevance"> |
||||
|
update ems_evaluation_scale_cognitive_relevance |
||||
|
set evaluation_id = #{evaluationId,jdbcType=BIGINT}, |
||||
|
scale_code = #{scaleCode,jdbcType=VARCHAR}, |
||||
|
parent_id = #{parentId,jdbcType=BIGINT}, |
||||
|
cognitive_code = #{cognitiveCode,jdbcType=VARCHAR}, |
||||
|
score = #{score,jdbcType=DECIMAL}, |
||||
|
total_score = #{totalScore,jdbcType=DECIMAL}, |
||||
|
combo_id = #{comboId,jdbcType=BIGINT}, |
||||
|
sort = #{sort,jdbcType=INTEGER}, |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{delFlag,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,55 @@ |
|||||
|
package com.ccsens.admin.controller; |
||||
|
|
||||
|
import com.ccsens.admin.service.AmsReportService; |
||||
|
import com.ccsens.common.annotation.Anonymous; |
||||
|
import com.ccsens.common.core.domain.JsonResponse; |
||||
|
import com.ccsens.system.domain.dto.RmsDto; |
||||
|
import com.ccsens.system.domain.vo.AmsReportVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.IOException; |
||||
|
|
||||
|
/** |
||||
|
* @Author zzc |
||||
|
* @Package com.ccsens.admin.controller |
||||
|
* @Date 2026/2/12 17:48 |
||||
|
* @description: |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "量表报告单模板管理") |
||||
|
@RestController |
||||
|
@RequestMapping("/report") |
||||
|
public class ReportController { |
||||
|
|
||||
|
@Resource |
||||
|
private AmsReportService amsReportService; |
||||
|
|
||||
|
@Anonymous |
||||
|
@ApiOperation("导出个人报告") |
||||
|
@PostMapping("/exportGr") |
||||
|
public JsonResponse<AmsReportVo.Result> exportGr(@RequestBody @Validated RmsDto.ExportReport1Dto dto) throws IOException { |
||||
|
return JsonResponse.ok(amsReportService.exportGr(dto)); |
||||
|
} |
||||
|
|
||||
|
@Anonymous |
||||
|
@ApiOperation("导出医生版报告") |
||||
|
@PostMapping("/exportYs") |
||||
|
public JsonResponse<AmsReportVo.Result> exportYs(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ |
||||
|
return JsonResponse.ok(amsReportService.exportYs(dto)); |
||||
|
} |
||||
|
|
||||
|
@Anonymous |
||||
|
@ApiOperation("导出阳性版报告") |
||||
|
@PostMapping("/exportYx") |
||||
|
public JsonResponse<AmsReportVo.Result> exportYx(@RequestBody @Validated RmsDto.ExportReport1Dto dto){ |
||||
|
return JsonResponse.ok(amsReportService.exportYx(dto)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,42 @@ |
|||||
|
package com.ccsens.admin.persist.dao; |
||||
|
|
||||
|
import com.ccsens.system.domain.po.AmsPatientAnswerScore; |
||||
|
import com.ccsens.system.domain.po.QmsScaleAssConf; |
||||
|
import com.ccsens.system.domain.vo.AmsVo; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author:逗 |
||||
|
*/ |
||||
|
public interface AmsDao { |
||||
|
List<AmsVo.EvaluationStep> queryEvaluationStep(Long evaluationId); |
||||
|
|
||||
|
List<AmsVo.ScaleAchievement> getScaleAchievement(@Param("evaluationId") Long evaluationId, |
||||
|
@Param("scaleCode") String scaleCode, |
||||
|
@Param("sex")Byte sex); |
||||
|
|
||||
|
List<AmsVo.ScaleQuestionAchievement> getScaleQuestionAchievement(@Param("evaluationId") Long evaluationId, |
||||
|
@Param("scaleCode") String scaleCode, |
||||
|
@Param("sex")Byte sex); |
||||
|
|
||||
|
List<AmsVo.Option> queryOption(@Param("questionId")Long questionId, @Param("evaluationId")Long evaluationId); |
||||
|
|
||||
|
BigDecimal getTotalScoreByNPI(@Param("evaluationId")Long evaluationId); |
||||
|
|
||||
|
void delZmsAnswerScores(@Param("list")List<AmsPatientAnswerScore> amsPatientAnswerScores); |
||||
|
|
||||
|
String queryTemplate(@Param("code")String code); |
||||
|
|
||||
|
String queryScaleTypeName(@Param("code") String code); |
||||
|
|
||||
|
AmsVo.ComboVo queryComboName(@Param("code") String code, @Param("version") String version); |
||||
|
|
||||
|
QmsScaleAssConf queryScaleAssConf(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score); |
||||
|
|
||||
|
QmsScaleAssConf queryScaleAssConf1(@Param("scaleCode") String scaleCode, @Param("score") BigDecimal score, @Param("needPlan")Byte needPlan); |
||||
|
|
||||
|
List<String> queryYsfaList(@Param("scaleCode") String scaleCode); |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
package com.ccsens.admin.service; |
||||
|
|
||||
|
import com.ccsens.system.domain.dto.RmsDto; |
||||
|
import com.ccsens.system.domain.vo.AmsReportVo; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
|
||||
|
/** |
||||
|
* 报告单模板 服务层 |
||||
|
* |
||||
|
* @author zzc |
||||
|
*/ |
||||
|
public interface AmsReportService { |
||||
|
|
||||
|
/** |
||||
|
* 导出个人报告 |
||||
|
* @param dto |
||||
|
* @return |
||||
|
* @throws IOException |
||||
|
*/ |
||||
|
AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException; |
||||
|
|
||||
|
/** |
||||
|
* 导出医生报告 |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto); |
||||
|
|
||||
|
/** |
||||
|
* 导出阳性报告 |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto); |
||||
|
} |
||||
@ -0,0 +1,875 @@ |
|||||
|
package com.ccsens.admin.service.impl; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollUtil; |
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import cn.hutool.core.util.IdUtil; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import cn.hutool.http.HtmlUtil; |
||||
|
import com.ccsens.admin.persist.dao.AmsDao; |
||||
|
import com.ccsens.admin.persist.dao.HmsDao; |
||||
|
import com.ccsens.admin.service.AmsReportService; |
||||
|
import com.ccsens.admin.service.IReportInfoService; |
||||
|
import com.ccsens.admin.service.IRmsService; |
||||
|
import com.ccsens.common.constant.CultureEnum; |
||||
|
import com.ccsens.common.constant.JobEnum; |
||||
|
import com.ccsens.common.enums.BaseEnum; |
||||
|
import com.ccsens.common.utils.AsposeUtils; |
||||
|
import com.ccsens.common.utils.SecurityUtils; |
||||
|
import com.ccsens.common.utils.StringUtils; |
||||
|
import com.ccsens.system.domain.dto.RmsDto; |
||||
|
import com.ccsens.system.domain.po.*; |
||||
|
import com.ccsens.system.domain.vo.*; |
||||
|
import com.ccsens.system.persist.mapper.*; |
||||
|
import com.deepoove.poi.XWPFTemplate; |
||||
|
import com.deepoove.poi.data.*; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.File; |
||||
|
import java.io.IOException; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.nio.file.Files; |
||||
|
import java.nio.file.Paths; |
||||
|
import java.util.*; |
||||
|
import java.util.regex.Pattern; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
import static com.ccsens.common.utils.PropUtil.path; |
||||
|
import static com.ccsens.common.utils.PropUtil.reportDomain; |
||||
|
|
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class AmsReportServiceImpl implements AmsReportService { |
||||
|
|
||||
|
@Resource |
||||
|
private IReportInfoService reportInfoService; |
||||
|
@Resource |
||||
|
private AmsDao amsDao; |
||||
|
@Value("${informed.prefixWord}") |
||||
|
private String prefixWord; |
||||
|
|
||||
|
@Value("${file.reportPath}") |
||||
|
private String reportPath; |
||||
|
@Resource |
||||
|
private HmsReportConfigMapper hmsReportConfigMapper; |
||||
|
@Resource |
||||
|
private IRmsService rmsService; |
||||
|
@Resource |
||||
|
private RmsReportMapper rmsReportMapper; |
||||
|
@Resource |
||||
|
private QmsScaleMapper qmsScaleMapper; |
||||
|
@Resource |
||||
|
private QmsScaleTypeMapper qmsScaleTypeMapper; |
||||
|
@Resource |
||||
|
private EmsEvaluationMapper emsEvaluationMapper; |
||||
|
@Resource |
||||
|
private AmsPatientAnswerScoreMapper amsPatientAnswerScoreMapper; |
||||
|
@Resource |
||||
|
private HmsDoctorSignMapper hmsDoctorSignMapper; |
||||
|
@Resource |
||||
|
private HmsDao hmsDoctorDao; |
||||
|
@Resource |
||||
|
private HmsVersionMapper hmsVersionMapper; |
||||
|
@Value("${file.grPath}") |
||||
|
private String grPath; |
||||
|
@Value("${file.ysPath}") |
||||
|
private String ysPath; |
||||
|
|
||||
|
@Override |
||||
|
public AmsReportVo.Result exportGr(RmsDto.ExportReport1Dto dto) throws IOException { |
||||
|
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); |
||||
|
queryDetail.setEvaluationId(dto.getEvaluationId()); |
||||
|
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId()); |
||||
|
if (detail == null) { |
||||
|
return null; |
||||
|
} |
||||
|
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); |
||||
|
List<RmsVo.ReportScore> scores = detail.getScores(); |
||||
|
RmsVo.ReportPatient patientInfo = detail.getPatient(); |
||||
|
|
||||
|
HashMap<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
XWPFTemplate template = XWPFTemplate.compile(grPath); |
||||
|
params.put("h_name", patientInfo.getHospitalName()); |
||||
|
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
|
||||
|
params.put("p_name", patientInfo.getPatientName()); |
||||
|
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); |
||||
|
params.put("p_age", patientInfo.getPatientAge()); |
||||
|
CultureEnum cultureEnum = null; |
||||
|
// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run);
|
||||
|
try { |
||||
|
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); |
||||
|
} catch (Exception e) { |
||||
|
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
|
||||
|
//默认为初中
|
||||
|
cultureEnum = CultureEnum.YW; |
||||
|
} |
||||
|
if (cultureEnum != null) { |
||||
|
params.put("p_grade", cultureEnum.getDesc()); |
||||
|
} |
||||
|
if (patientInfo.getCareer() != null) { |
||||
|
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); |
||||
|
// params.put("p_no", patientInfo.getSerialNumber());
|
||||
|
if (jobEnum != null) { |
||||
|
params.put("p_Career", jobEnum.getDesc()); |
||||
|
} |
||||
|
} |
||||
|
params.put("p_dept", patientInfo.getDepartment()); |
||||
|
params.put("p_bedno", patientInfo.getBedNumber()); |
||||
|
params.put("p_Patient_number", patientInfo.getHospitalNumber()); |
||||
|
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); |
||||
|
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); |
||||
|
// params.put("score", detail.getScore());
|
||||
|
//AD8
|
||||
|
// if (dto.getSignId() != null) {
|
||||
|
// HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorDao.querySign(dto.getSignId());
|
||||
|
// if (emsEvaluationInformedConsent != null) {
|
||||
|
// params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create());
|
||||
|
// }
|
||||
|
// }
|
||||
|
if (dto.getSignId() != null) { |
||||
|
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); |
||||
|
if (emsEvaluationInformedConsent != null) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); |
||||
|
} |
||||
|
}else { |
||||
|
//签名信息
|
||||
|
Long userId = SecurityUtils.getUserId(); |
||||
|
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId); |
||||
|
if (CollUtil.isNotEmpty(querySigns)) { |
||||
|
HmsVo.QuerySign querySign = querySigns.get(0); |
||||
|
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
params.put("report_date", DateUtil.date(patientInfo.getReportTime())); |
||||
|
|
||||
|
//生成表格
|
||||
|
// 创建带有样式的文本
|
||||
|
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
RowRenderData headerRow = Rows.of(text1, text2, text3).create(); |
||||
|
RowRenderData titleRow = Rows.of("项目名称", "得分", "结论").create(); |
||||
|
Tables.TableBuilder of = Tables.of(headerRow, titleRow); |
||||
|
//肌少套餐结论
|
||||
|
String jsResult = addJs(scores); |
||||
|
Integer jsCount = 0, jshs = 0; |
||||
|
for (int i = 0; i < scores.size(); i++) { |
||||
|
//判断肌少量表数量
|
||||
|
if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) { |
||||
|
jsCount += 1; |
||||
|
} |
||||
|
//查询类型
|
||||
|
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); |
||||
|
String comboName = "", parentName = ""; |
||||
|
String str = ""; |
||||
|
if (comboVo != null) { |
||||
|
if (StrUtil.isNotEmpty(comboVo.getParentName())) { |
||||
|
str = comboVo.getParentName(); |
||||
|
params.put("yjzb", comboVo.getParentName()); |
||||
|
|
||||
|
} |
||||
|
if (StrUtil.isNotBlank(comboVo.getName())) { |
||||
|
if (StrUtil.isNotBlank(str)) { |
||||
|
str += "/" + comboVo.getName(); |
||||
|
} else { |
||||
|
str = comboVo.getName(); |
||||
|
} |
||||
|
params.put("ejzb", comboVo.getName()); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
String impression = ""; |
||||
|
Byte needPlan = null; |
||||
|
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { |
||||
|
//1、认知检查结果在正常范围。/认知功能受损。
|
||||
|
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
|
||||
|
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
needPlan = 1; |
||||
|
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
needPlan = 1; |
||||
|
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
needPlan = 1; |
||||
|
} else { |
||||
|
impression = "认知检查结果在正常范围"; |
||||
|
needPlan = 0; |
||||
|
} |
||||
|
} |
||||
|
//判断是否阳性 查询防治计划
|
||||
|
|
||||
|
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf1(scores.get(i).getCode(), scores.get(i).getScore(), needPlan); |
||||
|
RowRenderData row1; |
||||
|
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { |
||||
|
//需要防治
|
||||
|
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); |
||||
|
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); |
||||
|
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); |
||||
|
row1 = Rows.of( |
||||
|
textName, |
||||
|
textScore, |
||||
|
textImpression |
||||
|
).create(); |
||||
|
} else { |
||||
|
row1 = Rows.of( |
||||
|
scores.get(i).getName(), |
||||
|
scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "", |
||||
|
StrUtil.isEmpty(impression) ? qmsScaleAssConf == null ? StrUtil.isEmpty(scores.get(i).getImpression()) ? null : scores.get(i).getImpression() : qmsScaleAssConf.getResult() : impression |
||||
|
).create(); |
||||
|
} |
||||
|
//查询类型
|
||||
|
String typeName = amsDao.queryScaleTypeName(scores.get(i).getCode()); |
||||
|
// RowRenderData row1 = Rows.of(
|
||||
|
// scores.get(i).getName(),
|
||||
|
// scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "",
|
||||
|
// scores.get(i).getImpression()
|
||||
|
// ).create();
|
||||
|
if (StrUtil.isNotEmpty(typeName)) { |
||||
|
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); |
||||
|
} |
||||
|
of.addRow(row1); |
||||
|
//添加肌少套餐结论
|
||||
|
if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) { |
||||
|
//判断结论
|
||||
|
RowRenderData rowRenderData = Rows.of( |
||||
|
"肌少总结论:", |
||||
|
jsResult, |
||||
|
jsResult |
||||
|
).create(); |
||||
|
jshs = i + 3; |
||||
|
of.addRow(rowRenderData); |
||||
|
jsResult = ""; |
||||
|
} |
||||
|
|
||||
|
//生成问题表格
|
||||
|
TextRenderData text5 = Texts.of("问题描述").bold().fontSize(12).create(); |
||||
|
TextRenderData text6 = Texts.of("问题结果").bold().fontSize(12).create(); |
||||
|
TextRenderData text7 = Texts.of("得 分").bold().fontSize(12).create(); |
||||
|
// TextRenderData text8 = Texts.of("总 分").bold().fontSize(12).create();
|
||||
|
RowRenderData detailHeaderRow = Rows.of(text5, text6, text7).create(); |
||||
|
Tables.TableBuilder of1 = Tables.of(detailHeaderRow); |
||||
|
//遍历问题
|
||||
|
RmsDto.QueryReportAnswer queryReportAnswer = new RmsDto.QueryReportAnswer(); |
||||
|
queryReportAnswer.setEvaluationCode(scores.get(i).getCode()); |
||||
|
queryReportAnswer.setId(dto.getReportId()); |
||||
|
List<RmsVo.ReportDetailAnswer> reportDetailAnswerList = rmsService.queryReportAnswer(queryReportAnswer, SecurityUtils.getUserId()); |
||||
|
MergeCellRule detailMerge = null; |
||||
|
if (CollUtil.isNotEmpty(reportDetailAnswerList)) { |
||||
|
RmsVo.ReportDetailAnswer reportDetailAnswer = reportDetailAnswerList.get(0); |
||||
|
List<List<RmsVo.QuestionInfo>> collect = reportDetailAnswerList.stream().map(reportDetailAnswer1 -> reportDetailAnswer1.getQuestionList()).collect(Collectors.toList()); |
||||
|
List<RmsVo.QuestionInfo> list = new ArrayList<>(); |
||||
|
for (int j = 0; j < collect.size(); j++) { |
||||
|
list.addAll(collect.get(j)); |
||||
|
} |
||||
|
|
||||
|
for (RmsVo.QuestionInfo questionInfo : list) { |
||||
|
//查询患者答题得分
|
||||
|
BigDecimal score = new BigDecimal("0"); |
||||
|
AmsPatientAnswerScoreExample amsPatientAnswerScoreExample = new AmsPatientAnswerScoreExample(); |
||||
|
amsPatientAnswerScoreExample.createCriteria() |
||||
|
// .andPatientIdEqualTo(patientInfo.getId())
|
||||
|
.andQuestionIdEqualTo(questionInfo.getQuestionId()) |
||||
|
.andEvaluationIdEqualTo(dto.getEvaluationId()); |
||||
|
amsPatientAnswerScoreExample.setOrderByClause("id desc"); |
||||
|
List<AmsPatientAnswerScore> amsPatientAnswerScores = amsPatientAnswerScoreMapper.selectByExample(amsPatientAnswerScoreExample); |
||||
|
if (CollUtil.isNotEmpty(amsPatientAnswerScores)) { |
||||
|
score = BigDecimal.valueOf(amsPatientAnswerScores.stream().filter(e -> e.getOptionId() != null && e.getOptionId() != 0).map(AmsPatientAnswerScore::getScore).mapToDouble(BigDecimal::doubleValue).sum()); |
||||
|
} |
||||
|
//处理答案
|
||||
|
String answers = ""; |
||||
|
for (RmsVo.Answer answer : questionInfo.getAnswers()) { |
||||
|
if (StrUtil.isNotEmpty(answer.getAnswer())) { |
||||
|
answers += answer.getAnswer() + ","; |
||||
|
} |
||||
|
} |
||||
|
if (StrUtil.isNotEmpty(answers)) { |
||||
|
answers = answers.substring(0, answers.length() - 1); |
||||
|
} |
||||
|
of1.addRow(Rows.of(questionInfo.getQuestionName(), |
||||
|
StrUtil.isEmpty(answers) || "null".equals(answers) ? "" : answers, |
||||
|
score + "").create()); |
||||
|
|
||||
|
//处理指标
|
||||
|
if (comboVo != null) { |
||||
|
if (StrUtil.isNotBlank(comboVo.getName())) { |
||||
|
params.put("yjzb", comboVo.getName()); |
||||
|
} |
||||
|
if (StrUtil.isNotEmpty(comboVo.getParentName())) { |
||||
|
params.put("ejzb", comboVo.getParentName()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
TableRenderData tableData = of1 |
||||
|
.create(); |
||||
|
if (CollUtil.isNotEmpty(reportDetailAnswer.getQuestionList()) && reportDetailAnswer.getQuestionList().size() > 1) { |
||||
|
detailMerge = MergeCellRule.builder().map(MergeCellRule.Grid.of(1, 3), MergeCellRule.Grid.of(reportDetailAnswer.getQuestionList().size(), 3)).build(); |
||||
|
// of1.mergeRule(detailMerge);
|
||||
|
} |
||||
|
if (qmsScaleAssConf != null) { |
||||
|
params.put("pgjg", qmsScaleAssConf.getResult()); |
||||
|
params.put("fzjy_" + i, qmsScaleAssConf.getPlan()); |
||||
|
if (StrUtil.isNotEmpty(qmsScaleAssConf.getPlan())) { |
||||
|
params.put("fzjyFlag" + i, false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//添加中医体质辨识防治建议
|
||||
|
if ("TZBS_BZ".equals(scores.get(i).getCode()) || "TZBS_LN".equals(scores.get(i).getCode())) { |
||||
|
//查询防治建议
|
||||
|
List<String> list1 = amsDao.queryYsfaList(scores.get(i).getCode()); |
||||
|
if (CollUtil.isNotEmpty(list1)) { |
||||
|
String ysfas = list1.get(0); |
||||
|
for (String ysfa : list1) { |
||||
|
ysfas += HtmlUtil.unescape(ysfa); |
||||
|
} |
||||
|
params.put("fzjy_" + i, ysfas); |
||||
|
params.put("fzjyFlag" + i, false); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
params.put("table_" + i, tableData); |
||||
|
params.put("flag" + i, true); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
params.put("title" + i, scores.get(i).getName()); |
||||
|
} |
||||
|
|
||||
|
if (emsEvaluation.getVersion() != null) { |
||||
|
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); |
||||
|
if (hmsVersion != null) { |
||||
|
params.put("type", hmsVersion.getVersion() + "评估报告"); |
||||
|
} |
||||
|
} |
||||
|
MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 2)); |
||||
|
if (jshs > 0) { |
||||
|
map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 2)).build(); |
||||
|
} |
||||
|
TableRenderData tableData = of |
||||
|
.mergeRule(map.build()) |
||||
|
.create(); |
||||
|
params.put("table", tableData); |
||||
|
|
||||
|
|
||||
|
// Long hospitalId = SecurityUtils.getDeptId();
|
||||
|
String s = IdUtil.randomUUID(); |
||||
|
// 将表格数据放入参数中
|
||||
|
// params.put("table", tableDataList);
|
||||
|
try { |
||||
|
template.render(params); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); // 输出详细的异常信息
|
||||
|
} |
||||
|
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
|
||||
|
try { |
||||
|
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); |
||||
|
AsposeUtils.doc2pdf(aPath, pPath); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
AmsReportVo.Result result = new AmsReportVo.Result(); |
||||
|
result.setWord(filePath); |
||||
|
result.setPath(pdfPath); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 判断是否添加肌少总结论 |
||||
|
* 如果四项测试有一项没做,则跳过 |
||||
|
* |
||||
|
* @param scores |
||||
|
* @return |
||||
|
*/ |
||||
|
//
|
||||
|
//
|
||||
|
private String addJs(List<RmsVo.ReportScore> scores) { |
||||
|
List<RmsVo.ReportScore> wczl = scores.stream().filter( |
||||
|
score -> score.getCode().equals("5CZLSY") |
||||
|
).collect(Collectors.toList()); |
||||
|
List<RmsVo.ReportScore> szggj = scores.stream().filter( |
||||
|
score -> score.getCode().equals("SZGGJ") |
||||
|
).collect(Collectors.toList()); |
||||
|
List<RmsVo.ReportScore> wlcd = scores.stream().filter( |
||||
|
score -> score.getCode().equals("WLCD") |
||||
|
).collect(Collectors.toList()); |
||||
|
List<RmsVo.ReportScore> lmbs = scores.stream().filter( |
||||
|
score -> score.getCode().equals("LMBS") |
||||
|
).collect(Collectors.toList()); |
||||
|
if (CollUtil.isEmpty(wczl) || CollUtil.isEmpty(szggj) || CollUtil.isEmpty(wlcd) || CollUtil.isEmpty(lmbs)) { |
||||
|
return null; |
||||
|
} |
||||
|
QmsScaleAssConf wczlConf = amsDao.queryScaleAssConf1(wczl.get(0).getCode(), wczl.get(0).getScore(), null); |
||||
|
QmsScaleAssConf szggjConf = amsDao.queryScaleAssConf1(szggj.get(0).getCode(), szggj.get(0).getScore(), null); |
||||
|
QmsScaleAssConf wlcdConf = amsDao.queryScaleAssConf1(wlcd.get(0).getCode(), wlcd.get(0).getScore(), null); |
||||
|
QmsScaleAssConf lmbsConf = amsDao.queryScaleAssConf1(lmbs.get(0).getCode(), lmbs.get(0).getScore(), null); |
||||
|
if (wczlConf != null && szggjConf != null && wlcdConf != null && lmbsConf != null) { |
||||
|
// *四项测试结果都正常,说明没有肌少症风险
|
||||
|
// *如果四肢骨骼肌身高质量指数(ASMI)正常,肌肉力量或(及)躯体功能下降,则有肌少症风险;
|
||||
|
// *如果四项测试值全部低于标准值,则诊断为严重肌少症。
|
||||
|
// *如果四肢骨骼肌身高质量指数(ASMI)低于标准值,肌肉力量或躯体功能其中有一项低于标准值,则诊断为肌少症;
|
||||
|
// *否则有肌少症风险
|
||||
|
if (!"1".equals(wczlConf.getNeedPlan()) && !"1".equals(szggjConf.getNeedPlan()) && !"1".equals(wlcdConf.getNeedPlan()) && !"1".equals(lmbsConf.getNeedPlan())) { |
||||
|
//没有肌少症风险
|
||||
|
return "没有肌少症风险"; |
||||
|
} else if (!"1".equals(szggjConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(wczlConf.getNeedPlan())) { |
||||
|
return "有肌少症风险"; |
||||
|
} else if ("1".equals(wczlConf.getNeedPlan()) && "1".equals(wlcdConf.getNeedPlan()) && "1".equals(lmbsConf.getNeedPlan()) && "1".equals(szggjConf.getNeedPlan())) { |
||||
|
return "严重肌少症"; |
||||
|
} else if ("1".equals(szggjConf.getNeedPlan()) && ("1".equals(wlcdConf.getNeedPlan()) || "1".equals(lmbsConf.getNeedPlan()) || "1".equals(wczlConf.getNeedPlan()))) { |
||||
|
return "肌少症"; |
||||
|
} else { |
||||
|
return "有肌少症风险"; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public AmsReportVo.Result exportYs(RmsDto.ExportReport1Dto dto) { |
||||
|
Long userId = dto.getTesterId(); |
||||
|
try { |
||||
|
userId = SecurityUtils.getUserId(); |
||||
|
}catch (Exception e){ |
||||
|
log.error("获取用户ID失败",e); |
||||
|
} |
||||
|
|
||||
|
RmsReport report = rmsReportMapper.selectByPrimaryKey(dto.getReportId()); |
||||
|
if (ObjectUtil.isNotNull(report) && StrUtil.isNotBlank(report.getUrl())) { |
||||
|
AmsReportVo.Result result = new AmsReportVo.Result(); |
||||
|
result.setPath(report.getUrl()); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); |
||||
|
queryDetail.setEvaluationId(dto.getEvaluationId()); |
||||
|
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, userId); |
||||
|
if (detail == null) { |
||||
|
return null; |
||||
|
} |
||||
|
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); |
||||
|
if (emsEvaluation == null) { |
||||
|
return null; |
||||
|
} |
||||
|
List<RmsVo.ReportScore> scores = detail.getScores(); |
||||
|
RmsVo.ReportPatient patientInfo = detail.getPatient(); |
||||
|
|
||||
|
HashMap<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
XWPFTemplate template = XWPFTemplate.compile(ysPath); |
||||
|
params.put("h_name", patientInfo.getHospitalName()); |
||||
|
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
|
||||
|
params.put("p_name", patientInfo.getPatientName()); |
||||
|
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); |
||||
|
params.put("p_age", patientInfo.getPatientAge()); |
||||
|
CultureEnum cultureEnum = null; |
||||
|
// EmsEvaluationInformedConsentExample emsEvaluationInformedConsentExample = new EmsEvaluationInformedConsentExample();
|
||||
|
// emsEvaluationInformedConsentExample.createCriteria().andEvaluationIdEqualTo(dto.getEvaluationId());
|
||||
|
// emsEvaluationInformedConsentExample.setOrderByClause("id desc");
|
||||
|
// List<EmsEvaluationInformedConsent> emsEvaluationInformedConsents = emsEvaluationInformedConsentMapper.selectByExample(emsEvaluationInformedConsentExample);
|
||||
|
if (dto.getSignId() != null) { |
||||
|
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); |
||||
|
if (emsEvaluationInformedConsent != null) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); |
||||
|
} |
||||
|
}else { |
||||
|
//签名信息
|
||||
|
|
||||
|
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId); |
||||
|
if (CollUtil.isNotEmpty(querySigns)) { |
||||
|
HmsVo.QuerySign querySign = querySigns.get(0); |
||||
|
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
try { |
||||
|
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); |
||||
|
} catch (Exception e) { |
||||
|
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
|
||||
|
//默认为初中
|
||||
|
cultureEnum = CultureEnum.YW; |
||||
|
} |
||||
|
if (cultureEnum != null) { |
||||
|
params.put("p_grade", cultureEnum.getDesc()); |
||||
|
} |
||||
|
if (patientInfo.getCareer() != null) { |
||||
|
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); |
||||
|
// params.put("p_no", patientInfo.getSerialNumber());
|
||||
|
if (jobEnum != null) { |
||||
|
params.put("p_Career", jobEnum.getDesc()); |
||||
|
} |
||||
|
} |
||||
|
params.put("p_dept", patientInfo.getDepartment()); |
||||
|
params.put("p_bedno", patientInfo.getBedNumber()); |
||||
|
params.put("p_Patient_number", patientInfo.getHospitalNumber()); |
||||
|
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); |
||||
|
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); |
||||
|
// params.put("score", detail.getScore());
|
||||
|
//AD8
|
||||
|
|
||||
|
// params.put("cpy_img_url", patientInfo.getName());
|
||||
|
params.put("report_date", DateUtil.date(patientInfo.getReportTime())); |
||||
|
|
||||
|
//生成表格
|
||||
|
// 创建带有样式的文本
|
||||
|
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create();
|
||||
|
|
||||
|
RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create(); |
||||
|
|
||||
|
//肌少套餐结论
|
||||
|
String jsResult = addJs(scores); |
||||
|
Integer jsCount = 0, jshs = 0; |
||||
|
String typeName = ""; |
||||
|
RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create(); |
||||
|
Tables.TableBuilder of = Tables.of(headerRow, titleRow); |
||||
|
for (int i = 0; i < scores.size(); i++) { |
||||
|
//判断肌少量表数量
|
||||
|
if ("5CZLSY".equals(scores.get(i).getCode()) || "SZGGJ".equals(scores.get(i).getCode()) || "WLCD".equals(scores.get(i).getCode()) || "LMBS".equals(scores.get(i).getCode())) { |
||||
|
jsCount += 1; |
||||
|
} |
||||
|
//查询类型
|
||||
|
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); |
||||
|
String comboName = "", parentName = ""; |
||||
|
String str = ""; |
||||
|
if (comboVo != null) { |
||||
|
typeName = comboVo.getParentName(); |
||||
|
if (StrUtil.isNotEmpty(comboVo.getParentName())) { |
||||
|
str = comboVo.getParentName(); |
||||
|
params.put("yjzb", comboVo.getParentName()); |
||||
|
|
||||
|
} |
||||
|
if (StrUtil.isNotBlank(comboVo.getName())) { |
||||
|
if (StrUtil.isNotBlank(str)) { |
||||
|
str += "/" + comboVo.getName(); |
||||
|
} else { |
||||
|
str = comboVo.getName(); |
||||
|
} |
||||
|
params.put("ejzb", comboVo.getName()); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
String impression = ""; |
||||
|
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { |
||||
|
//1、认知检查结果在正常范围。/认知功能受损。
|
||||
|
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
|
||||
|
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else { |
||||
|
impression = "认知检查结果在正常范围"; |
||||
|
} |
||||
|
} |
||||
|
//判断是否阳性 查询防治计划
|
||||
|
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore()); |
||||
|
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { |
||||
|
//需要防治
|
||||
|
TextRenderData textStr = Texts.of(str).bold().color("FF0000").create(); |
||||
|
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); |
||||
|
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); |
||||
|
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); |
||||
|
// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create();
|
||||
|
|
||||
|
//查询一二级套餐
|
||||
|
RowRenderData row1 = Rows.of( |
||||
|
textStr, |
||||
|
textName, |
||||
|
textScore, |
||||
|
textImpression |
||||
|
).create(); |
||||
|
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { |
||||
|
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); |
||||
|
} |
||||
|
of.addRow(row1); |
||||
|
} else { |
||||
|
TextRenderData textStr = Texts.of(str).bold().create(); |
||||
|
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().create(); |
||||
|
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().create(); |
||||
|
//中医体质辨识添加结论 结论为初步印象
|
||||
|
TextRenderData textImpression = Texts.of(qmsScaleAssConf == null ? "TZBS_LN".equals(scores.get(i).getCode()) || "TZBS_BZ".equals(scores.get(i).getCode()) ? scores.get(i).getImpression() : null : qmsScaleAssConf.getResult()).bold().create(); |
||||
|
//查询一二级套餐
|
||||
|
RowRenderData row1 = Rows.of( |
||||
|
textStr, |
||||
|
textName, |
||||
|
textScore, |
||||
|
textImpression |
||||
|
).create(); |
||||
|
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { |
||||
|
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); |
||||
|
} |
||||
|
of.addRow(row1); |
||||
|
} |
||||
|
//添加肌少套餐结论
|
||||
|
if (StrUtil.isNotEmpty(jsResult) && jsCount == 4) { |
||||
|
//判断结论
|
||||
|
RowRenderData rowRenderData = Rows.of( |
||||
|
"肌少总结论:", |
||||
|
jsResult, |
||||
|
jsResult, |
||||
|
jsResult |
||||
|
).create(); |
||||
|
jshs = i + 3; |
||||
|
of.addRow(rowRenderData); |
||||
|
jsResult = ""; |
||||
|
} |
||||
|
} |
||||
|
if (emsEvaluation.getVersion() != null) { |
||||
|
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); |
||||
|
if (hmsVersion != null) { |
||||
|
params.put("type", hmsVersion.getVersion() + "评估报告"); |
||||
|
} |
||||
|
} |
||||
|
MergeCellRule.MergeCellRuleBuilder map = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3)); |
||||
|
if (jshs > 0) { |
||||
|
map.map(MergeCellRule.Grid.of(jshs, 1), MergeCellRule.Grid.of(jshs, 3)); |
||||
|
} |
||||
|
TableRenderData tableData = of |
||||
|
.mergeRule(map.build()) |
||||
|
// 居中对齐
|
||||
|
.create(); |
||||
|
params.put("table", tableData); |
||||
|
|
||||
|
|
||||
|
// Long hospitalId = SecurityUtils.getDeptId();
|
||||
|
String s = IdUtil.randomUUID(); |
||||
|
// 将表格数据放入参数中
|
||||
|
// params.put("table", tableDataList);
|
||||
|
try { |
||||
|
template.render(params); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); // 输出详细的异常信息
|
||||
|
} |
||||
|
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
|
||||
|
try { |
||||
|
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); |
||||
|
AsposeUtils.doc2pdf(aPath, pPath); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
AmsReportVo.Result result = new AmsReportVo.Result(); |
||||
|
result.setWord(filePath); |
||||
|
result.setPath(pdfPath); |
||||
|
//将生成的文件路径保存到报告单内
|
||||
|
if(ObjectUtil.isNotNull(report)){ |
||||
|
report.setUrl(pdfPath); |
||||
|
rmsReportMapper.updateByPrimaryKeySelective(report); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public AmsReportVo.Result exportYx(RmsDto.ExportReport1Dto dto) { |
||||
|
RmsDto.QueryDetail queryDetail = new RmsDto.QueryDetail(); |
||||
|
queryDetail.setEvaluationId(dto.getEvaluationId()); |
||||
|
RmsVo.ReportDetail detail = rmsService.queryReportDetail(queryDetail, SecurityUtils.getUserId()); |
||||
|
if (detail == null) { |
||||
|
return null; |
||||
|
} |
||||
|
EmsEvaluation emsEvaluation = emsEvaluationMapper.selectByPrimaryKey(dto.getEvaluationId()); |
||||
|
if (emsEvaluation == null) { |
||||
|
return null; |
||||
|
} |
||||
|
List<RmsVo.ReportScore> scores = detail.getScores(); |
||||
|
RmsVo.ReportPatient patientInfo = detail.getPatient(); |
||||
|
|
||||
|
HashMap<String, Object> params = new HashMap<>(); |
||||
|
|
||||
|
XWPFTemplate template = XWPFTemplate.compile(ysPath); |
||||
|
params.put("h_name", patientInfo.getHospitalName()); |
||||
|
// params.put("qrcode_img_url", Pictures.ofLocal(reportPath + patientInfo.getQrCodeUrl()).size(130, 130).create());
|
||||
|
params.put("p_name", patientInfo.getPatientName()); |
||||
|
params.put("p_sex", patientInfo.getSex() == 0 ? "男" : "女"); |
||||
|
params.put("p_age", patientInfo.getPatientAge()); |
||||
|
CultureEnum cultureEnum = null; |
||||
|
// BodyContainer bodyContainer = BodyContainerFactory.getBodyContainer(run);
|
||||
|
try { |
||||
|
cultureEnum = BaseEnum.codeOf(CultureEnum.class, patientInfo.getEducationalStatus().intValue()); |
||||
|
} catch (Exception e) { |
||||
|
//处理educationStatus为null的情况,后台导入的数据educationStatus为null
|
||||
|
//默认为初中
|
||||
|
cultureEnum = CultureEnum.YW; |
||||
|
} |
||||
|
if (cultureEnum != null) { |
||||
|
params.put("p_grade", cultureEnum.getDesc()); |
||||
|
} |
||||
|
if (patientInfo.getCareer() != null) { |
||||
|
JobEnum jobEnum = BaseEnum.codeOf(JobEnum.class, patientInfo.getCareer().intValue()); |
||||
|
// params.put("p_no", patientInfo.getSerialNumber());
|
||||
|
if (jobEnum != null) { |
||||
|
params.put("p_Career", jobEnum.getDesc()); |
||||
|
} |
||||
|
} |
||||
|
params.put("p_dept", patientInfo.getDepartment()); |
||||
|
params.put("p_bedno", patientInfo.getBedNumber()); |
||||
|
params.put("p_Patient_number", patientInfo.getHospitalNumber()); |
||||
|
params.put("p_Clinical_diagnosis", patientInfo.getClinicalDiagnosis()); |
||||
|
params.put("p_Inspection_date", DateUtil.format(new Date(patientInfo.getReportTime()), "yyyy-MM-dd")); |
||||
|
// params.put("score", detail.getScore());
|
||||
|
|
||||
|
if (dto.getSignId() != null) { |
||||
|
HmsDoctorSign emsEvaluationInformedConsent = hmsDoctorSignMapper.selectByPrimaryKey(dto.getSignId()); |
||||
|
if (emsEvaluationInformedConsent != null) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + emsEvaluationInformedConsent.getPath()).size(80, 40).create()); |
||||
|
} |
||||
|
}else { |
||||
|
//签名信息
|
||||
|
Long userId = SecurityUtils.getUserId(); |
||||
|
List<HmsVo.QuerySign> querySigns = hmsDoctorDao.querySign(userId); |
||||
|
if (CollUtil.isNotEmpty(querySigns)) { |
||||
|
HmsVo.QuerySign querySign = querySigns.get(0); |
||||
|
if (ObjectUtil.isNotNull(querySign) && StrUtil.isNotEmpty(querySign.getSignUrl())) { |
||||
|
params.put("cpy_img_url", Pictures.ofLocal(prefixWord + querySign.getSignUrl()).size(80, 40).create()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
// params.put("cpy_img_url", patientInfo.getName());
|
||||
|
params.put("report_date", DateUtil.date(patientInfo.getReportTime())); |
||||
|
|
||||
|
//生成表格
|
||||
|
// 创建带有样式的文本
|
||||
|
TextRenderData text1 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text2 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text3 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
TextRenderData text4 = Texts.of("评估结论").bold().fontSize(12).create(); |
||||
|
// TextRenderData text5 = Texts.of("评估结论").bold().fontSize(12).create();
|
||||
|
|
||||
|
RowRenderData headerRow = Rows.of(text1, text2, text3, text4).create(); |
||||
|
String typeName = ""; |
||||
|
RowRenderData titleRow = Rows.of("一级指标/二级指标", "量表名称", "得分", "结论").create(); |
||||
|
Tables.TableBuilder of = Tables.of(headerRow, titleRow); |
||||
|
for (int i = 0; i < scores.size(); i++) { |
||||
|
//查询类型
|
||||
|
AmsVo.ComboVo comboVo = amsDao.queryComboName(scores.get(i).getCode(), emsEvaluation.getVersion()); |
||||
|
String comboName = "", parentName = ""; |
||||
|
String str = ""; |
||||
|
if (comboVo != null) { |
||||
|
if (StrUtil.isNotEmpty(comboVo.getParentName())) { |
||||
|
str = comboVo.getParentName(); |
||||
|
params.put("yjzb", comboVo.getParentName()); |
||||
|
|
||||
|
} |
||||
|
if (StrUtil.isNotBlank(comboVo.getName())) { |
||||
|
if (StrUtil.isNotBlank(str)) { |
||||
|
str += "/" + comboVo.getName(); |
||||
|
} else { |
||||
|
str = comboVo.getName(); |
||||
|
} |
||||
|
params.put("ejzb", comboVo.getName()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
String impression = ""; |
||||
|
if (scores.get(i).getScore() != null && "MMSE".equals(scores.get(i).getCode())) { |
||||
|
//1、认知检查结果在正常范围。/认知功能受损。
|
||||
|
//依据不同教育程度制定划界分:文盲组≤19分,小学组≤22分,中学或以上组≤26分,低于划界分为认知功能受损。
|
||||
|
if (cultureEnum.getCode() == 1 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(19)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else if (cultureEnum.getCode() == 2 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(22)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else if (cultureEnum.getCode() >= 3 && scores.get(i).getScore().compareTo(BigDecimal.valueOf(26)) <= 0) { |
||||
|
impression = "认知功能受损"; |
||||
|
} else { |
||||
|
impression = "认知检查结果在正常范围"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//判断是否阳性 查询防治计划
|
||||
|
QmsScaleAssConf qmsScaleAssConf = amsDao.queryScaleAssConf(scores.get(i).getCode(), scores.get(i).getScore()); |
||||
|
if (qmsScaleAssConf != null && "1".equals(qmsScaleAssConf.getNeedPlan())) { |
||||
|
//需要防治
|
||||
|
TextRenderData textStr = Texts.of(str).bold().color("FF0000").create(); |
||||
|
TextRenderData textName = Texts.of(scores.get(i).getName()).bold().color("FF0000").create(); |
||||
|
TextRenderData textScore = Texts.of(scores.get(i).getScore() == null ? "" : scores.get(i).getScore() + "").bold().color("FF0000").create(); |
||||
|
TextRenderData textImpression = Texts.of(StrUtil.isEmpty(impression) ? qmsScaleAssConf.getResult() : impression).bold().color("FF0000").create(); |
||||
|
// TextRenderData textDescription = Texts.of(scores.get(i).getDescription()).bold().color("FF0000").create();
|
||||
|
|
||||
|
//查询一二级套餐
|
||||
|
RowRenderData row1 = Rows.of( |
||||
|
textStr, |
||||
|
textName, |
||||
|
textScore, |
||||
|
textImpression |
||||
|
).create(); |
||||
|
if (StrUtil.isNotEmpty(comboName + "/" + parentName)) { |
||||
|
of.mergeRule(MergeCellRule.builder().map(MergeCellRule.Grid.of(i + 1, i + 1), MergeCellRule.Grid.of(0, 1)).build()); |
||||
|
} |
||||
|
of.addRow(row1); |
||||
|
} |
||||
|
} |
||||
|
if (emsEvaluation.getVersion() != null) { |
||||
|
HmsVersion hmsVersion = hmsVersionMapper.selectByPrimaryKey(Long.parseLong(emsEvaluation.getVersion())); |
||||
|
if (hmsVersion != null) { |
||||
|
params.put("type", hmsVersion.getVersion() + "评估报告"); |
||||
|
} |
||||
|
} |
||||
|
MergeCellRule mergeRule = MergeCellRule.builder().map(MergeCellRule.Grid.of(0, 0), MergeCellRule.Grid.of(0, 3)).build(); |
||||
|
TableRenderData tableData = of |
||||
|
.mergeRule(mergeRule) |
||||
|
// 居中对齐
|
||||
|
.create(); |
||||
|
params.put("table", tableData); |
||||
|
|
||||
|
|
||||
|
// Long hospitalId = SecurityUtils.getDeptId();
|
||||
|
String s = IdUtil.randomUUID(); |
||||
|
// 将表格数据放入参数中
|
||||
|
// params.put("table", tableDataList);
|
||||
|
try { |
||||
|
template.render(params); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); // 输出详细的异常信息
|
||||
|
} |
||||
|
String filePath = "/profile/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pdfPath = "/profile/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
String aPath = path + "/" + "/report/" + "老年综合评估_" + s + ".docx"; |
||||
|
String pPath = path + "/" + "/report/" + "老年综合评估_" + s + ".pdf"; |
||||
|
|
||||
|
try { |
||||
|
template.writeAndClose(Files.newOutputStream(Paths.get(reportDomain + "/" + "/report/" + "老年综合评估_" + s + ".docx"))); |
||||
|
AsposeUtils.doc2pdf(aPath, pPath); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
AmsReportVo.Result result = new AmsReportVo.Result(); |
||||
|
result.setWord(filePath); |
||||
|
result.setPath(pdfPath); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
public static boolean isInteger(String str) { |
||||
|
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); |
||||
|
return pattern.matcher(str).matches(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
File diff suppressed because it is too large
@ -0,0 +1,241 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
||||
|
<mapper namespace="com.ccsens.admin.persist.dao.AmsDao"> |
||||
|
<update id="delZmsAnswerScores"> |
||||
|
update |
||||
|
ams_patient_answer_score |
||||
|
set |
||||
|
del_flag = 1 |
||||
|
where id in |
||||
|
<foreach collection="list" item="score" separator="," open="(" close=")"> |
||||
|
#{score.id} |
||||
|
</foreach> |
||||
|
</update> |
||||
|
<select id="queryEvaluationStep" resultType="com.ccsens.system.domain.vo.AmsVo$EvaluationStep"> |
||||
|
select |
||||
|
s.finish_key as scaleCode, |
||||
|
qs.`name` as scaleName, |
||||
|
s.finish_status as finishStatus, |
||||
|
s.sort as sort |
||||
|
from ems_evaluation_step s |
||||
|
left join qms_scale qs on s.finish_key = qs.`code` and qs.del_flag = 0 |
||||
|
where s.evaluation_id = #{evaluationId} |
||||
|
order by s.sort |
||||
|
</select> |
||||
|
<select id="getScaleAchievement" resultType="com.ccsens.system.domain.vo.AmsVo$ScaleAchievement"> |
||||
|
|
||||
|
SELECT |
||||
|
qs.`code` AS scaleCode, |
||||
|
qs.`name` AS scaleName, |
||||
|
sum(q.score) as score, |
||||
|
count( DISTINCT q.questionId ) AS totalNum, |
||||
|
count( DISTINCT q.answerQuestionId ) AS completedNum |
||||
|
FROM |
||||
|
ems_evaluation_scale_relevance esr |
||||
|
LEFT JOIN qms_scale qs ON esr.scale_code = qs.`code` |
||||
|
LEFT JOIN( |
||||
|
|
||||
|
SELECT |
||||
|
if(pas.question_id is not null and pas.question_id != qq.id,qq.id,pas.question_id) as answerQuestionId, |
||||
|
qq.id as questionId, |
||||
|
qq.scale_code, |
||||
|
pas.evaluation_id, |
||||
|
if((qcd.total_score = - 1 AND qcd.type = 4) or score.cognitive_code = 'SZJ', 0, pas.score) as score |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
eqv.id as qvId, |
||||
|
Max(vq.version) as maxVersion, |
||||
|
q.id, |
||||
|
q.scale_code, |
||||
|
GROUP_CONCAT(sq.id SEPARATOR ',') as subList |
||||
|
FROM |
||||
|
qms_question q |
||||
|
|
||||
|
LEFT JOIN qms_question vq on q.scale_code = vq.scale_code and q.sort = vq.sort and vq.del_flag = 0 |
||||
|
LEFT JOIN ems_evaluation_question_version eqv on eqv.scale_code = q.scale_code and eqv.sort = q.sort and eqv.version = q.version and eqv.evaluation_id = #{evaluationId} |
||||
|
LEFT JOIN qms_question sq on sq.relation_id = q.id and sq.del_flag = 0 |
||||
|
WHERE |
||||
|
q.del_flag = 0 |
||||
|
AND q.relation_id = 0 |
||||
|
AND q.del_flag = 0 |
||||
|
<if test="sex != null"> |
||||
|
and q.sex = #{sex} or q.sex is null |
||||
|
</if> |
||||
|
GROUP BY q.id |
||||
|
|
||||
|
)qq |
||||
|
LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList)) |
||||
|
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId} |
||||
|
LEFT JOIN qms_question score on pas.question_id = score.id and score.del_flag = 0 |
||||
|
LEFT JOIN qms_cognitive_domain qcd on score.cognitive_code = qcd.`code` and qcd.del_flag = 0 and qcd.type = 4 |
||||
|
WHERE |
||||
|
((qq.maxVersion = 1 and qq.qvId is null) or (qq.maxVersion > 1 and qq.qvId is not null)) |
||||
|
) q on q.scale_code = esr.scale_code |
||||
|
<where> |
||||
|
<if test="scaleCode != null and scaleCode != ''"> |
||||
|
and esr.scale_code = #{scaleCode} |
||||
|
</if> |
||||
|
AND esr.evaluation_id = #{evaluationId} |
||||
|
</where> |
||||
|
GROUP BY esr.sort, esr.scale_code |
||||
|
</select> |
||||
|
<select id="getScaleQuestionAchievement" |
||||
|
resultType="com.ccsens.system.domain.vo.AmsVo$ScaleQuestionAchievement"> |
||||
|
|
||||
|
SELECT |
||||
|
qq.sort AS num, |
||||
|
<!--IF( pas.id IS NULL, FALSE, TRUE ) AS complete,--> |
||||
|
if(count(DISTINCT pas.id) > 0,TRUE, FALSE ) AS complete, |
||||
|
pas.question_id |
||||
|
FROM |
||||
|
|
||||
|
( |
||||
|
SELECT |
||||
|
q.id, |
||||
|
q.scale_code, |
||||
|
q.sort, |
||||
|
q.relation_id, |
||||
|
GROUP_CONCAT(sq.id SEPARATOR ',') as subList |
||||
|
FROM |
||||
|
qms_question q |
||||
|
LEFT JOIN qms_question sq on sq.relation_id = q.id and sq.del_flag = 0 |
||||
|
WHERE |
||||
|
q.del_flag = 0 |
||||
|
AND q.relation_id = 0 |
||||
|
<if test="sex != null"> |
||||
|
and (q.sex = #{sex} or q.sex is null) |
||||
|
</if> |
||||
|
GROUP BY q.id |
||||
|
)qq |
||||
|
LEFT JOIN ams_patient_answer_score pas on (pas.question_id = qq.id or FIND_IN_SET(pas.question_id, qq.subList)) |
||||
|
and pas.type IN ( 0, 2 ) and pas.del_flag = 0 and pas.evaluation_id = #{evaluationId} |
||||
|
|
||||
|
WHERE |
||||
|
qq.scale_code = #{scaleCode} |
||||
|
AND qq.relation_id = 0 |
||||
|
GROUP BY |
||||
|
qq.sort |
||||
|
ORDER BY |
||||
|
qq.sort; |
||||
|
</select> |
||||
|
<select id="queryOption" resultType="com.ccsens.system.domain.vo.AmsVo$Option"> |
||||
|
select t1.id, t1.type, t1.question_id, t1.name, t1.score, t1.display, |
||||
|
case when t1.type = 'hidden' then 0 when t2.id is null then 0 else 1 end as choose , |
||||
|
if(t2.type = 3, null, t2.answer) as answer, |
||||
|
t2.score AS t2content, |
||||
|
t3.id as descId, t3.type as descType, t3.content |
||||
|
from qms_question_option t1 left join ams_patient_answer_score t2 on t1.id = t2.option_id and (t2.id is null or (t2.evaluation_id = #{evaluationId} and t2.del_flag = 0)) |
||||
|
left join (select * from qms_question_option_desc where del_flag = 0) t3 on t1.id = t3.option_id |
||||
|
where t1.question_id = #{questionId} |
||||
|
and t1.del_flag = 0 |
||||
|
group by t1.id |
||||
|
order by t1.sort, t3.sort |
||||
|
</select> |
||||
|
<select id="getTotalScoreByNPI" resultType="java.math.BigDecimal"> |
||||
|
SELECT |
||||
|
sum( score ) AS score |
||||
|
FROM |
||||
|
ams_patient_answer_score |
||||
|
WHERE |
||||
|
evaluation_id = #{evaluationId} |
||||
|
and |
||||
|
question_parent_code = 'NPI' |
||||
|
AND option_name IN ( 'carer', 'result' ) |
||||
|
AND del_flag = 0 |
||||
|
</select> |
||||
|
<select id="queryTemplate" resultType="java.lang.String"> |
||||
|
select url from ams_report_template where code = #{code} and del_flag = 0 ORDER BY create_time desc limit 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryScaleTypeName" resultType="java.lang.String"> |
||||
|
select t.name |
||||
|
from |
||||
|
qms_scale_type t |
||||
|
left join qms_scale t1 on t.id = t1.type_id |
||||
|
where t1.code = #{code} and t1.del_flag = 0 and t.del_flag = 0 |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryComboName" resultType="com.ccsens.system.domain.vo.AmsVo$ComboVo"> |
||||
|
SELECT |
||||
|
c.name, |
||||
|
c1.name as parentName |
||||
|
FROM |
||||
|
hms_combo c |
||||
|
LEFT JOIN |
||||
|
hms_combo_scale_relevance r on c.id = r.combo_id |
||||
|
LEFT JOIN |
||||
|
hms_combo c1 on c1.id = c.parent_id |
||||
|
WHERE |
||||
|
r.scale_code = #{code} and c.version = #{version} |
||||
|
limit 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryScaleAssConf" resultType="com.ccsens.system.domain.po.QmsScaleAssConf"> |
||||
|
select |
||||
|
c.id, |
||||
|
c.scale_id as scaleId, |
||||
|
c.start_score as startScore, |
||||
|
c.end_score as endScore, |
||||
|
c.state, |
||||
|
c.sort, |
||||
|
c.score_type as scoreType, |
||||
|
c.result, |
||||
|
c.og_result as ogResult, |
||||
|
c.rule_type as ruleType, |
||||
|
c.need_plan as needPlan, |
||||
|
c.plan, |
||||
|
c.remark |
||||
|
from |
||||
|
qms_scale_ass_conf c |
||||
|
left join qms_scale q on q.id = c.scale_id and q.del_flag = 0 |
||||
|
where |
||||
|
c.start_score <= #{score} and c.end_score >= #{score} |
||||
|
and c.state = '1' and c.del_flag = 0 |
||||
|
and q.code = #{scaleCode} |
||||
|
group by c.id |
||||
|
limit 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryScaleAssConf1" resultType="com.ccsens.system.domain.po.QmsScaleAssConf"> |
||||
|
select |
||||
|
c.id, |
||||
|
c.scale_id as scaleId, |
||||
|
c.start_score as startScore, |
||||
|
c.end_score as endScore, |
||||
|
c.state, |
||||
|
c.sort, |
||||
|
c.score_type as scoreType, |
||||
|
c.result, |
||||
|
c.og_result as ogResult, |
||||
|
c.rule_type as ruleType, |
||||
|
c.need_plan as needPlan, |
||||
|
c.plan, |
||||
|
c.remark |
||||
|
from |
||||
|
qms_scale_ass_conf c |
||||
|
left join qms_scale q on q.id = c.scale_id and q.del_flag = 0 |
||||
|
where |
||||
|
c.state = '1' |
||||
|
and c.del_flag = 0 |
||||
|
<if test="needPlan != null"> |
||||
|
and c.need_plan = #{needPlan} |
||||
|
</if> |
||||
|
<if test="needPlan == null"> |
||||
|
and c.start_score <= #{score} and c.end_score >= #{score} |
||||
|
</if> |
||||
|
and q.code = #{scaleCode} |
||||
|
group by c.id |
||||
|
limit 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="queryYsfaList" resultType="java.lang.String"> |
||||
|
select |
||||
|
y.consti_ysfa_template |
||||
|
from |
||||
|
tzbs_qms_scale_consti c |
||||
|
left join tzbs_qms_scale_consti_ysfa y on c.consti_code = y.consti_code and y.del_flag = 0 |
||||
|
where |
||||
|
c.scale_code = #{scaleCode} |
||||
|
</select> |
||||
|
</mapper> |
||||
File diff suppressed because it is too large
@ -0,0 +1,23 @@ |
|||||
|
package com.ccsens.client.persist.dao; |
||||
|
|
||||
|
import com.ccsens.system.domain.vo.RmsVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author zzc |
||||
|
* @Package com.ccsens.client.persist.dao |
||||
|
* @Date 2026/2/28 9:30 |
||||
|
* @description: |
||||
|
*/ |
||||
|
public interface EmsDao { |
||||
|
|
||||
|
/** |
||||
|
* 查询报告分数 |
||||
|
* @param reportScores |
||||
|
* @param evaluation |
||||
|
* @return |
||||
|
*/ |
||||
|
List<RmsVo.ReportScore> queryReportScore(List<RmsVo.ReportScore> reportScores, long evaluation); |
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue