Forráskód Böngészése

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 5 éve
szülő
commit
abc0e0fcd3
18 módosított fájl, 414 hozzáadás és 98 törlés
  1. 6 2
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java
  2. 8 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionEmrDao.java
  3. 121 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 61 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  5. 20 12
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  6. 7 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  7. 4 2
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  8. 2 0
      business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java
  9. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  10. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleDO.java
  11. 7 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 12 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java
  13. 9 6
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java
  14. 18 18
      svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java
  15. 15 15
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  16. 32 29
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java
  17. 28 7
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  18. 62 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 6 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java

@ -1,9 +1,11 @@
package com.yihu.jw.hospital.mapping.service;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import net.sf.json.JSONArray;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
@ -34,6 +36,8 @@ public class PatientMappingService {
    private YkyyEntranceService ykyyEntranceService;
    @Autowired
    private EntranceService entranceService;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -78,11 +82,11 @@ public class PatientMappingService {
        BasePatientDO patientDO = basePatientDao.findById(patient);
        logger.info("patientDO:"+patientDO.toString());
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        if(patientMappingDO!=null){
            return patientMappingDO.getMappingCode();
        }
        com.alibaba.fastjson.JSONArray rs = ykyyEntranceService.findHisPatient(patientDO.getIdcard());
        com.alibaba.fastjson.JSONArray rs = ykyyEntranceService.findHisPatient(patientMedicareCardDO.getCode());
        if(rs!=null&&rs.size()>0){
            //获取居民信息

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionEmrDao.java

@ -18,5 +18,13 @@ public interface PrescriptionEmrDao extends PagingAndSortingRepository<WlyyPresc
    @Query("select a from WlyyPrescriptionEmrDO a where a.prescriptionId = ?1 and a.del=1 ")
    List<WlyyPrescriptionEmrDO> findByPrescriptionId(String prescriptionId);
    @Query("select a from WlyyPrescriptionEmrDO a where a.prescriptionId = ?1 and a.del=1 ")
    WlyyPrescriptionEmrDO findEmrByPrescriptionId(String prescriptionId);
    @Modifying
    @Query("update WlyyPrescriptionEmrDO p set p.del=0 where p.prescriptionId=?1")
    void deleteByPrescriptionId(String prescriptionId);
}

+ 121 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -184,6 +184,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Value("${demo.flag}")
@ -435,6 +437,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //检查检验信息
                List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
                vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(),1),inspectionVOs,WlyyInspectionVO.class));
                //电子病历
                vo.setWlyyPrescriptionEmrDO(prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()));
            }
        }
        rs.put("prescriptions",prescriptionVOs);
@ -1816,7 +1821,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param diagnosisJson
     * @return
     */
    public Map<String, Object> makeDiagnosis(String outPatientId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson) throws Exception {
    public Map<String, Object> makeDiagnosis(String outPatientId, String advice, String type, String infoJsons, String diagnosisJson, String inspectionJson,String emrJson) throws Exception {
        Map<String, Object> result = new HashedMap();
@ -1952,6 +1957,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            //=====================检查检验=======================================================================
            //=====================电子病历=================================================start
            prescriptionEmrDao.deleteByPrescriptionId(prescription.getId());
            if (StringUtils.isNotBlank(emrJson)) {
                WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = com.alibaba.fastjson.JSONObject.parseObject(emrJson,WlyyPrescriptionEmrDO.class);
                wlyyPrescriptionEmrDO.setDel(1);
                wlyyPrescriptionEmrDO.setPrescriptionId(prescription.getId());
                prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
            }
            //=====================电子病历=================================================end
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            //=====================保存日志 start=========================================================
@ -3922,6 +3937,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public Map<String,Object> findPatientInfo(String patient){
        Map<String,Object> rs = new HashedMap();
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        rs.put("id",patient);
        rs.put("name",basePatientDO.getName());
        rs.put("sex",basePatientDO.getSex());
@ -3934,6 +3950,51 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("idcard",basePatientDO.getIdcard());
        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("mobile",basePatientDO.getMobile());
        if (patientMedicareCardDO!=null){
            rs.put("ssc",patientMedicareCardDO.getCode());
        }else {
            rs.put("ssc","");
        }
        return rs;
    }
    public Map<String,Object> updatePatientInfo(String patient,String name,String idcard,String ssc){
        Map<String,Object> rs = new HashedMap();
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        basePatientDO.setName(name);
        basePatientDO.setIdcard(idcard);
        basePatientDO = basePatientDao.save(basePatientDO);
        if (patientMedicareCardDO!=null){
            patientMedicareCardDO.setCode(ssc);
            patientMedicareCardDO=basePatientMedicareCardDao.save(patientMedicareCardDO);
        }else {
            patientMedicareCardDO = new PatientMedicareCardDO();
            patientMedicareCardDO.setCode(ssc);
            patientMedicareCardDO.setType("A_01");
            patientMedicareCardDO.setParentType("A");
            patientMedicareCardDO.setDel("1");
            patientMedicareCardDO.setPatientCode(patient);
            patientMedicareCardDO=basePatientMedicareCardDao.save(patientMedicareCardDO);
        }
        rs.put("id",patient);
        rs.put("name",basePatientDO.getName());
        rs.put("sex",basePatientDO.getSex());
        rs.put("provinceCode",basePatientDO.getProvinceCode());
        rs.put("provinceName",basePatientDO.getProvinceName());
        rs.put("cityCode",basePatientDO.getCityCode());
        rs.put("cityName",basePatientDO.getCityName());
        rs.put("townCode",basePatientDO.getTownCode());
        rs.put("townName",basePatientDO.getTownName());
        rs.put("idcard",basePatientDO.getIdcard());
        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("mobile",basePatientDO.getMobile());
        if (patientMedicareCardDO!=null){
            rs.put("ssc",patientMedicareCardDO.getCode());
        }else {
            rs.put("ssc","");
        }
        return rs;
    }
@ -5667,4 +5728,63 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public String readOutPatient(String registerSn) throws Exception {
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_URL");
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictCode();
        }
        String xmlStr = "<?xml version=\"1.0\" encoding=\"GBK\"?>\n" +
                "<HtRequest>\n";
        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>";
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS");
        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>";
        xmlStr+="</HtRequest>";
        String returnValue = "";
        Map<String, String> params = new HashedMap();
        params.put("type","writeOutPatient");
        params.put("xmlStr",xmlStr);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",
                "manageOutRegister",
                params);
        logger.info("调用电子病历查询接口请求成功,返回值xmlstr:" + returnValue);
        return returnValue;
    }
    public String writeOutPatient(String registerSn,String chiefComplaint,String hpi,String elapsemhis,String bodycheck,String assistanTcheck) throws Exception {
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_URL");
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictCode();
        }
        String xmlStr = "<?xml version=\"1.0\" encoding=\"GBK\"?>\n" +
                "<HtRequest>\n";
        xmlStr+="<REGISTER_SN>"+registerSn+"</REGISTER_SN>";
        String reqTime = DateUtil.dateToStr(new Date(),"yyyyMMddHHmmssSSS");
        xmlStr+="<REQ_TIME>"+reqTime+"</REQ_TIME>";
        xmlStr+="<OUTPATIENT_INFO>";
        xmlStr+="<CHIEF_COMPLAINT>"+chiefComplaint+"</CHIEF_COMPLAINT>";
        xmlStr+="<HPI>"+hpi+"</HPI>";
        xmlStr+="<ELAPSEMHIS>"+elapsemhis+"</ELAPSEMHIS>";
        xmlStr+="<BODYCHECK>"+bodycheck+"</BODYCHECK>";
        xmlStr+="<ASSISTANTCHECK>"+assistanTcheck+"</ASSISTANTCHECK>";
        xmlStr+="</OUTPATIENT_INFO>";
        xmlStr+="</HtRequest>";
        String returnValue = "";
        Map<String, String> params = new HashedMap();
        params.put("type","writeOutPatient");
        params.put("xmlStr",xmlStr);
        returnValue = com.yihu.jw.utils.WebserviceUtil.post(url,
                "http://business.htemr.haitaiinc.com",
                "manageOutRegister",
                params);
        logger.info("调用电子病历写入接口请求成功,返回值xmlstr:" + returnValue);
        return returnValue;
    }
}

+ 61 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -9,16 +9,22 @@ import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.BaseDoctorZsInfoDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.DoctorZsInfoDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionEmrDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.WebserviceUtil;
@ -31,6 +37,8 @@ import com.yihu.jw.util.idcard.IdCardUtil;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
@ -43,7 +51,12 @@ import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
@ -116,6 +129,12 @@ public class EntranceService {
    private PrescriptionDao prescriptionDao;
    @Autowired
    private DoctorZsInfoDao doctorZsInfoDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private OutpatientDao outpatientDao;
    /**
     * 获取本地示例返参
@ -2571,4 +2590,46 @@ public class EntranceService {
    }
/*
    *
     * 请求海康接口方法
     * @param method
     * @param type
     * @param xmlStr
     * @return
     * @throws Exception
    public String sendHaiTaiMethod(String method,String type,String xmlStr) throws Exception {
        String url = "";
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_URL");
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictCode();
        }
        if (!StringUtils.isNoneBlank(url)){
            throw new Exception("url 不存在!");
        }
        logger.info("请求参数:method"+method+"==type"+type+"==="+xmlStr);
        String result = null;
        try {
            org.apache.axis.client.Service service = new org.apache.axis.client.Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(new URL(url));
            call.setOperationName(new QName(url, method)); // 设置要调用哪个方法
            call.addParameter("type", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("xmlStr",XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(XMLType.XSD_STRING);
            String xml = (String)call.invoke(new Object[]{type,xmlStr});
            logger.info("返回值:"+xml);
            XMLSerializer xmlSerializer = new XMLSerializer();
            result = xmlSerializer.read(xml).toString();
        }catch (Exception e){
            e.printStackTrace();
        }
        return result;
    }
*/
}

+ 20 - 12
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -15,6 +15,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.score.BaseEvaluateDO;
import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
@ -31,6 +32,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
@ -130,6 +132,8 @@ public class YkyyEntranceService {
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private DictDoctorDutyDao dictDoctorDutyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private YkyyService ykyyService;
@ -1099,17 +1103,17 @@ public class YkyyEntranceService {
                "yp.pzwh as \"pzwh\""+  " FROM " +
                "V_ZKSG_MZ_YPXX yp where 1=1 ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and yp.ypdm like '%"+ypdm+"%' ";
            sql+=" and lower(yp.ypdm) like '%"+ypdm.toLowerCase()+"%' ";
        }
        if (StringUtils.isNoneBlank(ypmc)){
            sql+=" and yp.ypmc like '%"+ypmc+"%' ";
            sql+=" and lower(yp.ypmc) like '%"+ypmc.toLowerCase()+"%' ";
        }
        if (StringUtils.isNoneBlank(kusl)){
            sql+=" and yp.kusl like '%"+kusl+"%' ";
            sql+=" and lower(yp.kusl) like '%"+kusl.toLowerCase()+"%' ";
        }
        if (StringUtils.isNoneBlank(pydm)){
            sql+=" and yp.pydm like '%"+pydm+"%' ";
            sql+=" and lower(yp.pydm) like '%"+pydm.toLowerCase()+"%' ";
        }
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
@ -1173,7 +1177,7 @@ public class YkyyEntranceService {
                "FROM\n" +
                "\tV_ZKSG_JCXM_MZ mz where 1=1 ";
        if (StringUtils.isNoneBlank(pydm)){
            sql+=" and pydm = '%"+pydm+"%'";
            sql+=" and lower(pydm) = '%"+pydm.toLowerCase()+"%'";
        }
        /*List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);*/
        JSONArray array = new JSONArray();
@ -1199,7 +1203,7 @@ public class YkyyEntranceService {
    public JSONArray findSypc(String pcbm) throws Exception {
        String sql = "select s.pcbm as \"pcbm\",s.pcmc as \"pcmc\",s.pcmc1 as \"pcmc1\" from v_hlw_sypc s where 1=1 ";
        if (StringUtils.isNoneBlank(pcbm)){
            sql+=" and s.pcbm='"+pcbm+"' ";
            sql+=" and lower(s.pcbm)='"+pcbm.toLowerCase()+"' ";
        }
        /*List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        return list;*/
@ -1225,7 +1229,7 @@ public class YkyyEntranceService {
    public JSONArray findYpyf(String pydm) throws Exception {
        String sql = "select y.ypyf as \"ypyf\",y.pydm as \"pydm\",y.xmmc as \"xmmc\" from v_hlw_ypyf y where 1=1  and y.pydm is not null";
        if (StringUtils.isNoneBlank(pydm)){
            sql+=" and y.pydm='"+pydm+"' ";
            sql+=" and lower(y.pydm)='"+pydm.toLowerCase()+"' ";
        }
        /*List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        return list;*/
@ -1247,11 +1251,11 @@ public class YkyyEntranceService {
    /**
     * 获取his病人信息
     * @param idcard
     * @param ssc
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatient(String idcard) throws Exception {
    public JSONArray findHisPatient(String ssc) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
@ -1269,7 +1273,7 @@ public class YkyyEntranceService {
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.sfzh = '"+idcard+"' ";
                "\tx.jzkh = '"+ssc+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -1314,7 +1318,7 @@ public class YkyyEntranceService {
        String sql = "select i.code as \"code\",i.name as \"name\",i.disea_reason as \"disea_reason\",i.death_reason as \"death_reason\",i.py_code as \"py_code\",i.flag as \"flag\",i.add_code as \"add_code\",i.emr as \"emr\" from v_hlw_icd10 i";
        JSONArray array = new JSONArray();
        if (StringUtils.isNoneBlank(pyCode)){
            sql +="  where i.py_code like '%"+pyCode+"%'";
            sql +="  where lower(i.py_code) like '%"+pyCode.toLowerCase()+"%'";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -1465,6 +1469,9 @@ public class YkyyEntranceService {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String patient = wlyyPrescriptionVO.getPatientCode();
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        BasePatientDO patientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        Integer GHXH = 0;
        //挂号明细表HLW_GHMX
@ -1494,7 +1501,7 @@ public class YkyyEntranceService {
        hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
        hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
        //病人性质
        JSONArray jsonArray = findHisPatient(patientMappingDO.getIdcard());
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode());
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
@ -1552,6 +1559,7 @@ public class YkyyEntranceService {
        }
        Integer icd10Flag = 0;
        List<WlyyPrescriptionDiagnosisDO> diagnosisDOs = prescriptionDiagnosisDao.findByPrescriptionId(code,1);
        if(diagnosisDOs!=null&&diagnosisDOs.size()>0){
            WlyyPrescriptionDiagnosisDO diagnosisDO = diagnosisDOs.get(0);

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -834,6 +834,13 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                String msg = "";
                String msgType = "";
                if (map.get("content_type").toString().equalsIgnoreCase("2")){
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("sender","系统");
                    jsonObject.put("msg","病情描述");
                    jsonObject.put("msg_type","0");
                    jsonObject.put("receiver","系统");
                    jsonObject.put("send_time",DateUtil.dateToStr(DateUtil.strToDate(map.get("timestamp").toString(),"yyyy-MM-dd HH:mm:ss"),"yyyy-MM-dd HH:mm:ss"));
                    array.add(jsonObject);
                    msg = consultUpNsOnlineImg(map.get("content").toString(),map.get("id").toString());
                    msgType = "1";
                }else if (map.get("content_type").toString().equalsIgnoreCase("1")){

+ 4 - 2
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -392,8 +392,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if(!StringUtils.isNoneBlank(tradeType)){
            throw new Exception("tradeType is null :the tradeType is "+tradeType);
        }
        if(!StringUtils.isNoneBlank(openId)){
            throw new Exception("openId is null :the openId is "+openId);
        if (tradeType.equalsIgnoreCase("JSAPI")){
            if(!StringUtils.isNoneBlank(openId)){
                throw new Exception("openId is null :the openId is "+openId);
            }
        }
        if(!StringUtils.isNoneBlank(ourTradeNo)){
            throw new Exception("ourTradeNo is null :the ourTradeNo is "+ourTradeNo);

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java

@ -185,4 +185,6 @@ public class HibenateUtils {
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
 /*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/module/ModuleDO.java

@ -237,7 +237,7 @@ public class ModuleDO extends UuidIdentityEntityWithOperator {
		this.isMust = isMust;
	}
	@Column(name = "level")
	@Column(name = "module_level")
	public Integer getLevel() {
		return level;
	}

+ 7 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -237,6 +237,11 @@ public class BaseHospitalRequestMapping {
         */
        public static final String findPatientInfo = "/findPatientInfo";
        /**
         * 获取居民基础信息
         */
        public static final String updatePatientInfo = "/updatePatientInfo";
        /**
         * 保存医生在线排班
         */
@ -412,6 +417,8 @@ public class BaseHospitalRequestMapping {
        public static final String findEmrByPrescriptionId="/findEmrByPrescriptionId";
        public static final String findHisEmr="/findHisEmr";
    }

+ 12 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java

@ -1,6 +1,7 @@
package com.yihu.jw.restmodel.hospital.prescription;
import com.yihu.jw.entity.hospital.prescription.WlyyInspectionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -370,6 +371,9 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "检查检验", example = "模块1")
    private List<WlyyInspectionVO> inspectionVOs;
    @ApiModelProperty(value = "电子病历", example = "模块1")
    private WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO;
    public String getOutpatientId() {
        return outpatientId;
    }
@ -823,4 +827,12 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    public WlyyPrescriptionEmrDO getWlyyPrescriptionEmrDO() {
        return wlyyPrescriptionEmrDO;
    }
    public void setWlyyPrescriptionEmrDO(WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO) {
        this.wlyyPrescriptionEmrDO = wlyyPrescriptionEmrDO;
    }
}

+ 9 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java

@ -14,6 +14,7 @@ import com.yihu.jw.entity.base.org.BaseOrgSaasDO;
import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -65,6 +66,9 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 机构基础信息列表
@ -77,7 +81,7 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
        String codeOrNameValue = null == codeOrName ? "" : codeOrName;
        String sql = "select id,code,name,case del when 1 then '有效' else '失效' end as status,concat(province_name,city_name,town_name,address) as address " +
        String sql = "select id as \"id\",code as \"code\",name as \"name\",case del when 1 then '有效' else '失效' end as status as \"del\",concat(province_name,city_name,town_name,address) as \"address\" " +
                " from base_org " +
                " where " +
                " ((code like '{code}' or ''='{code}')  and (del = '{orgStatus}' or ''='{orgStatus}'))" +
@ -85,13 +89,12 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
                " ((name like '{name}' or ''='{name}') and (del = '{orgStatus}' or ''='{orgStatus}'))" +
                " and" +
                " (del = '{orgStatus}' or ''='{orgStatus}')" +
                "  order by create_time desc limit {start},{end}";
                "  order by create_time desc ";
        String finalSql = sql
                .replace("{code}", "%" + codeOrNameValue + "%")
                .replace("{name}", "%" + codeOrNameValue + "%")
                .replace("{orgStatus}", null == orgStatus ? "" : orgStatus).replace("{start}", String.valueOf(start))
                .replace("{end}", String.valueOf(end));
                .replace("{orgStatus}", null == orgStatus ? "" : orgStatus);
        String countSql = "SELECT count(id)" +
                " FROM base_org " +
@ -105,7 +108,7 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
                .replace("{code}", "%" + codeOrNameValue + "%")
                .replace("{name}", "%" + codeOrNameValue + "%")
                .replace("{orgStatus}", null == orgStatus ? "" : orgStatus);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(finalSql);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(finalSql,page,size);
        Integer count = jdbcTemplate.queryForObject(finalCountSql, Integer.class);
        result.put("count", count);
        result.put("msg", JavaBeanUtils.getInstance().mapListJson(list));
@ -267,7 +270,7 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    public String getOrgAreaTree(String saasId){
        StringBuffer sql = new StringBuffer("SELECT t.* from base_org b,org_tree t,base_org_saas o ")
                .append("WHERE o.saasid='").append(saasId).append("' AND o.org_code = b.`code` AND ")
                .append("(b.`code`= t.`code` or b.city_code=t.`code` or b.province_code = t.`code` or b.town_code=t.`code`)");
                .append("(b.code= t.code or b.city_code=t.code or b.province_code = t.code or b.town_code=t.code)");
        List<TreeNode> treeNodes = new ArrayList<>();
        treeNodes.addAll(jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(OrgTree.class)));

+ 18 - 18
svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java

@ -19,6 +19,7 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.team.BaseTeamMemberDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -62,6 +63,8 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
    @Autowired
    private OrgTreeService orgTreeService;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 新增团队
@ -239,12 +242,12 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
        //获取该机构下的医生列表
        String sql = " SELECT " +
                "  hos.doctor_code AS doctorCode," +
                "  doc.name AS doctorName," +
                "  org.code  AS orgCode," +
                "  org.name     AS orgName," +
                "  dept.code    AS deptCode," +
                "  dept.name    AS deptName" +
                "  hos.doctor_code AS \"doctorCode\"," +
                "  doc.name AS \"doctorName\"," +
                "  org.code  AS \"orgCode\"," +
                "  org.name     AS \"orgName\"," +
                "  dept.code    AS \"deptCode\"," +
                "  dept.name    AS \"deptName\"" +
                " FROM " +
                "  base_doctor_hospital hos," +
                "  dict_hospital_dept dept," +
@ -302,18 +305,18 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
     */
    public JSONObject getTeamInfoList(String teamName,String orgCode,String status,int page,int size,JSONObject userAgent) throws Exception {
        JSONObject result = new JSONObject();
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
      /*  int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;*/
        String teamNameValue = null == teamName ? "" : teamName;
        String orgCodeValue = null == orgCode ? "" : orgCode;
        String statusValue = null == status ? "" : status;
        String sql = " " +
                "SELECT " +
                "  team.id as teamId, " +
                "  team.name as name, " +
                "  case team.del when 0 then '已失效' when 1 then '生效中' end status, " +
                "  org.name as orgName " +
                "  team.id as \"teamId\", " +
                "  team.name as \"name\", " +
                "  case team.del when 0 then '已失效' when 1 then '生效中' end status as \"del\", " +
                "  org.name as \"orgName\" " +
                "FROM " +
                "  base_team team, " +
                "  base_org org " +
@ -322,15 +325,12 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
                "  and (team.name like '{teamName}' or '' ='{teamName}') " +
                "  and (team.org_code = '{orgCode}' or '' = '{orgCode}') " +
                "  and ( team.del = '{status}' or '' = '{status}') " +
                " ORDER BY team.create_time DESC " +
                " limit {start},{end} ";
                " ORDER BY team.create_time DESC " ;
        String finalSql = sql
                .replace("{teamName}","%" + teamNameValue + "%")
                .replace("{orgCode}",orgCodeValue)
                .replace("{status}",statusValue)
                .replace("{start}", String.valueOf(start))
                .replace("{end}", String.valueOf(end));
                .replace("{status}",statusValue);
        String countSql = "SELECT " +
                "  count(team.id) " +
@ -347,7 +347,7 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
                .replace("{orgCode}",orgCodeValue)
                .replace("{status}",statusValue);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(finalSql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(finalSql,page,size);
        int count = jdbcTemplate.queryForObject(finalCountSql,Integer.class);
        result.put("count", count);
        result.put("msg", JavaBeanUtils.getInstance().mapListJson(list));

+ 15 - 15
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -21,6 +21,7 @@ import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
@ -69,6 +70,8 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${configDefault.saasId}")
    private String defaultSaasId;
@ -622,20 +625,20 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
     */
    public JSONObject userInfoList(String name,String saasid,String roleId,int page,int size) throws Exception {
        JSONObject result = new JSONObject();
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
   /*     int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;*/
        String realName = null == name ? "" : name;
        String saasidValue = null == saasid ? "" : saasid;
        String roleIdValue = null == roleId ? "" : roleId;
        String sql = "SELECT " +
                "  user.id as id, " +
                "  user.name as realName, " +
                "  user.username as username, " +
                "  case user.enabled when 0 then '已失效' when 1 then '生效中' end status, " +
                "  user.mobile, " +
                "  saas.name as saasName, " +
                "  role.name as roleName " +
                "  user.id as \"id\", " +
                "  user.name as \"realName\", " +
                "  user.username as \"username\", " +
                "  case user.enabled when 0 then '已失效' when 1 then '生效中' end status as \"enabled\", " +
                "  user.mobile as \"mobile\", " +
                "  saas.name as \"saasName\", " +
                "  role.name as \"roleName\" " +
                " FROM " +
                "  base_user user, " +
                "  base_saas saas, " +
@ -647,14 +650,11 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                " and (user.name like '{realName}' or '' ='{realName}') " +
                "  and (saas.id = '{saasid}' or '' = '{saasid}') " +
                "  and ( user.role_id = '{roleId}' or '' = '{roleId}') " +
                " ORDER BY user.create_time DESC" +
                "  limit {start},{end} ";
                " ORDER BY user.create_time DESC";
        String finalSql = sql
                .replace("{realName}","%" + realName + "%")
                .replace("{saasid}",saasidValue)
                .replace("{roleId}",roleIdValue)
                .replace("{start}",String.valueOf(start))
                .replace("{end}",String.valueOf(end));
                .replace("{roleId}",roleIdValue);
        String countSql = "SELECT " +
                "  count(user.id) " +
@ -674,7 +674,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                .replace("{saasid}",  saasidValue )
                .replace("{roleId}",  roleIdValue );
        List<Map<String, Object>> list = jdbcTemplate.queryForList(finalSql);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(finalSql,page,size);
        Integer count = jdbcTemplate.queryForObject(finalCountSql, Integer.class);
        result.put("count", count);
        result.put("msg", JavaBeanUtils.getInstance().mapListJson(list));

+ 32 - 29
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java

@ -11,6 +11,7 @@ import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.dao.WxTemplateDao;
@ -56,33 +57,35 @@ public class WechatService {
    private WxAccessTokenService wxAccessTokenService;
    @Autowired
    private UserAgent userAgent;
    @Autowired
    private HibenateUtils hibenateUtils;
    //====================微信与租户管理=======================
    public MixEnvelop getWxWechatList(String name,String saasName,Integer status,Integer publicType,Integer page,Integer size){
        String sql = "SELECT " +
                " w.id, " +
                " w.name, " +
                " w.`status`, " +
                " w.type, " +
                " w.public_type AS publicType," +
                " w.token," +
                " w.enc_type AS encType," +
                " w.type," +
                " w.app_id AS appId," +
                " w.app_secret AS appSecret," +
                " w.app_origin_id AS appOriginId," +
                " w.base_url AS baseUrl," +
                " w.user_name AS userName," +
                " w.password," +
                " w.remark," +
                " w.create_time AS createTime," +
                " w.create_user AS createUser," +
                " w.create_user_name AS createUserName," +
                " w.update_time AS updateTime," +
                " w.update_user AS updateUser," +
                " w.update_user_name AS updateUserName" +
                " w.id AS \"id\", " +
                " w.name as \"name\", " +
                " w.status AS \"status\", " +
                " w.type as \"type\", " +
                " w.public_type AS \"publicType\"," +
                " w.token AS \"token\"," +
                " w.enc_type AS \"encType\"," +
                " w.type as \"type\"," +
                " w.app_id AS \"appId\"," +
                " w.app_secret AS \"appSecret\"," +
                " w.app_origin_id AS \"appOriginId\"," +
                " w.base_url AS \"baseUrl\"," +
                " w.user_name AS \"userName\"," +
                " w.password AS \"password\"," +
                " w.remark AS \"remark\"," +
                " w.create_time AS \"createTime\"," +
                " w.create_user AS \"createUser\"," +
                " w.create_user_name AS \"createUserName\"," +
                " w.update_time AS \"updateTime\"," +
                " w.update_user AS \"updateUser\"," +
                " w.update_user_name AS \"updateUserName\"" +
                " FROM " +
                " wx_wechat w ";
        if (StringUtils.isNotBlank(saasName)) {
@ -135,7 +138,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(countSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        return MixEnvelop.getSuccessListWithPage(BaseRequestMapping.WeChat.api_success, list, page, size, count);
@ -143,8 +146,8 @@ public class WechatService {
    public List<WxSaasVO> getWxSaasVOs(String id){
        String sql ="SELECT " +
                " bs.`name` AS saasName, " +
                " bs.id AS saasid" +
                " bs.`name` AS \"saasName\", " +
                " bs.id AS \"saasid\"" +
                " FROM " +
                " wx_wechat_saas s " +
                " JOIN base_saas bs ON bs.id = s.saas_id " +
@ -248,7 +251,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString());
        }
        String sql = "SELECT " +
@ -343,7 +346,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sqlTotal);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        String sql = "SELECT " +
@ -481,7 +484,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count =Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        String sql = "SELECT " +
@ -576,7 +579,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        String sql = "SELECT " +
@ -635,7 +638,7 @@ public class WechatService {
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
            count = Long.parseLong(rstotal.get(0).get("total").toString());
        }
        String sql ="SELECT " +

+ 28 - 7
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -89,7 +89,10 @@ fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
@ -119,7 +122,10 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
@ -157,7 +163,10 @@ wlyy:
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: jwOracleProd
@ -193,7 +202,10 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
@ -223,7 +235,10 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
@ -254,7 +269,10 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
@ -284,4 +302,7 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk

+ 62 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -355,8 +355,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "diagnosisJson", value = "诊断json")
                                    @RequestParam(value = "diagnosisJson", required = true)String diagnosisJson,
                                    @ApiParam(name = "inspectionJson", value = "检查检验")
                                    @RequestParam(value = "inspectionJson", required = false)String inspectionJson)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,advice,type,infoJsons,diagnosisJson,inspectionJson);
                                    @RequestParam(value = "inspectionJson", required = false)String inspectionJson,
                                    @ApiParam(name = "emrJson", value = "电子病历")
                                        @RequestParam(value = "emrJson", required = false)String emrJson)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson);
        try {
            
            com.alibaba.fastjson.JSONObject msgObj = new com.alibaba.fastjson.JSONObject();
@ -681,6 +683,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(prescriptionService.findPatientInfo(patient));
        
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updatePatientInfo)
    @ApiOperation(value = "修改居民信息", notes = "修改居民信息")
    public ObjEnvelop findPatientInfo(@ApiParam(name = "patient", value = "居民ID")
                                      @RequestParam(value = "patient", required = true)String patient,
                                      @ApiParam(name = "name", value = "居民名称")
                                      @RequestParam(value = "name", required = true)String name,
                                      @ApiParam(name = "ssc", value = "社保卡")
                                      @RequestParam(value = "ssc", required = true)String ssc,
                                      @ApiParam(name = "idcard", value = "居民身份证")
                                       @RequestParam(value = "idcard", required = true)String idcard){
        return success(prescriptionService.updatePatientInfo(patient,name,idcard,ssc));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveDoctorOnlineWork)
    @ApiOperation(value = "保存在线排班", notes = "保存在线排班")
@ -1410,7 +1426,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveEmr)
   /* @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveEmr)
    @ApiOperation("创建电子病历")
    public ObjEnvelop saveEmr(
            @ApiParam(name = "emrJson", value = "emrJson", required = true)
@ -1421,7 +1437,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    }*/
    /**
@ -1441,5 +1457,47 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 查询his电子病历
     * @param registerSn
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.findHisEmr)
    @ApiOperation("查询电子病历")
    public ObjEnvelop findHisEmr(
            @ApiParam(name = "registerSn", value = "registerSn", required = true)
            @RequestParam(required = true)String registerSn) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.readOutPatient(registerSn));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveEmr)
    @ApiOperation("写入his电子病历")
    public ObjEnvelop findHisEmr(
            @ApiParam(name = "registerSn", value = "registerSn", required = true)
            @RequestParam(required = true)String registerSn,
            @ApiParam(name = "chiefComplaint", value = "chiefComplaint", required = true)
            @RequestParam(required = true)String chiefComplaint,
            @ApiParam(name = "hpi", value = "hpi", required = true)
            @RequestParam(required = true)String hpi,
            @ApiParam(name = "elapsemhis", value = "elapsemhis", required = true)
            @RequestParam(required = true)String elapsemhis,
            @ApiParam(name = "bodycheck", value = "bodycheck", required = true)
            @RequestParam(required = true)String bodycheck,
            @ApiParam(name = "assistanTcheck", value = "assistanTcheck", required = true)
            @RequestParam(required = true)String assistanTcheck) throws Exception {
        //String registerSn,String chiefComplaint,String hpi,String elapsemhis,String bodycheck,String assistanTcheck
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.writeOutPatient(registerSn,chiefComplaint,hpi,elapsemhis,bodycheck,assistanTcheck));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
}