|
@ -1,23 +1,22 @@
|
|
|
package com.yihu.mm.controller.medicine;
|
|
|
|
|
|
import com.yihu.mm.controller.BaseController;
|
|
|
import com.yihu.mm.entity.patient.ExamReport;
|
|
|
import com.yihu.mm.entity.patient.PatientExam;
|
|
|
import com.yihu.mm.entity.questionnaire.MedicineAnswerLog;
|
|
|
import com.yihu.mm.service.MedicineAnswerLogService;
|
|
|
import com.yihu.mm.service.PatientExamService;
|
|
|
import com.yihu.mm.service.PatientService;
|
|
|
import com.yihu.mm.service.PhysicalExaminationService;
|
|
|
import com.yihu.mm.service.*;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.Date;
|
|
|
|
|
@ -42,6 +41,9 @@ public class PhysicalExaminationController extends BaseController {
|
|
|
@Autowired
|
|
|
private PatientExamService patientExamService;
|
|
|
|
|
|
@Autowired
|
|
|
private ExamReportService examReportService;
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取试卷列表")
|
|
|
@RequestMapping(value = "/findExames",produces="application/json;charset=UTF-8")
|
|
@ -91,16 +93,13 @@ public class PhysicalExaminationController extends BaseController {
|
|
|
String question = physicalExaminationService.findQuestion(examCode, pb_id, ct_id);
|
|
|
|
|
|
JSONObject jsonQuestion = new JSONObject(question);
|
|
|
|
|
|
JSONObject recordset = jsonQuestion.getJSONObject("recordset");
|
|
|
String _pb_id = recordset.get("pb_id").toString();//越人api问题, 我们数据库保存的居民答案的pb_id是这边返回下一题的pb_id
|
|
|
|
|
|
//查找居民是否已经答过该试题
|
|
|
MedicineAnswerLog answer = medicineAnswerLogService.findAnswer(patientCode, examCode, _pb_id,ct_id);
|
|
|
jsonQuestion.put("answer",answer);
|
|
|
jsonQuestion.put("answer",(answer==null?"":answer.getProblems()));
|
|
|
|
|
|
//Map<String, Object> resp = customerService.findServerInfo(patient);
|
|
|
//resp.put("patient",patient);
|
|
|
//return write(1,"查询成功","data",resp);
|
|
|
return jsonQuestion.toString();
|
|
|
}
|
|
|
|
|
@ -145,45 +144,17 @@ public class PhysicalExaminationController extends BaseController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查找报告单")
|
|
|
@ApiOperation(value = "查看报告单")
|
|
|
@RequestMapping(value = "/findconconhealth",produces="application/json;charset=UTF-8")
|
|
|
@ResponseBody
|
|
|
public String findconconhealth(@ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
|
|
|
String result = physicalExaminationService.findconconhealth(ct_id);
|
|
|
public String showDetail(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode,
|
|
|
@ApiParam(name = "ct_id", value = "咨询编号", required = false)@RequestParam(required = false, name = "ct_id") String ct_id){
|
|
|
ExamReport examReport = examReportService.showDetail(patientCode, ct_id);
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
if(null!=examReport){
|
|
|
|
|
|
@RequestMapping(value = "/testUploadFile", method = RequestMethod.POST)
|
|
|
public String testUploadFile(@RequestParam("test") MultipartFile file) {
|
|
|
|
|
|
if (file.isEmpty()) {
|
|
|
return "文件为空";
|
|
|
}
|
|
|
// 获取文件名
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
// 获取文件的后缀名
|
|
|
String suffixName = fileName.substring(fileName.lastIndexOf("."));
|
|
|
// 文件上传后的路径
|
|
|
String filePath = "E://test//";
|
|
|
// 解决中文问题,liunx下中文路径,图片显示问题
|
|
|
// fileName = UUID.randomUUID() + suffixName;
|
|
|
File dest = new File(filePath + fileName);
|
|
|
// 检测是否存在目录
|
|
|
if (!dest.getParentFile().exists()) {
|
|
|
dest.getParentFile().mkdirs();
|
|
|
}
|
|
|
try {
|
|
|
file.transferTo(dest);
|
|
|
return "上传成功";
|
|
|
} catch (IllegalStateException e) {
|
|
|
e.printStackTrace();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return "上传失败";
|
|
|
return write(200,"查询成功","recordset",examReport);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|