Quellcode durchsuchen

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie vor 7 Jahren
Ursprung
Commit
a2e4da6150
34 geänderte Dateien mit 387 neuen und 174 gelöschten Zeilen
  1. 5 0
      common/common-entity/readme.MD
  2. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/entity/DevicePatientHealthIndex.java
  3. 3 0
      common/common-entity/src/main/java/com/yihu/mm/entity/patient/ExamReport.java
  4. 34 0
      common/common-entity/src/main/java/com/yihu/mm/entity/patient/PatientExam.java
  5. 9 0
      common/common-entity/src/main/java/com/yihu/mm/entity/questionnaire/MedicineAnswerLog.java
  6. 53 90
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/controller/medicine/PhysicalExaminationController.java
  7. 2 2
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/mm/exam/MedicineAnswerLogDao.java
  8. 4 2
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/mm/patient/PatientExamDao.java
  9. 17 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/wlyy/hospital/HospitalDao.java
  10. 40 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/wlyy/patient/SignFamilyDao.java
  11. 41 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/FamilyContractService.java
  12. 29 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/HospitalService.java
  13. 2 2
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/MedicineAnswerLogService.java
  14. 15 2
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PatientExamService.java
  15. 33 0
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PatientService.java
  16. 21 2
      patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PhysicalExaminationService.java
  17. 1 1
      patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml
  18. 4 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/yueren/YueRenController.java
  19. 2 2
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBExtract.java
  20. 49 37
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SignJob.java
  21. 1 1
      patient-co/patient-co-wlyy/pom.xml
  22. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/HealthJpa.java
  23. 1 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java
  24. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  25. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  26. 7 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java
  27. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  28. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  29. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java
  30. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  31. 0 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  32. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java
  33. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java
  34. 1 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/OpenApiArchiveController.java

+ 5 - 0
common/common-entity/readme.MD

@ -0,0 +1,5 @@
com.yihu.wlyy.entity   i健康相关的实体类
com.yihu.mm.entity   集美区中医相关的实体类
com.yihu.device.entity   i健康设备相关的实体类

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/entity/DevicePatientHealthIndex.java

@ -1,4 +1,4 @@
package com.yihu.wlyy.health.entity;
package com.yihu.device.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;

+ 3 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/patient/ExamReport.java

@ -7,6 +7,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "exam_report")
@ -26,6 +27,8 @@ public class ExamReport extends IdEntity implements Serializable {
    private String clTemplate;//显示模板
    @Column(name="cl_sort")
    private String clSort;//结论排序权重
    @Column(name = "create_time", nullable = false, length = 0,updatable = false)
    private Date createTime;
    public String getPatient() {
        return patient;

+ 34 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/patient/PatientExam.java

@ -7,6 +7,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Entity
@Table(name = "patient_exam")
@ -27,6 +28,15 @@ public class PatientExam extends IdEntity implements Serializable {
    @Column(name="is_complete")
    private Integer isComplete;
    @Column(name="sl_id")
    private String slId;//预约单号
    @Column(name="u_no")
    private String uNo;//客户编号
    @Column(name = "create_time", nullable = false, length = 0,updatable = false)
    private Date createTime;
    public String getPatient() {
        return patient;
    }
@ -66,4 +76,28 @@ public class PatientExam extends IdEntity implements Serializable {
    public void setTpName(String tpName) {
        this.tpName = tpName;
    }
    public String getSlId() {
        return slId;
    }
    public void setSlId(String slId) {
        this.slId = slId;
    }
    public String getuNo() {
        return uNo;
    }
    public void setuNo(String uNo) {
        this.uNo = uNo;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/mm/entity/questionnaire/MedicineAnswerLog.java

@ -21,6 +21,7 @@ public class MedicineAnswerLog extends IdEntity {
    private String pbId;//试题编号
    private Date createTime;    //创建时间
    private String problems;    //问题的集合
    private String ctId;//咨询编号
    public String getPatientCode() {
        return patientCode;
@ -78,4 +79,12 @@ public class MedicineAnswerLog extends IdEntity {
    public void setPbId(String pbId) {
        this.pbId = pbId;
    }
    public String getCtId() {
        return ctId;
    }
    public void setCtId(String ctId) {
        this.ctId = ctId;
    }
}

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

@ -7,11 +7,9 @@ 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.util.HttpClientUtil;
import com.yihu.wlyy.entity.patient.Patient;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -21,7 +19,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Date;
@ -51,35 +48,8 @@ public class PhysicalExaminationController extends BaseController {
    @RequestMapping(value = "/findExames",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String findExames(@ApiParam(name = "tp_type", value = "'问卷类型',(备选值:1,2,4)1:初筛问卷,2:助理问卷,4:现场问卷", required = true)@RequestParam(required = false, name = "tp_type") String tp_type,
                             HttpServletRequest req
                             ) {
        HttpSession session = req.getSession();
            String key = (String) session.getAttribute("key");
            if(StringUtils.isBlank(key)){
                //通过接口查询key
                String result = HttpClientUtil.postBody(yuerenApi + "/phonekey", new JSONObject());
                JSONObject jsonObject = new JSONObject(result);
                String status = jsonObject.get("status").toString();
                if ("200".equals(status)) {
                    JSONObject recordset = jsonObject.getJSONObject("recordset");
                    key = recordset.getString("key");
                }else{
                    return result;
                }
                session.setMaxInactiveInterval(60*60*4);
                session.setAttribute("key",key);
        }
                             HttpServletRequest req) {
        String exames = physicalExaminationService.findExames(tp_type, examCode);
        //if(StringUtils.isNotBlank(examCode)){
        //    JSONObject examJson = new JSONObject(exames);
        //    String exam_status = examJson.get("status").toString();
        //    if ("200".equals(exam_status)) {
        //        JSONObject recordset = examJson.getJSONObject("recordset");
        //        key = recordset.getString("key");
        //    }else{
        //        return result;
        //    }
        //}
        return exames;
    }
@ -87,99 +57,92 @@ public class PhysicalExaminationController extends BaseController {
    @RequestMapping(value = "/insertslip",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String insertslip(@ApiParam(name = "patientCode", value = "居民code", required = true)@RequestParam(required = true, name = "patientCode") String patientCode, HttpServletRequest req){
        String key = (String) req.getSession().getAttribute("key");
        Patient patient = patientService.findByCode(patientCode);
        return physicalExaminationService.insertslip(patient);
        int isSignJM = patientService.isSignJM(patientCode);
        if(isSignJM==3){
            String insertslip = physicalExaminationService.insertslip(patient);
            JSONObject jsonQuestion = new JSONObject(insertslip);
            JSONObject recordset = jsonQuestion.getJSONObject("recordset");
            String ct_id = recordset.get("ct_id").toString();
            PatientExam patientExam = new PatientExam();
            patientExam.setCtId(ct_id);
            patientExam.setPatient(patientCode);
            patientExam.setIsComplete(0);
            patientExam.setTpId(examCode);
            patientExam.setCreateTime(new Date());
            patientExamService.save(patientExam);
            return insertslip;
        }else{
            return write(200,"未签约或者签约不在集美","isSignJM",isSignJM);
        }
    }
    @ApiOperation(value = "获取试题")
    @RequestMapping(value = "/findQuestion",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String findQuestion(@ApiParam(name = "tp_id", value = "试卷id", required = true)@RequestParam(required = true, name = "tp_id") String tp_id,
    public String findQuestion(
                               @ApiParam(name = "pb_id", value = "问卷编号,第一题为0", required = true)@RequestParam(required = true, name = "pb_id") String pb_id,
                               @ApiParam(name = "patientCode", value = "居民code", required = true)@RequestParam(required = true, name = "patientCode") String patientCode,
                               HttpServletRequest req) throws IOException {
        String ct_id="";
        PatientExam patientExam = patientExamService.findByPatientAndTpId(patientCode, tp_id);
        if(patientExam==null){
            Patient patient = patientService.findByCode(patientCode);
            String result = physicalExaminationService.insertslip(patient);
            JSONObject jsonObject = new JSONObject(result);
            String status = jsonObject.get("status").toString();
            if ("200".equals(status)) {
                JSONObject recordset = jsonObject.getJSONObject("recordset");
                ct_id = recordset.get("ct_id").toString();
                patientExam = new PatientExam();
                patientExam.setCtId(ct_id);
                patientExam.setPatient(patientCode);
                patientExam.setIsComplete(0);
                patientExam.setTpId(tp_id);
                patientExamService.save(patientExam);
            }else{
                return result;
            }
        }else{
            ct_id = patientExam.getCtId();
        }
        String question = physicalExaminationService.findQuestion(tp_id, pb_id, ct_id);
                               @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id) throws IOException {
        String question = physicalExaminationService.findQuestion(examCode, pb_id, ct_id);
        JSONObject jsonQuestion = new JSONObject(question);
        jsonQuestion.put("answer","");
        JSONObject recordset = jsonQuestion.getJSONObject("recordset");
        String _pb_id = recordset.get("pb_id").toString();//越人api问题,  我们数据库保存的居民答案的pb_id是这边返回下一题的pb_id
        //查找居民是否已经答过该试题
        MedicineAnswerLog answer = medicineAnswerLogService.findAnswer(patientCode, tp_id, pb_id);
        if(answer!=null){
            jsonQuestion.put("answer",answer);
        }
        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 question;
        return jsonQuestion.toString();
    }
    @ApiOperation(value = "提交试卷答案")
    @RequestMapping(value = "/handleExam",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String handleExam(@ApiParam(name = "tp_id", value = "试卷id", required = true)@RequestParam(required = true, name = "tp_id") String tp_id,
    public String handleExam(@ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id,
                               @ApiParam(name = "pb_id", value = "问卷编号,第一题为0", required = true)@RequestParam(required = true, name = "pb_id") String pb_id,
                                @ApiParam(name = "i_multiselect", value = "试题类型(0单选 ,1多选)", required = true)@RequestParam(required = true, name = "i_multiselect") String i_multiselect,
                               @ApiParam(name = "dc_answer", value = "问题答案", required = true)@RequestParam(required = true, name = "dc_answer") String dc_answer,
                             @ApiParam(name = "patientCode", value = "居民code", required = true)@RequestParam(required = true, name = "patientCode") String patientCode,
                             @ApiParam(name = "isLast", value = "是否是最后一题(0否 ,1是)", required = true)@RequestParam(required = true, name = "isLast") String isLast,
                            HttpServletRequest req){
        PatientExam patientExam = patientExamService.findByPatientAndTpId(patientCode, tp_id);
                             @ApiParam(name = "isLast", value = "是否是最后一题(0否 ,1是)", required = true)@RequestParam(required = false, name = "isLast") String isLast){
        PatientExam patientExam = patientExamService.findByPatientAndTpId(patientCode, examCode,ct_id);
        String tpName = patientExam.getTpName();
        String ct_id = patientExam.getCtId();
        String result = physicalExaminationService.handleExam(tp_id, pb_id, dc_answer, ct_id);
        //将答案保存到自己数据库
        MedicineAnswerLog medicineAnswerLog = new MedicineAnswerLog();
        medicineAnswerLog.setPatientCode(patientCode);
        medicineAnswerLog.setTpId(tp_id);
        medicineAnswerLog.setTpName(tpName);
        medicineAnswerLog.setPbType(String.valueOf(i_multiselect));
        medicineAnswerLog.setCreateTime(new Date());
        medicineAnswerLog.setProblems(dc_answer);
        medicineAnswerLogService.save(medicineAnswerLog);
        //最后一题
        if("1".equals(isLast)){
        String result = physicalExaminationService.handleExam(examCode, pb_id, dc_answer, ct_id);
        //将答案保存/更新到自己数据库
        MedicineAnswerLog answer = medicineAnswerLogService.findAnswer(patientCode, examCode, pb_id, ct_id);
        if(answer==null){//新增
            answer = new MedicineAnswerLog();
            answer.setCreateTime(new Date());
            answer.setPatientCode(patientCode);
            answer.setPbId(pb_id);
            answer.setTpId(examCode);
            answer.setTpName(tpName);
            answer.setCtId(ct_id);
        }
        answer.setPbType(String.valueOf(i_multiselect));
        answer.setProblems(dc_answer);
        medicineAnswerLogService.save(answer);
        return result;
    }
    @ApiOperation(value = "四诊资料采集")
    @RequestMapping(value = "/dillphoneimgdata",produces="application/json;charset=UTF-8")
    @ResponseBody
    public String dillphoneimgdata(@ApiParam(name = "tp_id", value = "试卷id", required = true)@RequestParam(required = true, name = "tp_id") String tp_id,
                             @ApiParam(name = "pb_id", value = "问卷编号,第一题为0", required = true)@RequestParam(required = true, name = "pb_id") String pb_id,
                             @ApiParam(name = "dc_answer", value = "问题答案", required = true)@RequestParam(required = true, name = "dc_answer") String dc_answer,
    public String dillphoneimgdata(@ApiParam(name = "at_id", value = "文件id", required = true)@RequestParam(required = true, name = "at_id") String at_id,
                             @ApiParam(name = "answer", value = "问题答案,文件名称", required = true)@RequestParam(required = true, name = "answer") String answer,
                              @ApiParam(name = "type", value = "1.脸型  2.舌像  3.声音", required = true)@RequestParam(required = true, name = "type") String type,
                             @ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
        return null;
        String result = physicalExaminationService.dillphoneimgdata(at_id, answer, type, ct_id);
        return result;
    }
    @ApiOperation(value = "查找报告单")

+ 2 - 2
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/mm/exam/MedicineAnswerLogDao.java

@ -12,6 +12,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface MedicineAnswerLogDao extends PagingAndSortingRepository<MedicineAnswerLog, String>,JpaSpecificationExecutor<MedicineAnswerLog> {
	@Query("select m from MedicineAnswerLog m where m.patientCode=?1 and m.tpId=?2 and m.pbId=?3")
    MedicineAnswerLog findAnswer(String patientCode, String tp_id, String pb_id);
	@Query("select m from MedicineAnswerLog m where m.patientCode=?1 and m.tpId=?2 and m.pbId=?3 and m.ctId=?4")
    MedicineAnswerLog findAnswer(String patientCode, String tp_id, String pb_id,String ct_id);
}

+ 4 - 2
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/mm/patient/PatientExamDao.java

@ -10,10 +10,12 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface PatientExamDao extends PagingAndSortingRepository<PatientExam, String>,JpaSpecificationExecutor<PatientExam> {
	// 查询患者code和试卷编号查询
	@Query("select p from PatientExam p where p.patient=?1 and p.tpId=?2")
	PatientExam findByPatientAndTpId(String patientCode, String tpId);
	@Query("select p from PatientExam p where p.patient=?1 and p.tpId=?2  and p.ctId=?3 order by p.createTime desc")
	List<PatientExam> findByPatientAndTpId(String patientCode, String tpId,String ctId);
}

+ 17 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/wlyy/hospital/HospitalDao.java

@ -0,0 +1,17 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.mm.repository.wlyy.hospital;
import com.yihu.wlyy.entity.organization.Hospital;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface HospitalDao extends PagingAndSortingRepository<Hospital, Long>,JpaSpecificationExecutor<Hospital>  {
	// 根據CODE查詢医院名称
	@Query("select p from Hospital p where p.code = ?1")
	Hospital findByCode(String code);
}

+ 40 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/repository/wlyy/patient/SignFamilyDao.java

@ -0,0 +1,40 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.mm.repository.wlyy.patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Long>, JpaSpecificationExecutor<SignFamily> {
	SignFamily findByCode(String code);
	@Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
    SignFamily findByIdcard(String idcard);
    @Modifying
    @Query("update SignFamily a set a.status = ?1 where a.id = ?2")
    int updateStatus(Integer status, Long id);
    @Query(value = "select distinct(a.id) from SignFamily a,Patient p where a.patient = p.code and p.address like ?1 ")
    Long[] findByPatientAddressLike(String address);
    @Query(value = "select distinct(a.id) from SignFamily a,Patient p where a.patient = p.code and p.address like ?1 ")
    Long[] findByTeamNameOrLeaderNameLike(String teamName, String leaderName);
    @Query("select a from SignFamily a where a.patient = ?1 and a.status >= 0")
    List<SignFamily> findAllSignByPatient(String patient);
    @Query("select a from SignFamily a where a.patient = ?1 and a.status > 0 and expensesStatus=1")
    SignFamily findSignByPatient(String patient);
}

+ 41 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/FamilyContractService.java

@ -0,0 +1,41 @@
package com.yihu.mm.service;
import com.yihu.mm.repository.wlyy.patient.SignFamilyDao;
import com.yihu.wlyy.entity.patient.SignFamily;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * 家庭签约业务处理类
 *
 * @author George
 */
@Component
@Transactional
public class FamilyContractService{
    @Autowired
    private SignFamilyDao signFamilyDao;
    /**
     * 查询居民的所有签约
     *
     * @param patient
     * @return
     */
    public List<SignFamily> findAllSignByPatient(String patient) {
        return signFamilyDao.findAllSignByPatient(patient);
    }
    /**
     * 查询当前生效的签约
     * @param patient
     * @return
     */
    public SignFamily findSignByPatient(String patient){
        return signFamilyDao.findSignByPatient(patient);
    }
}

+ 29 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/HospitalService.java

@ -0,0 +1,29 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.mm.service;
import com.yihu.mm.repository.wlyy.hospital.HospitalDao;
import com.yihu.wlyy.entity.organization.Hospital;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 患者基本信息类.
 *
 * @author George
 */
@Service
public class HospitalService {
    @Autowired
    private HospitalDao hospitalDao;
    public Hospital findByCode(String code){
        return hospitalDao.findByCode(code);
    }
}

+ 2 - 2
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/MedicineAnswerLogService.java

@ -30,7 +30,7 @@ public class MedicineAnswerLogService {
    }
    public MedicineAnswerLog findAnswer(String patientCode,String tp_id,String pb_id){
        return  medicineAnswerLogDao.findAnswer(patientCode,tp_id,pb_id);
    public MedicineAnswerLog findAnswer(String patientCode,String tp_id,String pb_id,String ct_id){
        return  medicineAnswerLogDao.findAnswer(patientCode,tp_id,pb_id,ct_id);
    }
}

+ 15 - 2
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PatientExamService.java

@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.util.List;
/**
 * 患者基本信息类.
@ -25,12 +26,24 @@ public class PatientExamService{
    private PatientExamDao patientExamDao;
    public PatientExam findByPatientAndTpId(String patientCode, String tpId){
        return patientExamDao.findByPatientAndTpId(patientCode,tpId);
    /**
     * 根据居民code和试卷编号 获取最新记录
     * @param patientCode
     * @param tpId
     * @return
     */
    public PatientExam findByPatientAndTpId(String patientCode, String tpId,String ctId){
        List<PatientExam> exames = patientExamDao.findByPatientAndTpId(patientCode, tpId,ctId);
        if(exames!=null && exames.size()>0){
            return exames.get(0);
        }
        return null;
    }
    @Transient
    public void save(PatientExam patientExam){
         patientExamDao.save(patientExam);
    }
}

+ 33 - 0
patient-co-customization/patient-co-modern-medicine/src/main/java/com/yihu/mm/service/PatientService.java

@ -7,7 +7,9 @@ package com.yihu.mm.service;
import com.yihu.mm.repository.wlyy.patient.PatientDao;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -21,9 +23,40 @@ public class PatientService {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private HospitalService hospitalService;
    @Autowired
    private FamilyContractService familyContractService;
    public Patient findByCode(String code) {
        return patientDao.findByCode(code);
    }
    /**
     * 判断是否居民是否  是集美签约居民
     * 返回 0 :未签约,且非厦门市民
     *      1: 未签约,是厦门市民
     *      2: 签约   在集美
     *      3  签约不在集美
     * @return
     */
    public int isSignJM(String patientCode){
        SignFamily signFamily = familyContractService.findSignByPatient(patientCode);
        if(signFamily==null){
            Patient patient = findByCode(patientCode);
            String city = patient.getCity();
            if("350200".equals(city)){
                return 1;
            }
            return 0;
        }
        String hospitalCode = signFamily.getHospital();
        Hospital hospital = hospitalService.findByCode(hospitalCode);
        String town = hospital.getTown();
        if("350211".equals(town)){
            return 2;
        }
        return 3;
    }
}

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

@ -16,13 +16,18 @@ public class PhysicalExaminationService {
    private String yuerenApi;
    public String findExames(String type, String examCode) {
        //先获取key值
        JSONObject params = new JSONObject();
        params.put("tp_type", type);
        params.put("sh_id", examCode);
        //TODO
        params.put("sh_id", "52");
        return HttpClientUtil.postBody(yuerenApi + "/findtest", params);
    }
    /**
     * 获取预约信息   ,并且将
     * @param patient
     * @return
     */
    public String insertslip(Patient patient) {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -79,4 +84,18 @@ public class PhysicalExaminationService {
        params.put("reqtype", 1);
        return HttpClientUtil.postBody(yuerenApi+"/findconconhealth", params);
    }
    public String dillphoneimgdata(String at_id, String answer, String type, String ct_id) {
        JSONObject params = new JSONObject();
        params.put("at_id", at_id);
        params.put("ct_id", ct_id);
        params.put("answer", at_id+"/"+answer);
        if("1".equals(type)||"2".equals(type)){
            params.put("answer_type","图片");
        }else{
            params.put("answer_type","录音");
        }
        params.put("object_type",type);
        return HttpClientUtil.postBody(yuerenApi+"/dillphoneimgdata", params);
    }
}

+ 1 - 1
patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml

@ -1,7 +1,7 @@
server:
  port: 8080
examCode:         #越人试卷题目code
examCode: 84        #越人试卷编号
yuerenApi: http://192.168.131.123:8180/wlyy_admin/yueren       #越人api调用地址
security:

+ 4 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/yueren/YueRenController.java

@ -76,8 +76,11 @@ public class YueRenController extends BaseController {
    @RequestMapping(value = "dillphoneimgdata", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String inserTemp(@RequestBody String jsonString) {
        String key = wlyyMedicineKeyService.getKey();
        JSONObject params = new JSONObject(jsonString);
        params.put("key",wlyyMedicineKeyService.getKey());
        params.put("key",key);
        String answer = params.get("answer").toString();
        params.put("answer","/attach/"+key+"/"+answer);
        String postStr = remoteCall("/yueren/dillphoneimgdata", params);
        return postStr;
    }

+ 2 - 2
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/extract/DBExtract.java

@ -62,7 +62,7 @@ public class DBExtract<T> {
     * @return
     */
    public List<Object> extractByPage(Class<T> clazz,String sql,String countSql,Boolean isMultithreading)throws  Exception{
        int pageSize=10000;
        int pageSize=100000;
        return SpringUtil.getBean(DBPageExtract.class).extractByPage(clazz,sql,countSql,pageSize,isMultithreading);
    }
    /**
@ -72,7 +72,7 @@ public class DBExtract<T> {
     * @return
     */
    public List<Object> extractByPage(Class<T> clazz,String sql)throws  Exception{
        int pageSize=10000;
        int pageSize=100000;
        Boolean isMultithreading=false;
        String countSql="";
        return SpringUtil.getBean(DBPageExtract.class).extractByPage(clazz,sql,countSql,pageSize,isMultithreading);

+ 49 - 37
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/SignJob.java

@ -16,6 +16,8 @@ import com.yihu.wlyy.statistics.vo.WlyyJobConfigVO;
import com.yihu.wlyy.statistics.vo.WlyyQuotaVO;
import org.json.JSONObject;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.jdbc.core.JdbcTemplate;
@ -35,6 +37,8 @@ import java.util.Calendar;
@Scope("prototype")
@DisallowConcurrentExecution//防止到了执行时间点前一任务还在执行中,但是这时有空闲的线程,那么马上又会执行,这样一来就会存在同一job被并行执行
public class SignJob implements Job {
    private Logger logger = LoggerFactory.getLogger(SignJob.class);
    private WlyyQuotaVO wlyyQuota;//指标对象
    private WlyyJobConfigVO wlyyJobConfig;//配置对象
    @Autowired
@ -58,7 +62,7 @@ public class SignJob implements Job {
    @Override
    public void execute(JobExecutionContext context)
            throws JobExecutionException {
        try{
        try {
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            //初始化参数
            JobDataMap map = context.getJobDetail().getJobDataMap();
@ -95,9 +99,10 @@ public class SignJob implements Job {
                    }
                }
            }
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            //如果出錯立即重新執行
            JobExecutionException e2 =new JobExecutionException(e);
            JobExecutionException e2 = new JobExecutionException(e);
            e2.setRefireImmediately(true);
        }
    }
@ -109,38 +114,40 @@ public class SignJob implements Job {
    private void computequotaByPatientSex() {
        jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 6 + "'");
        try{
        try {
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();
            quartzJobLog.setJobStartTime(new Date());
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //从缓存取数据
            CacheModel cacheModel=cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            CacheModel cacheModel = cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(cacheModel.getSignFamilies(),SignDataFilter.level2Sex,cacheModel.getSql(),yesterday);
            FilterModel etlModels = signDataFilter.filter(cacheModel.getSignFamilies(), SignDataFilter.level2Sex, cacheModel.getSql(), yesterday);
            //统计数据 1级维度
            List<Map<String, List<ETLModel>>>  returnDatas= levelRole.elt(etlModels.getEtlModelList());
            List<Map<String, List<ETLModel>>> returnDatas = levelRole.elt(etlModels.getEtlModelList());
            //统计数据 二级维度
            List<Map<String, Map<String, List<ETLModel>>>>  level2Data= level2Role.elt(returnDatas);;
                //保存数据
            dbStorage.saveByLevel2(level2Data,yesterday,wlyyQuota,3,1);
            List<Map<String, Map<String, List<ETLModel>>>> level2Data = level2Role.elt(returnDatas);
            ;
            //保存数据
            dbStorage.saveByLevel2(level2Data, yesterday, wlyyQuota, 3, 1);
            //保存日志
            quartzJobLog.setJobEndTime(new Date());
            quartzJobLog.setJobContent(JsonUtil.objToStr(etlModels.getLogModel()));
            quartzJobLog.setJobType(etlModels.getError()?"1":"0");
            quartzJobLog.setJobType(etlModels.getError() ? "1" : "0");
            quartzJobLogDao.save(quartzJobLog);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /**
     * 机构维度患者分组维度计算指标
     */
    @Transactional
    private void computequotaByPatientGroup() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+7+"'");
        try {
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 7 + "'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();
            quartzJobLog.setJobStartTime(new Date());
@ -152,23 +159,23 @@ public class SignJob implements Job {
            //抽取數據
            //List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            //从缓存取数据
            CacheModel cacheModel=cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            CacheModel cacheModel = cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(cacheModel.getSignFamilies(),SignDataFilter.level2Group,cacheModel.getSql(),yesterday);
            FilterModel etlModels = signDataFilter.filter(cacheModel.getSignFamilies(), SignDataFilter.level2Group, cacheModel.getSql(), yesterday);
            //统计数据 1级维度
            List<Map<String, List<ETLModel>>>  returnDatas= levelRole.elt(etlModels.getEtlModelList());
            List<Map<String, List<ETLModel>>> returnDatas = levelRole.elt(etlModels.getEtlModelList());
            //统计数据 二级维度
            List<Map<String, Map<String, List<ETLModel>>>>  level2Data= level2Role.elt(returnDatas);
            List<Map<String, Map<String, List<ETLModel>>>> level2Data = level2Role.elt(returnDatas);
            //保存数据 1 表示:从1开始循环 6表示:循环6次 3表示 2级维度是 3
             dbStorage.saveByLevel2(level2Data,yesterday,wlyyQuota,7,3,-1);
            dbStorage.saveByLevel2(level2Data, yesterday, wlyyQuota, 7, 3, -1);
            //dbStorage.saveByLevel2(level2Data,yesterday,wlyyQuota,6,3,-1);
            //保存日志
            quartzJobLog.setJobEndTime(new Date());
            quartzJobLog.setJobContent(JsonUtil.objToStr(etlModels.getLogModel()));
            quartzJobLog.setJobType(etlModels.getError()?"1":"0");
            quartzJobLog.setJobType(etlModels.getError() ? "1" : "0");
            quartzJobLogDao.save(quartzJobLog);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
@ -187,19 +194,21 @@ public class SignJob implements Job {
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //从缓存取数据
            CacheModel cacheModel=cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            CacheModel cacheModel = cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(cacheModel.getSignFamilies(),SignDataFilter.level2Age,cacheModel.getSql(),yesterday);
            FilterModel etlModels = signDataFilter.filter(cacheModel.getSignFamilies(), SignDataFilter.level2Age, cacheModel.getSql(), yesterday);
            //统计数据 1级维度
            List<Map<String, List<ETLModel>>>  returnDatas= levelRole.elt(etlModels.getEtlModelList());
            List<Map<String, List<ETLModel>>> returnDatas = levelRole.elt(etlModels.getEtlModelList());
            //统计数据 二级维度
            List<Map<String, Map<String, List<ETLModel>>>>  level2Data= level2Role.elt(returnDatas);;
            List<Map<String, Map<String, List<ETLModel>>>> level2Data = level2Role.elt(returnDatas);
            ;
            //保存数据
            dbStorage.saveByLevel2(level2Data,yesterday,wlyyQuota,6,2);
            dbStorage.saveByLevel2(level2Data, yesterday, wlyyQuota, 6, 2);
            //保存日志
            quartzJobLog.setJobEndTime(new Date());;
            quartzJobLog.setJobEndTime(new Date());
            ;
            quartzJobLog.setJobContent(JsonUtil.objToStr(etlModels.getLogModel()));
            quartzJobLog.setJobType(etlModels.getError()?"1":"0");
            quartzJobLog.setJobType(etlModels.getError() ? "1" : "0");
            quartzJobLogDao.save(quartzJobLog);
        } catch (Exception e) {
            e.printStackTrace();
@ -211,7 +220,7 @@ public class SignJob implements Job {
     */
    @Transactional
    private void computequota() {
        try{
        try {
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='" + yesterday + "' and quato_code='" + 1 + "'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();
@ -219,26 +228,29 @@ public class SignJob implements Job {
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            //找出今天的签约信息 yesterday,now
           // String sql=" select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.expenses_time< '"+yesterday+ Constant.quota_date_last+"' and a.expenses_status=1 ";
            // String sql=" select code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2 and  a.expenses_time< '"+yesterday+ Constant.quota_date_last+"' and a.expenses_status=1 ";
            //抽取數據
           // List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            // List<SignFamily> signFamilies= dbExtract.extract(SignFamily.class,sql);
            //从缓存取数据
            CacheModel cacheModel=cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            CacheModel cacheModel = cachePool.getSignFamilysWithExpenseStatus1ByDate(yesterday);
            logger.info("size:" + cacheModel.getSignFamilies().size());
            logger.info("sql:" + cacheModel.getSql());
            //清洗數據
            FilterModel etlModels= signDataFilter.filter(cacheModel.getSignFamilies(),cacheModel.getSql(),yesterday);
            FilterModel etlModels = signDataFilter.filter(cacheModel.getSignFamilies(), cacheModel.getSql(), yesterday);
            //统计数据
            List<Map<String, List<ETLModel>>>  returnDatas= levelRole.elt(etlModels.getEtlModelList());
            List<Map<String, List<ETLModel>>> returnDatas = levelRole.elt(etlModels.getEtlModelList());
            //保存数据
            dbStorage.saveByLevel1(returnDatas,yesterday,wlyyQuota);
            dbStorage.saveByLevel1(returnDatas, yesterday, wlyyQuota);
            //保存日志
            quartzJobLog.setJobEndTime(new Date());
            quartzJobLog.setJobContent(JsonUtil.objToStr(etlModels.getLogModel()));
            quartzJobLog.setJobType(etlModels.getError()?"1":"0");
            quartzJobLog.setJobType(etlModels.getError() ? "1" : "0");
            quartzJobLogDao.save(quartzJobLog);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    /*
    得到昨天的日期字符串  yyyy-MM-dd
     */

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -427,7 +427,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/HealthJpa.java

@ -42,7 +42,7 @@ public class HealthJpa {
            @Qualifier("healthDataSource") DataSource dataSource) {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.wlyy.health.entity");
        emfb.setPackagesToScan("com.yihu.device.entity");
        emfb.setPersistenceUnitName("health");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();

+ 1 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java

@ -1,14 +1,11 @@
package com.yihu.wlyy.health.repository;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import io.swagger.models.auth.In;
import com.yihu.device.entity.DevicePatientHealthIndex;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.jca.cci.core.InteractionCallback;
import java.util.Date;
import java.util.List;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -2,12 +2,12 @@ package com.yihu.wlyy.service.app.health;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -1,9 +1,9 @@
package com.yihu.wlyy.service.app.message;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.message.MessageDao;

+ 7 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -230,8 +230,13 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    public Map<String, Object> getQrcode(String prescriptionCode ,String patientCode ,Integer type){
        String sql = "select  p2.is_use as isUse,p2.code as dispensaryCode,p2.img_url,p3.hospital_name as hospitalName  from wlyy_prescription_dispensary_code p2 " +
                " left join  wlyy_prescription p1 on p2.prescription_code=p1.code LEFT JOIN wlyy_prescription_expressage p3 on p1.code=p3.prescription_code " +
                " where p2.prescription_code=? and p1.patient=? and p2.type=?  and p2.is_Use=0 ";
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql,prescriptionCode,patientCode,type);
                " where p2.prescription_code=?  and p2.type=?  and p2.is_Use=0 ";
        if(type==2||type==3){
            sql +=" and p3.expressage_code=? ";
        }else{
            sql +=" and p1.patient=? ";
        }
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql,prescriptionCode,type,patientCode);
        if(result.size()>0){
            return result.get(0);
        }

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -695,7 +695,7 @@ public class PrescriptionInfoService extends BaseService {
            }
        }
        if(StringUtils.isNotBlank(teamCode)){
            pre_sql.append(" AND p.admin_team_id = ? ");
            pre_sql.append(" AND pr.admin_team_id = ? ");
            param.add(teamCode);
        }
        if(StringUtils.isNotBlank(nameKey)){
@ -1051,7 +1051,7 @@ public class PrescriptionInfoService extends BaseService {
     * @return 0 审核中,1为处理完成
     */
    public String presCheckState(String code){
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= "+PrescriptionLog.PrescriptionLogStatus.revieweding+" AND pr.status < "+PrescriptionLog.PrescriptionLogStatus.wait_pay);
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= "+PrescriptionLog.PrescriptionLogStatus.revieweding.getValue()+" AND pr.status < "+PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
        List<Map<String,Object>> mp = jdbcTemplate.queryForList(sql.toString(),code);
        if(mp!=null&&mp.size()>0){
            return "0";
@ -1061,7 +1061,7 @@ public class PrescriptionInfoService extends BaseService {
    }
    public String presCheckStateObj(String code){
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= "+PrescriptionLog.PrescriptionLogStatus.revieweding+" AND pr.status < "+PrescriptionLog.PrescriptionLogStatus.wait_pay);
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND pr.status >= "+PrescriptionLog.PrescriptionLogStatus.revieweding.getValue()+" AND pr.status < "+PrescriptionLog.PrescriptionLogStatus.wait_pay.getValue());
        List<Map<String,Object>> mp = jdbcTemplate.queryForList(sql.toString(),code);
        if(mp!=null&&mp.size()>0){
            return (String)((mp.get(0)).get("code"));

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -172,7 +172,7 @@ public class PrescriptionService extends BaseService {
                    jsonObject.put("bcsfcs",1);//本次收费次数
                    jsonObject.put("yszjhm",zyCfinfoObj.getString("VISIT_IDENTITY_CARD_NO"));//医生证件号码
                    jsonObject.put("ysxm00",prescription.getDoctorName());//医生姓名
                    jsonObject.put("mzlb00",101);//门诊类别---普通门诊默认为101
                    jsonObject.put("mzlb00",zyCfinfoObj.getString("INSUR_DISP_REGISTER_TYPE"));//门诊类别---普通门诊默认为101
                    jsonObject.put("sfydgh","N");//是否药店挂号,默认为N,不是药店挂号
                    jsonObject.put("bcghcs",1);//本次挂号次数
                    jsonObject.put("ghksmc",prescription.getDeptName());//挂号科室名称
@ -221,7 +221,7 @@ public class PrescriptionService extends BaseService {
                        j2.put("sptxbm","");//商品条形编码
                        j2.put("yppl00",zySettleDetailObj.getString("FREQUENCY"));//药品频率
                        j2.put("ypyl00",zySettleDetailObj.getString("PHYSIC_DOSE"));//药品用量
                        j2.put("cfhao0",zySettleDetailObj.getString("VISIT_NO"));//处方号
                        j2.put("cfhao0",zySettleDetailObj.getString("RECIPE_NO"));//处方号
                        j2.put("jx0000",zySettleDetailObj.getString("PHYSIC_FORM"));//剂型
                        j2.put("dcyydw",zySettleDetailObj.getString("PHYSIC_DOSE_UNIT"));//单次用药单位
                        j2.put("qyzl00",zySettleDetailObj.getString("PHYSIC_AMOUNT"));//取药总量

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -1,8 +1,8 @@
package com.yihu.wlyy.web.doctor.health;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.BaseController;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -181,7 +181,7 @@ public class PrescriptionInfoController extends BaseController{
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionPay", new JSONObject(prescriptionPay));
            jo.put("prescriptionExpressage", new JSONObject(prescriptionExpressage));
            jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
            jo.put("dispensaryDispensaryType", prescription.getDispensaryType());//处方配送方式

+ 0 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -3,23 +3,14 @@ package com.yihu.wlyy.web.doctor.template;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceDetail;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.template.DoctorTeamGuidanceService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -1,7 +1,7 @@
package com.yihu.wlyy.web.patient.health;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -235,7 +235,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionExpressage", new JSONObject(prescriptionExpressage));
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            jo.put("prescriptionPay", new JSONObject(prescriptionPay));
            jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
            jo.put("prescriptionDispensaryType", prescription.getDispensaryType());//处方配送方式
            jo.put("prescriptionDispensaryTypeName", prescription.getDispensaryTypeName());//处方配送方式

+ 1 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/OpenApiArchiveController.java

@ -1,10 +1,7 @@
package com.yihu.wlyy.web.third;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.third.jw.JwSignService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;