Browse Source

20210527

sd
zy_Java 4 years ago
parent
commit
00c5b310ff
  1. 2
      cloudutil/src/main/resources/application-util-prod.yml
  2. 16
      ht/src/main/java/com/ccsens/ht/api/PatientReportExportController.java
  3. 2
      ht/src/main/java/com/ccsens/ht/bean/dto/QuestionDto.java
  4. 6
      ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java
  5. 2
      ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java
  6. 2
      ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java
  7. 118
      ht/src/main/java/com/ccsens/ht/service/ExportService.java
  8. 8
      ht/src/main/java/com/ccsens/ht/service/IExportService.java
  9. 8
      ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java
  10. 42
      ht/src/main/java/com/ccsens/ht/service/PatientReportService.java
  11. 12
      ht/src/main/java/com/ccsens/ht/service/QuestionService.java
  12. 5
      ht/src/main/java/com/ccsens/ht/uitl/Constant.java
  13. 4
      ht/src/main/resources/application.yml
  14. 5
      ht/src/main/resources/druid-prod.yml
  15. 2
      ht/src/main/resources/mapper_dao/HtQuestionDao.xml
  16. 2
      ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml
  17. 1
      ht/src/main/resources/mapper_dao/HtReportDao.xml
  18. 9
      util/src/test/java/com/ccsens/util/Base64Test.java

2
cloudutil/src/main/resources/application-util-prod.yml

@ -21,7 +21,7 @@ eureka:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@192.144.182.42:7010/eureka/
defaultZone: http://admin:admin@121.36.3.207:7010/eureka/
defaultZone: http://admin:admin@81.70.54.64:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true

16
ht/src/main/java/com/ccsens/ht/api/PatientReportExportController.java

@ -69,6 +69,22 @@ public class PatientReportExportController {
return JsonResponse.newInstance().ok(export);
}
@MustLogin
@DoctorAudit
@ApiOperation(value = "导出指定类型的量表",notes = "导出指定量表")
@ApiImplicitParams({
@ApiImplicitParam(name = "json", value = "导出指定量表", required = true)
})
@RequestMapping(value="/exportByCode", method = RequestMethod.POST)
public JsonResponse<PatientReportVo.Export> exportByCode(@RequestBody @ApiParam @Valid QueryDto<PatientReportDto.ExportCode> param) {
//查询报告单信息
log.info("导出指定类型的量表:{}", param);
String path = exportService.exportByCode(param.getParam(), param.getUserId());
log.info("文件路径:{}", path);
PatientReportVo.Export export = new PatientReportVo.Export();
export.setPath(path);
return JsonResponse.newInstance().ok(export);
}
@MustLogin
@DoctorAudit

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

@ -53,6 +53,8 @@ public class QuestionDto {
private Long id;
@ApiModelProperty("答题时间")
private Long answerTime;
@ApiModelProperty("得分")
private BigDecimal score;
}
@Data

6
ht/src/main/java/com/ccsens/ht/bean/vo/QuestionVo.java

@ -276,10 +276,12 @@ public class QuestionVo {
private Integer score;
@ApiModelProperty("显示")
private String display;
@ApiModelProperty("答案")
@ApiModelProperty("画图(路径)")
private String answer;
@ApiModelProperty("是否选中")
private Byte choose;
@ApiModelProperty("文本答案")
private String content;
@ApiModelProperty("选项补充")
private List<OptionDesc> optionDescList;
@ -488,6 +490,8 @@ public class QuestionVo {
private long fiveLongLinesTime;
@ApiModelProperty("前5笔长笔画率(前5个笔画中长笔画所占比率)")
private BigDecimal longLineRate;
@ApiModelProperty("平均绘图速度")
private double aveSpeed;
}

2
ht/src/main/java/com/ccsens/ht/persist/dao/HtPatientReportDao.java

@ -129,4 +129,6 @@ public interface HtPatientReportDao extends HtPatientReportMapper {
* @return 报告单分数 mmse 分类 moca 试题和分数 其他总分
*/
List<PatientReportVo.Analyse> queryReportAnalyseScore(@Param("ids") List<Long> ids);
}

2
ht/src/main/java/com/ccsens/ht/persist/dao/HtReportDao.java

@ -53,4 +53,6 @@ public interface HtReportDao extends HtReportMapper {
* @return report+record
*/
QuestionVo.Report queryReportAndRecord(@Param("code") String code, @Param("patientReportId") Long patientReportId);
}

118
ht/src/main/java/com/ccsens/ht/service/ExportService.java

@ -5,11 +5,10 @@ import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.ht.bean.dto.PatientReportDto;
import com.ccsens.ht.bean.po.HtPatientReport;
import com.ccsens.ht.bean.po.HtReportRelevance;
import com.ccsens.ht.bean.po.HtReportRelevanceExample;
import com.ccsens.ht.bean.po.*;
import com.ccsens.ht.bean.vo.PatientReportVo;
import com.ccsens.ht.persist.dao.HtPatientReportDao;
import com.ccsens.ht.persist.dao.HtReportDao;
import com.ccsens.ht.persist.mapper.HtReportRelevanceMapper;
import com.ccsens.ht.uitl.Constant;
import com.ccsens.util.CodeEnum;
@ -22,6 +21,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@ -35,6 +35,8 @@ public class ExportService implements IExportService {
@Resource
private HtPatientReportDao htPatientReportDao;
@Resource
private HtReportDao htReportDao;
@Resource
private HtReportRelevanceMapper reportRelevanceMapper;
@Resource
private IPatientReportService patientReportService;
@ -43,7 +45,7 @@ public class ExportService implements IExportService {
@Override
public String exportReport(PatientReportDto.QueryDetail param, Long userId) {
if(StrUtil.isBlank(param.getReport())){
if (StrUtil.isBlank(param.getReport())) {
param.setReport("REPORT1.0");
}
log.info("根据报告单类型导出报告单:{}, 操作用户:{}", param, userId);
@ -59,9 +61,9 @@ public class ExportService implements IExportService {
HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample();
relevanceExample.createCriteria().andReportIdEqualTo(param.getId()).andReportCodeEqualTo(param.getReport());
List<HtReportRelevance> reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample);
if(CollectionUtil.isNotEmpty(reportRelevanceList)){
if (CollectionUtil.isNotEmpty(reportRelevanceList)) {
reportRelevance = reportRelevanceList.get(0);
}else {
} else {
reportRelevance = new HtReportRelevance();
reportRelevance.setId(snowflake.nextId());
reportRelevance.setReportCode(param.getReport());
@ -79,17 +81,17 @@ public class ExportService implements IExportService {
}
log.info("报告单和试题信息 {}", detail);
//添加受试者合作评分和初步印象
PatientReportVo.ReprotPatient patient = detail.getPatient();
patient.setWorkingScore(ObjectUtil.isNull(reportRelevance.getSocre()) ? 0 : reportRelevance.getSocre());
patient.setInitialImpression(reportRelevance.getImpression());
// PatientReportVo.ReprotPatient patient = detail.getPatient();
// patient.setWorkingScore(ObjectUtil.isNull(reportRelevance.getSocre()) ? 0 : reportRelevance.getSocre());
// patient.setInitialImpression(reportRelevance.getImpression());
//生成写入pdf数据
List<PdfUtil.Row> content = new ArrayList<>();
switch (param.getReport()){
switch (param.getReport()) {
case Constant.Ht.Report.PARENT_CODE_2:
case Constant.Ht.Report.PARENT_CODE_3:
writeParentCode2(content,detail.getScores());
writeParentCode2(content, detail.getScores());
//添加初步印象和受试者合作评分
addScoreAndImpression(detail, content);
addScoreAndImpression(detail.getPatient().getInitialImpression(), content);
//添加测评员和报告日期
initLast(content, 2);
break;
@ -121,9 +123,77 @@ public class ExportService implements IExportService {
return path;
}
private void addScoreAndImpression(PatientReportVo.ReprotDetail detail, List<PdfUtil.Row> content) {
@Override
public String exportByCode(PatientReportDto.ExportCode param, Long userId) {
if (StrUtil.isBlank(param.getCode())) {
return null;
}
log.info("导出指定类型的量表:{}, 操作用户:{}", param, userId);
//查看当前类型属于哪个报告单
String report = "";
HtReportExample reportExample = new HtReportExample();
reportExample.createCriteria().andCodeEqualTo(param.getCode());
List<HtReport> reportList = htReportDao.selectByExample(reportExample);
if (CollectionUtil.isEmpty(reportList)) {
report = reportList.get(0).getParentCode();
}
// //查询报告单类型关联的信息
// HtReportRelevance reportRelevance;
// HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample();
// relevanceExample.createCriteria().andReportIdEqualTo(param.getId()).andReportCodeEqualTo(report);
// List<HtReportRelevance> reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample);
// if(CollectionUtil.isNotEmpty(reportRelevanceList)){
// reportRelevance = reportRelevanceList.get(0);
// }else {
// reportRelevance = new HtReportRelevance();
// reportRelevance.setId(snowflake.nextId());
// reportRelevance.setReportCode(report);
// reportRelevance.setReportId(param.getId());
// reportRelevanceMapper.insertSelective(reportRelevance);
// }
//查看报告单和试题分数信息
// PatientReportVo.ReprotDetail detail = patientReportService.queryReportDetail(param, userId);
// if (detail == null) {
// throw new BaseException(CodeEnum.REPORT_NOT_FOUND);
// }
//查询报告单信息和病人信息
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(param.getId());
//查询报告单的关联信息
HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample();
relevanceExample.createCriteria().andReportIdEqualTo(param.getId()).andReportCodeEqualTo(report);
List<HtReportRelevance> reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample);
if (CollectionUtil.isNotEmpty(reportRelevanceList)) {
reportPatient.setWorkingScore(ObjectUtil.isNull(reportRelevanceList.get(0).getSocre()) ? 0 : reportRelevanceList.get(0).getSocre());
reportPatient.setInitialImpression(reportRelevanceList.get(0).getImpression());
}
//查询报告单分数
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore2(param.getId(), param.getCode());
//重新封装报告单信息
List<PatientReportVo.ReportScore> scores = patientReportService.getReportScores(reportScore, param.getId());
//生成写入pdf数据
List<PdfUtil.Row> content = new ArrayList<>();
writeParentCode2(content, scores);
//添加初步印象和受试者合作评分
addScoreAndImpression(reportPatient.getInitialImpression(), content);
//添加测评员和报告日期
initLast(content, 2);
//表头
String[] split = reportPatient.getHospital().split("");
String title = String.join(" ", split);
//生成pdf并返回路径
String path = PropUtil.imgDomain + "/" + PdfUtil.createPdf(PropUtil.path, title, Constant.Ht.Report.PARENT_NAME, new PdfUtil.Margin(), reportPatient.toPdfRow(), content);
//TODO 将路径存入报告单关联信息表
// reportRelevance.setPdfUrl(path);
// reportRelevanceMapper.updateByPrimaryKeySelective(reportRelevance);
log.info("生成文件路径:{}", path);
return path;
}
private void addScoreAndImpression(String initialImpression, List<PdfUtil.Row> content) {
PdfUtil.Row workingScore = new PdfUtil.Row();
workingScore.addCell(new PdfUtil.Cell("受试者合作评分",1,1));
workingScore.addCell(new PdfUtil.Cell("受试者合作评分", 1, 1));
String a = "A 感兴趣、配合关心结果;\n";
String b = "B 表现出感兴趣和合作,出于对医生的友好;\n";
String c = "C 顺从、不感兴趣;\n";
@ -164,16 +234,15 @@ public class ExportService implements IExportService {
PdfUtil.Row impression = new PdfUtil.Row();
impression.addCell(new PdfUtil.Cell("初步印象",1,1));
impression.addCell(new PdfUtil.Cell(String.valueOf(detail.getPatient().getInitialImpression()),3,1,1));
impression.addCell(new PdfUtil.Cell("初步印象", 1, 1));
impression.addCell(new PdfUtil.Cell(initialImpression, 3, 1, 1));
content.add(impression);
}
private void writeParentCode2(List<PdfUtil.Row> content, List<PatientReportVo.ReportScore> scores) {
PdfUtil.Row title = new PdfUtil.Row();
title.addCell(new PdfUtil.Cell("项目"));
title.addCell(new PdfUtil.Cell());
title.addCell(new PdfUtil.Cell("项目",2,1));
// title.addCell(new PdfUtil.Cell());
title.addCell(new PdfUtil.Cell("得分"));
PdfUtil.Cell r = new PdfUtil.Cell();
r.setContent("异常参考值/说明");
@ -181,7 +250,7 @@ public class ExportService implements IExportService {
title.addCell(r);
content.add(title);
scores.forEach(reportScore -> {
if(CollectionUtil.isEmpty(reportScore.getSubReport())){
if (CollectionUtil.isEmpty(reportScore.getSubReport())) {
PdfUtil.Row row = new PdfUtil.Row();
PdfUtil.Cell cellName = new PdfUtil.Cell();
@ -189,7 +258,9 @@ public class ExportService implements IExportService {
cellName.setContent(reportScore.getName());
row.addCell(cellName);
PdfUtil.Cell cellScore = new PdfUtil.Cell();
cellScore.setContent(ObjectUtil.isNotNull(reportScore.getScore()) ? reportScore.getScore().toString() : "");
DecimalFormat df = new DecimalFormat("#.#");
cellScore.setContent(ObjectUtil.isNotNull(reportScore.getScore()) ? df.format(reportScore.getScore()) : "");
row.addCell(cellScore);
PdfUtil.Cell remark = new PdfUtil.Cell();
remark.setContent(reportScore.getRemark());
@ -197,11 +268,11 @@ public class ExportService implements IExportService {
row.addCell(remark);
content.add(row);
}else {
} else {
for (int i = 0; i < reportScore.getSubReport().size(); i++) {
PatientReportVo.ReportScore score = reportScore.getSubReport().get(i);
PdfUtil.Row row = new PdfUtil.Row();
if(i == 0){
if (i == 0) {
PdfUtil.Cell cellName = new PdfUtil.Cell();
cellName.setRowSpan(reportScore.getSubReport().size());
cellName.setContent(reportScore.getName());
@ -220,7 +291,6 @@ public class ExportService implements IExportService {
}
private PdfUtil.Cell addCell(PdfUtil.Row row, String content, int colSpan, int rowSpan, int... border) {
PdfUtil.Cell cell1 = new PdfUtil.Cell();
cell1.setContent(content);

8
ht/src/main/java/com/ccsens/ht/service/IExportService.java

@ -13,4 +13,12 @@ public interface IExportService {
* @return 返回pdf路径
*/
String exportReport(PatientReportDto.QueryDetail param, Long userId);
/**
* 导出指定类型的量表
* @param param 报告单类型
* @param userId userId
* @return 返回路径
*/
String exportByCode(PatientReportDto.ExportCode param, Long userId);
}

8
ht/src/main/java/com/ccsens/ht/service/IPatientReportService.java

@ -172,4 +172,12 @@ public interface IPatientReportService {
* @return workbook
*/
Workbook exportAnalyse(List<Long> ids);
/**
* 重新封装报告单信息 单个表单用
* @param reportScores
* @param reportId
* @return
*/
List<PatientReportVo.ReportScore> getReportScores(List<PatientReportVo.ReportScore> reportScores, long reportId);
}

42
ht/src/main/java/com/ccsens/ht/service/PatientReportService.java

@ -74,6 +74,8 @@ public class PatientReportService implements IPatientReportService {
private IQuestionService questionService;
@Resource
private HtReportRelevanceMapper reportRelevanceMapper;
@Resource
private IExportService exportService;
@Override
public JsonResponse<PatientReportVo.Generate> generatePatientReport(PatientReportDto.Generate generate, Long userId) {
@ -257,6 +259,14 @@ public class PatientReportService implements IPatientReportService {
PatientReportVo.ReprotDetail detail = new PatientReportVo.ReprotDetail();
//查询报告单信息和病人信息
PatientReportVo.ReprotPatient reportPatient = htPatientReportDao.queryReportResult(queryDetail.getId());
//查询报告单的关联信息
HtReportRelevanceExample relevanceExample = new HtReportRelevanceExample();
relevanceExample.createCriteria().andReportIdEqualTo(queryDetail.getId()).andReportCodeEqualTo(queryDetail.getReport());
List<HtReportRelevance> reportRelevanceList = reportRelevanceMapper.selectByExample(relevanceExample);
if(CollectionUtil.isNotEmpty(reportRelevanceList)) {
reportPatient.setWorkingScore(ObjectUtil.isNull(reportRelevanceList.get(0).getSocre()) ? 0 : reportRelevanceList.get(0).getSocre());
reportPatient.setInitialImpression(reportRelevanceList.get(0).getImpression());
}
//查询报告单分数
List<PatientReportVo.ReportScore> reportScore = htPatientReportDao.queryReportScore(queryDetail.getId(), queryDetail.getRey(), queryDetail.getReport());
long reportId = queryDetail.getId();
@ -437,17 +447,20 @@ public class PatientReportService implements IPatientReportService {
if (report == null) {
throw new BaseException(CodeEnum.REPORT_NOT_FOUND);
}
//有二维码直接返回
if (StrUtil.isNotBlank(report.getQrCodeUrl())) {
log.info("直接返回二维码路径:{}", report.getQrCodeUrl());
return report.getQrCodeUrl();
}
// //有二维码直接返回
// if (queryDetail.getReport().equalsIgnoreCase(Constant.Ht.Report.PARENT_CODE) && StrUtil.isNotBlank(report.getQrCodeUrl())) {
// log.info("直接返回二维码路径:{}", report.getQrCodeUrl());
// return report.getQrCodeUrl();
// }
// String pdfUrl = report.getUrl();
// if (StrUtil.isBlank(pdfUrl)) {
// log.info("尚未生成pdf文件,生成文件");
// pdfUrl = exportReport(queryDetail, userId);
//
// }
String pdfUrl = exportService.exportReport(queryDetail, userId);
String pdfUrl = report.getUrl();
if (StrUtil.isBlank(pdfUrl)) {
log.info("尚未生成pdf文件,生成文件");
pdfUrl = exportReport(queryDetail, userId);
}
String qrCodePath = QrCodeUtil.urlToQRCode(pdfUrl, PropUtil.path);
String qrCodeUrl = PropUtil.imgDomain + "/" + qrCodePath;
log.info("生成的二维码路径:{}", qrCodeUrl);
@ -655,7 +668,7 @@ public class PatientReportService implements IPatientReportService {
scoreCell.setBorderRight(1);
questionTable.add(row);
PdfUtil.Row tempRow = new PdfUtil.Row();
// PdfUtil.Row tempRow = new PdfUtil.Row();
// PdfUtil.Cell cell = addCell(tempRow, "仅供临床医生参考。", scoreSpan + questionSpan + 1, 1);
// tempRow.addCell(cell);
// questionTable.add(tempRow);
@ -830,6 +843,7 @@ public class PatientReportService implements IPatientReportService {
row.get(45).setValue(String.valueOf(parameters.getAveTimes()));
row.get(46).setValue(pxToMm(parameters.getAveLength(), height) + "mm");
row.get(47).setValue(pxToMm(parameters.getLongLine(), height) + "mm");
row.get(50).setValue(pxToMm(parameters.getAveSpeed() * 1000, height) + "mm/s");
row.get(51).setValue(pxToMm(parameters.getLongSpeed() * 1000, height) + "mm/s");
row.get(52).setValue(pxToSquare(parameters.getMinCircleAcreage().doubleValue(), height) + "mm²");
row.get(53).setValue(pxToMm(parameters.getShowCentreCoordinate().getX(), height) + "mm");
@ -868,6 +882,7 @@ public class PatientReportService implements IPatientReportService {
row.get(startIndex + 4).setValue(parameters.getAveTimes() + "");
row.get(startIndex + 5).setValue(pxToMm(parameters.getAveLength(), height) + "mm");
row.get(startIndex + 6).setValue(pxToMm(parameters.getLongLine(), height) + "mm");
row.get(startIndex + 7).setValue(pxToMm(parameters.getAveSpeed() * 1000, height) + "mm/s");
row.get(startIndex + 8).setValue(pxToMm(parameters.getLongSpeed() * 1000, height) + "mm/s");
row.get(startIndex + 9).setValue(pxToSquare(parameters.getMinRectangleAcreage(), height) + "mm²");
row.get(startIndex + 10).setValue(pxToMm(parameters.getShowCentreCoordinate().getX(), height) + "mm");
@ -1061,13 +1076,14 @@ public class PatientReportService implements IPatientReportService {
PdfUtil.Row tempRow = new PdfUtil.Row();
PdfUtil.Cell cell = addCell(tempRow, "仅供临床医生参考。", colNum, 1);
tempRow.addCell(cell);
cell.setBorderRight(1);
content.add(tempRow);
initLast(content, colNum);
return scores;
}
private List<PatientReportVo.ReportScore> getReportScores(List<PatientReportVo.ReportScore> reportScores, long reportId) {
@Override
public List<PatientReportVo.ReportScore> getReportScores(List<PatientReportVo.ReportScore> reportScores, long reportId) {
Map<String, PatientReportVo.ReportScore> map = new HashMap<>(32);
List<PatientReportVo.ReportScore> scores = new ArrayList<>();
reportScores.forEach(score -> {

12
ht/src/main/java/com/ccsens/ht/service/QuestionService.java

@ -143,7 +143,7 @@ public class QuestionService implements IQuestionService {
introduceExample.setOrderByClause("sort");
List<HtQuestionIntroducer> introduces = htQuestionIntroducerDao.selectByExample(introduceExample);
List<QuestionVo.Introduce> introduceVos = QuestionVo.Introduce.toIntroduces(introduces);
//查询选项信息
List<QuestionVo.Option> optionList = htQuestionOptionDao.queryOption(questionVo.getId(), query.getPatientReportId());
//答题记录
@ -446,7 +446,9 @@ public class QuestionService implements IQuestionService {
if (StrUtil.isNotEmpty(questionOption.getRemark())) {
JSONObject remark = JSONObject.parseObject(questionOption.getRemark());
countScoreByFormula(nameOption, questionOption, patientScore, remark);
} else {
} else if(questionOption.getType().equalsIgnoreCase(Constant.Ht.Option.NUMBER_SCORE) || questionOption.getType().equalsIgnoreCase(Constant.Ht.Option.NUMBER_TIME)){
patientScore.setScore(option.getScore());
}else {
patientScore.setScore(questionOption.getScore());
}
patientScore.setAnswerTime(option == null ? System.currentTimeMillis() : option.getAnswerTime() == null ? 0 : option.getAnswerTime());
@ -870,6 +872,8 @@ public class QuestionService implements IQuestionService {
parameter.setLongNums(lineParameterList.size() - nums.shortNums);
parameter.setQuickNums(nums.quickNums);
parameter.setSlowNums(lineParameterList.size() - nums.quickNums);
//平均绘图速度
parameter.setAveSpeed(BigDecimal.valueOf(totalLength / parameter.getTotalDuration()).setScale(2, RoundingMode.HALF_UP).doubleValue());
return parameter;
}
@ -1063,7 +1067,9 @@ public class QuestionService implements IQuestionService {
htPatientReportRecordDescDao.updateByExampleSelective(update, recordDescExample);
log.info("删除其他记录答案:{},{}", recordIds, batchRecordMsg.getPatientReportId());
// 保存新答案
htPatientReportRecordDescDao.batchSave(records);
if(CollectionUtil.isNotEmpty(records)){
htPatientReportRecordDescDao.batchSave(records);
}
log.info("保存新答案");
}

5
ht/src/main/java/com/ccsens/ht/uitl/Constant.java

@ -142,7 +142,10 @@ public class Constant {
default: return "其他";
}
}
public static final class Option{
public final static String NUMBER_SCORE = "numberScore";
public final static String NUMBER_TIME = "numberTime";
}
public static String getCareer(int status) {
switch (status) {
case 1: return "农林牧渔水利生产人员";

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

@ -1,5 +1,5 @@
spring:
profiles:
active: test
include: common, util-test
active: prod
include: common, util-prod

5
ht/src/main/resources/druid-prod.yml

@ -15,7 +15,8 @@ spring:
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: b3fd300ad4694070007fdcca961c4018211dc53235dd806ad62abc0cc0abb8e5
# password: b3fd300ad4694070007fdcca961c4018211dc53235dd806ad62abc0cc0abb8e5
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
@ -27,7 +28,7 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://www.tall.wiki/ht?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://127.0.0.1/ht?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_HT

2
ht/src/main/resources/mapper_dao/HtQuestionDao.xml

@ -66,6 +66,8 @@
max(sort)
from t_ht_question
where evaluation_code = #{code, jdbcType=VARCHAR}
and relation_id = 0
and is_del = 0
</select>
<select id="queryShareAnswer" resultType="com.ccsens.ht.bean.vo.QuestionVo$ShareAnswer">
SELECT

2
ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml

@ -23,6 +23,7 @@
<result column="display" jdbcType="VARCHAR" property="display" />
<result column="choose" jdbcType="TINYINT" property="choose" />
<result column="answer" jdbcType="VARCHAR" property="answer" />
<result column="t2content" jdbcType="VARCHAR" property="content" />
<collection property="optionDescList" ofType="com.ccsens.ht.bean.vo.QuestionVo$OptionDesc">
<id column="descId" property="id"/>
<result column="descType" property="type"/>
@ -49,6 +50,7 @@
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 t_ht_question_option t1 left join t_ht_patient_score t2 on t1.id = t2.option_id and (t2.id is null or (t2.patient_report_id = #{patientReportId,jdbcType=BIGINT} and t2.is_del = 0))
left join (select * from t_ht_question_option_desc where is_del = 0) t3 on t1.id = t3.option_id

1
ht/src/main/resources/mapper_dao/HtReportDao.xml

@ -103,4 +103,5 @@
) record on report.id = record.question_id
</select>
</mapper>

9
util/src/test/java/com/ccsens/util/Base64Test.java

@ -11,6 +11,8 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
@ -61,4 +63,11 @@ public class Base64Test {
System.out.println("=====" + a);
}
@Test
public void test03() throws Exception {
String a = "测试";
}
}

Loading…
Cancel
Save