...
|
...
|
@@ -18,6 +18,7 @@ import com.xkl.security.AntiXSS; |
|
|
import com.xkl.service.IScoreService;
|
|
|
import com.xkl.tools.HtmlTools;
|
|
|
import com.xkl.tools.UtilTools;
|
|
|
import lombok.extern.apachecommons.CommonsLog;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
...
|
...
|
@@ -32,6 +33,7 @@ import java.util.*; |
|
|
/**
|
|
|
* Created by win7 on 2016/11/20.
|
|
|
*/
|
|
|
@CommonsLog
|
|
|
@RestController
|
|
|
@RequestMapping("/report")
|
|
|
public class ReportController {
|
...
|
...
|
@@ -92,7 +94,7 @@ public class ReportController { |
|
|
if (metaItems != null) {
|
|
|
int item_type = metaItems.getType();
|
|
|
boolean testFlag = false;//是否是测试项目,测试项目要存两份
|
|
|
if(Constants.testItemSet.contains(item_type)){
|
|
|
if(Constants.testItemSet.contains(itemId)){
|
|
|
testFlag = true;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -101,40 +103,49 @@ public class ReportController { |
|
|
reportDetail.setItemValue(detail.getItemValue());
|
|
|
reportDetail.setStatus(detail.getStatus());
|
|
|
reportDetail.setTitle(metaItems.getTitle());
|
|
|
if (report.getSex() == Constants.MALE) {
|
|
|
if(Constants.itemIdSpSet.contains(itemId)){//特殊项
|
|
|
reportDetail.setNormalRange(Constants.itemRangeSpString);
|
|
|
}else if (report.getSex() == Constants.MALE) {//男
|
|
|
reportDetail.setNormalRange(metaItems.getStandardLowMale() + " - " + metaItems.getStandardHighMale());
|
|
|
} else {
|
|
|
}else {//女
|
|
|
reportDetail.setNormalRange(metaItems.getStandardLowFemale() + " - " + metaItems.getStandardHighFemale());
|
|
|
}
|
|
|
|
|
|
//正常的一份
|
|
|
if(!reportTypeMap.containsKey(item_type)){
|
|
|
ReportTypeModel reportTypeModel = new ReportTypeModel();
|
|
|
|
|
|
if(testFlag){//测试项目没有打分
|
|
|
//reportTypeModel.setTypeHealthScore(0);
|
|
|
reportTypeModel.setType(Constants.testItemType);
|
|
|
}else{
|
|
|
reportTypeModel.setType(item_type);
|
|
|
XklAmpReportHealthScoreEntity scoreEntity = xklAmpReportHealthScoreRespository.findByReportIdAndType(report_id, item_type);
|
|
|
if (scoreEntity != null) {
|
|
|
reportTypeModel.setTypeHealthScore(scoreEntity.getTypeHealthScore());
|
|
|
}
|
|
|
reportTypeModel.setType(item_type);
|
|
|
XklAmpReportHealthScoreEntity scoreEntity = xklAmpReportHealthScoreRespository.findByReportIdAndType(report_id, item_type);
|
|
|
if (scoreEntity != null) {
|
|
|
reportTypeModel.setTypeHealthScore(scoreEntity.getTypeHealthScore());
|
|
|
}
|
|
|
List<ReportDetailModel> reportDetailModelList = new ArrayList<>();
|
|
|
reportDetailModelList.add(reportDetail);
|
|
|
reportTypeModel.setReportDetailModelList(reportDetailModelList);
|
|
|
reportTypeMap.put(item_type,reportTypeModel);
|
|
|
if(testFlag){//同时也是测试项目,需要再存一份到测试项目分类中
|
|
|
reportTypeMap.put(Constants.testItemType,reportTypeModel);
|
|
|
}
|
|
|
}else{
|
|
|
ReportTypeModel reportTypeModel = reportTypeMap.get(item_type);
|
|
|
List<ReportDetailModel> reportDetailModelList = reportTypeModel.getReportDetailModelList();
|
|
|
reportDetailModelList.add(reportDetail);
|
|
|
reportTypeModel.setReportDetailModelList(reportDetailModelList);
|
|
|
reportTypeMap.put(item_type,reportTypeModel);
|
|
|
if(testFlag){//同时也是测试项目
|
|
|
reportTypeMap.put(Constants.testItemType,reportTypeModel);
|
|
|
}
|
|
|
//测试项目另存一份
|
|
|
if(testFlag){
|
|
|
if(!reportTypeMap.containsKey(Constants.testItemType)){
|
|
|
//test项目一份
|
|
|
ReportTypeModel reportTypeModel_test = new ReportTypeModel();
|
|
|
reportTypeModel_test.setTypeHealthScore(0);//测试项目没有打分
|
|
|
reportTypeModel_test.setType(Constants.testItemType);
|
|
|
List<ReportDetailModel> reportDetailModelList_test = new ArrayList<>();
|
|
|
reportDetailModelList_test.add(reportDetail);
|
|
|
reportTypeModel_test.setReportDetailModelList(reportDetailModelList_test);
|
|
|
reportTypeMap.put(Constants.testItemType,reportTypeModel_test);
|
|
|
}else{
|
|
|
ReportTypeModel reportTypeModel_test = reportTypeMap.get(Constants.testItemType);
|
|
|
List<ReportDetailModel> reportDetailModelList_test = reportTypeModel_test.getReportDetailModelList();
|
|
|
reportDetailModelList_test.add(reportDetail);
|
|
|
reportTypeModel_test.setReportDetailModelList(reportDetailModelList_test);
|
|
|
reportTypeMap.put(Constants.testItemType,reportTypeModel_test);
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|