zhizhi wu 4 years ago
parent
commit
f0a6fcfbc2
  1. 2
      question/src/main/java/com/ccsens/question/bean/dto/QuestionDto.java
  2. 32
      question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java
  3. 10
      question/src/main/java/com/ccsens/question/service/QuestionService.java
  4. 10
      question/src/main/java/com/ccsens/question/uitl/Constant.java
  5. 4
      question/src/main/resources/application.yml
  6. 6
      question/src/main/resources/druid-dev.yml
  7. 7
      question/src/main/resources/mapper_dao/HtPatientReportDao.xml
  8. 2
      util/src/main/java/com/ccsens/util/PdfUtil.java

2
question/src/main/java/com/ccsens/question/bean/dto/QuestionDto.java

@ -115,6 +115,8 @@ public class QuestionDto {
@NotBlank(message = "上级code不能为空") @NotBlank(message = "上级code不能为空")
@ApiModelProperty("上级code") @ApiModelProperty("上级code")
private String code; private String code;
@ApiModelProperty("是否显示报告单 0:否 1:是,默认为是")
private byte showReport = 1;
} }
} }

32
question/src/main/java/com/ccsens/question/bean/vo/PatientReportVo.java

@ -142,23 +142,23 @@ public class PatientReportVo {
//第一栏 //第一栏
rows.add( rows.add(
fillRow( fillRow(
"姓名:" + this.patientName, "姓名:" + (StrUtil.isEmpty(this.patientName) ? "" : this.patientName),
"性别:" + (this.sex == 0 ? "男" : "女"), "性别:" + (this.sex == null ? "" : this.sex == 0 ? "男" : "女"),
"年龄:" + this.patientAge + " 岁") "年龄:" + (this.patientAge != null && this.patientAge != 0 ? this.patientAge + " 岁" : ""))
); );
//第二栏 //第二栏
rows.add( rows.add(
fillRow( fillRow(
"文化程度:" + this.educationalStatusUnit + "年", "文化程度:" + (StrUtil.isEmpty(this.educationalStatusUnit) ? "" : this.educationalStatusUnit + "年"),
"编号:" + this.serialNumber, "编号:" + (StrUtil.isEmpty(this.serialNumber) ? "" : this.serialNumber),
"职业:" + careerMap.get(this.career)) "职业:" + (this.career != null ? careerMap.get(this.career) : ""))
); );
//第三栏 //第三栏
rows.add( rows.add(
fillRow( fillRow(
"科别:" + this.department, "科别:" + (StrUtil.isEmpty(this.department) ? "" : this.department),
"床号:" + this.bedNumber, "床号:" + (StrUtil.isEmpty(this.bedNumber) ? "" : this.bedNumber),
"病案号:" + this.hospitalNumber) "病案号:" + (StrUtil.isEmpty(this.hospitalNumber) ? "" : this.hospitalNumber))
); );
//第四栏 //第四栏
// Date date = null; // Date date = null;
@ -169,7 +169,7 @@ public class PatientReportVo {
rows.add( rows.add(
fillRow( fillRow(
"临床诊断:" + this.clinicalDiagnosis, "临床诊断:" + (StrUtil.isEmpty(this.clinicalDiagnosis) ? "" : this.clinicalDiagnosis),
"","") "","")
// "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd"))) // "检查日期:" + (date == null ? "" : DateUtil.format(date, "yyyy-MM-dd")))
); );
@ -282,11 +282,11 @@ public class PatientReportVo {
this.subReport.forEach(reportScore -> { this.subReport.forEach(reportScore -> {
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : ""); String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
boolean isLast = npi.equalsIgnoreCase(this.code) && this.subReport.indexOf(reportScore) == this.subReport.size() - 1; boolean isLast = npi.equalsIgnoreCase(this.code) && this.subReport.indexOf(reportScore) == this.subReport.size() - 1;
fillRow(row1,row2, reportScore.getName(), score, mmse.equalsIgnoreCase(this.code), isLast, npi.equalsIgnoreCase(this.code) ? new int[]{3,3} : null); fillRow(row1,row2, reportScore.getName(), score, isLast, npi.equalsIgnoreCase(this.code) ? new int[]{3,3} : null);
}); });
// 总分 // 总分
if (mmse.equalsIgnoreCase(this.code)) { if (mmse.equalsIgnoreCase(this.code)) {
fillRow(row1,row2, "总分", (this.score == null ? "" : this.score) + (this.totalScore > 0 ? "/" + this.totalScore : ""), mmse.equalsIgnoreCase(this.code), true); fillRow(row1,row2, "总分", (this.score == null ? "" : this.score) + (this.totalScore > 0 ? "/" + this.totalScore : ""), true);
} }
rows.add(row1); rows.add(row1);
rows.add(row2); rows.add(row2);
@ -305,10 +305,10 @@ public class PatientReportVo {
ReportScore reportScore = this.subReport.get(i); ReportScore reportScore = this.subReport.get(i);
String jy = "JY"; String jy = "JY";
if (jy.equalsIgnoreCase(reportScore.getCode())) { if (jy.equalsIgnoreCase(reportScore.getCode())) {
fillRow(row1, row2, reportScore.getName(), " ", false, false, i == 0 ? new int[]{2,2}: null); fillRow(row1, row2, reportScore.getName(), " ", false, i == 0 ? new int[]{2,2}: null);
} else { } else {
String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : ""); String score = (reportScore.score == null ? "" : reportScore.score) + (reportScore.getTotalScore() > 0 ? "/" + reportScore.getTotalScore() : "");
fillRow(row1, row2, reportScore.getName(), score, false, false, i == 0 ? new int[]{2,2}: null); fillRow(row1, row2, reportScore.getName(), score, false, i == 0 ? new int[]{2,2}: null);
} }
} }
PdfUtil.Cell scoreNameCell = new PdfUtil.Cell(); PdfUtil.Cell scoreNameCell = new PdfUtil.Cell();
@ -392,11 +392,11 @@ public class PatientReportVo {
// } // }
// } // }
private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, boolean isTop, boolean isRight, int... colspan){ private void fillRow(PdfUtil.Row row1, PdfUtil.Row row2, String name, String score, boolean isRight, int... colspan){
//名称 //名称
PdfUtil.Cell cell1 = new PdfUtil.Cell(); PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(name); cell1.setContent(name);
cell1.setBorderTop(isTop? 1 : 0); // cell1.setBorderTop(isTop? 1 : 0);
cell1.setBorderRight(isRight? 1 : 0); cell1.setBorderRight(isRight? 1 : 0);
cell1.setColSpan(colspan == null || colspan.length == 0 ? 1 : colspan[0]); cell1.setColSpan(colspan == null || colspan.length == 0 ? 1 : colspan[0]);
row1.addCell(cell1); row1.addCell(cell1);

10
question/src/main/java/com/ccsens/question/service/QuestionService.java

@ -803,6 +803,14 @@ public class QuestionService implements IQuestionService {
*/ */
@Override @Override
public List<QuestionVo.ReportCode> queryReportCode(QuestionDto.QueryReportCode param, Long userId) { public List<QuestionVo.ReportCode> queryReportCode(QuestionDto.QueryReportCode param, Long userId) {
return htReportDao.queryReportCode(param.getCode()); List<QuestionVo.ReportCode> codes = htReportDao.queryReportCode(param.getCode());
if (param.getShowReport() == Constant.STATUS_YES) {
log.info("添加生成报告单");
QuestionVo.ReportCode code = new QuestionVo.ReportCode();
code.setCode("BGDSC");
code.setName("报告单编辑");
codes.add(code);
}
return codes;
} }
} }

10
question/src/main/java/com/ccsens/question/uitl/Constant.java

@ -20,6 +20,11 @@ public class Constant {
public static final String VIDEO = ".flv,swf,mkv,avi,rm,rmvb,mpeg,mpg,.ogg,ogv,mov,wmv,mp4,webm,mp3,wav,mid,.wma"; public static final String VIDEO = ".flv,swf,mkv,avi,rm,rmvb,mpeg,mpg,.ogg,ogv,mov,wmv,mp4,webm,mp3,wav,mid,.wma";
/**上传图片访问路径*/ /**上传图片访问路径*/
public static final String UPLOAD_URL = "uploads/"; public static final String UPLOAD_URL = "uploads/";
/**状态:是*/
public static final byte STATUS_YES = 1;
/**状态:否*/
public static final byte STATUS_NO = 0;
/**病友画图轨迹颜色*/ /**病友画图轨迹颜色*/
public static final class LineColour { public static final class LineColour {
@ -55,10 +60,11 @@ public class Constant {
public final static String DOCTOR_PARAM = "doctor"; public final static String DOCTOR_PARAM = "doctor";
public final static byte SEX_MAN = 0; public final static byte SEX_MAN = 0;
public final static byte SEX_WOMAN = 1; public final static byte SEX_WOMAN = 1;
/**删除*/ /**删除*/
public final static byte IS_DEL = 1; public final static byte IS_DEL = 1;
public final static class Rule { public final static class Rule {
public static final byte SMALL = 0; public static final byte SMALL = 0;
public static final String SMALL_NUM = "small"; public static final String SMALL_NUM = "small";

4
question/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: green active: dev
include: common, util-green include: common, util-dev

6
question/src/main/resources/druid-dev.yml

@ -15,7 +15,7 @@ spring:
maxWait: 60000 maxWait: 60000
minEvictableIdleTimeMillis: 300000 minEvictableIdleTimeMillis: 300000
minIdle: 5 minIdle: 5
password: b3fd300ad4694070007fdcca961c4018211dc53235dd806ad62abc0cc0abb8e5 password: 1b01d55a27843cfc487ce8dd6915fc22
poolPreparedStatements: true poolPreparedStatements: true
servletLogSlowSql: true servletLogSlowSql: true
servletLoginPassword: 111111 servletLoginPassword: 111111
@ -27,7 +27,7 @@ spring:
testOnReturn: false testOnReturn: false
testWhileIdle: true testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000 timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/question?useUnicode=true&characterEncoding=UTF-8 url: jdbc:mysql://49.232.6.143:3306/question?useUnicode=true&characterEncoding=UTF-8
username: root username: root
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
env: CCSENS_HT env: CCSENS_ENTERPRISE

7
question/src/main/resources/mapper_dao/HtPatientReportDao.xml

@ -40,9 +40,10 @@
<select id="queryReportResult" resultMap="BaseResultMap"> <select id="queryReportResult" resultMap="BaseResultMap">
select r.*, d.name as doctor_name, p.name as patient_name, p.sex, p.educational_status, p.educational_status_unit, p.career, p.hospital_number, p.patient_number select r.*, d.name as doctor_name, p.name as patient_name, p.sex, p.educational_status, p.educational_status_unit, p.career, p.hospital_number, p.patient_number
from t_ht_patient_report r, t_ht_patient p, t_ht_doctor d from t_ht_patient_report r left join t_ht_patient p on r.patient_id = p.id and p.is_del = 0
where r.patient_id = p.id and r.doctor_id = d.id and r.id = #{id, jdbcType=BIGINT} left join t_ht_doctor d on r.doctor_id = d.id and d.is_del = 0
and r.is_del = 0 and p.is_del = 0 and d.is_del = 0 where r.id = #{id, jdbcType=BIGINT}
and r.is_del = 0
</select> </select>
<select id="queryReportScore" resultMap="ScoreMap"> <select id="queryReportScore" resultMap="ScoreMap">
select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, sum(t2.score) as score select t1.code,t1.name, t1.description, t1.total_score, t1.remark,t1.type,t1.parent_code, sum(t2.score) as score

2
util/src/main/java/com/ccsens/util/PdfUtil.java

@ -129,7 +129,7 @@ public class PdfUtil {
for (int i = 0; i < row.cells.size(); i++) { for (int i = 0; i < row.cells.size(); i++) {
Cell cell = row.cells.get(i); Cell cell = row.cells.get(i);
PdfPCell pdfpCell = new PdfPCell(new Phrase(cell.content,font)); PdfPCell pdfpCell = new PdfPCell(new Phrase(cell.content,font));
pdfpCell.setBorderWidthTop(cell.borderTop == null ? 0 : cell.borderTop); pdfpCell.setBorderWidthTop(j == 0 && cell.borderTop == null && cell.borderBottom != null ? cell.borderBottom : cell.borderTop == null ? 0 : cell.borderTop);
pdfpCell.setBorderWidthLeft(cell.borderLeft == null ? 0 : cell.borderLeft); pdfpCell.setBorderWidthLeft(cell.borderLeft == null ? 0 : cell.borderLeft);
pdfpCell.setBorderWidthRight(cell.borderRight == null ? 0 : cell.borderRight); pdfpCell.setBorderWidthRight(cell.borderRight == null ? 0 : cell.borderRight);
pdfpCell.setBorderWidthBottom(cell.borderBottom == null ? 0 : cell.borderBottom); pdfpCell.setBorderWidthBottom(cell.borderBottom == null ? 0 : cell.borderBottom);

Loading…
Cancel
Save