chenyongxing преди 7 години
родител
ревизия
e9d0a762d1

+ 53 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/patient/ExamReportDetail.java

@ -0,0 +1,53 @@
package com.yihu.mm.entity.patient;
import com.yihu.mm.entity.IdEntity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "exam_report_detail")
public class ExamReportDetail extends IdEntity implements Serializable {
    private String patient;
    private String ctId;
    private String reportDetail;
    private Date createTime;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "ct_id")
    public String getCtId() {
        return ctId;
    }
    public void setCtId(String ctId) {
        this.ctId = ctId;
    }
    @Column(name = "report_detail")
    public String getReportDetail() {
        return reportDetail;
    }
    public void setReportDetail(String reportDetail) {
        this.reportDetail = reportDetail;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 7 - 41
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/controller/medicine/PhysicalExaminationController.java

@ -13,11 +13,12 @@ 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;
@ -91,16 +92,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);
        //Map<String, Object> resp = customerService.findServerInfo(patient);
        //resp.put("patient",patient);
        //return write(1,"查询成功","data",resp);
        return jsonQuestion.toString();
    }
@ -145,45 +143,13 @@ 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){
    public String showDetail(@ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
        String result = physicalExaminationService.findconconhealth(ct_id);
        return result;
    }
    @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 "上传失败";
    }
}

+ 10 - 9
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PhysicalExaminationService.java

@ -7,15 +7,7 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -146,4 +138,13 @@ public class PhysicalExaminationService {
        return HttpClientUtil.postBody(yuerenApi+"/findintegral", params);
    }
    public String showDetail(String patientCode,String ctId){
        String centralizedproblem = centralizedproblem(ctId);
        String conclusionfactor = conclusionfactor(ctId);
        String insertconconhealth = insertconconhealth(ctId);
        String findconconhealth = findconconhealth(ctId);
        String findintegral = findintegral(ctId);
        return null;
    }
}