Browse Source

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

liubing 4 years ago
parent
commit
9de83c4c96
27 changed files with 504 additions and 62 deletions
  1. 22 0
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  2. 188 0
      business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/WlyyHttpLogService.java
  3. 11 0
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java
  4. 22 1
      business/base-service/src/main/java/com/yihu/jw/hospital/message/service/SystemMessageService.java
  5. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TnPrescriptionService.java
  6. 36 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java
  7. 2 2
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  8. 1 1
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  9. 5 5
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  10. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorServiceOrderDO.java
  11. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 0 1
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/WlyyHospitalSysDictDao.java
  13. 9 2
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  14. 14 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java
  15. 61 4
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/methodlog/MethodLogEndpoint.java
  16. 44 0
      svr/svr-door-serivce/sql/初始sql.sql
  17. 1 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoctorController.java
  18. 10 5
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java
  19. 6 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  20. 1 0
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java
  21. 18 18
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/statics/DoorStatisticAnalyzeService.java
  22. 6 6
      svr/svr-door-serivce/src/main/resources/application.yml
  23. 1 0
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  24. 12 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/PrivateDictEndpoint.java
  25. 12 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  26. 3 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  27. 8 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 22 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -11,6 +11,7 @@ import com.yihu.jw.hospital.family.dao.BasePatientMemberDictDao;
import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
@ -56,6 +57,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private YkyyService ykyyService;
    @Value("${wechat.id}")
    private String wxId;
@ -224,6 +227,24 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
                return  mixEnvelop;
            }
        }else if ("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            com.alibaba.fastjson.JSONArray jsonArray1 = tnyyEntranceService.selectPatientMappingCode(idCard);
            if (jsonArray1!=null&&jsonArray1.size()>0){
                com.alibaba.fastjson.JSONObject jsonObject = JSONObject.parseObject(jsonArray1.get(0).toString());
                if (jsonObject!=null){
                    familyId = jsonObject.getString("BRID");
                    String familySex = IdCardUtil.getSexForIdcard(idCard);
                    if (familySex.equalsIgnoreCase("男")){
                        sex =1 ;
                    }else if (familySex.equalsIgnoreCase("女")){
                        sex = 2 ;
                    }
                }
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
                return  mixEnvelop;
            }
        }
        basePatientDO.setSex(sex);
        if ("xm_xzzx_wx".equalsIgnoreCase(wxId)){
@ -249,6 +270,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        basePatientDO.setName(familyName);
        basePatientDO.setIdcard(idCard);
        basePatientDO.setRegister("0");
        basePatientDO.setEnabled(1);
        basePatientDO.setDel("1");
        BasePatientDO sucessPatient= basePatientDao.save(basePatientDO);

+ 188 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/WlyyHttpLogService.java

@ -65,7 +65,78 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
                "b.name as \"doctorName\"" +
                " from wlyy_http_log t left join base_patient a on t.patient = a.id " +
                " left join base_doctor b on t.doctor = b.id where 1=1 and (t.code like '%Check%' or t.name = '合理用药审核接口')";
        if (StringUtils.isNotBlank(startTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+=" and t.create_time > '"+startTime+"'";
                }else {
                    sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time > '"+startTime+"'";
            }
        }
        if (StringUtils.isNotBlank(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+="  and t.create_time<'" + endTime + "'";
                }else {
                    sql+="  and t.create_time< to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sql+="  and t.create_time<'" + endTime + "'";
            }
        }
        if (StringUtils.isNotBlank(faceName)){
            sql+=" and t.name like '%"+faceName+"%'";
        }
        if (StringUtils.isNotBlank(patient)){
            sql+=" and a.name like '%"+patient+"%'";
        }
        if (StringUtils.isNotBlank(doctor)){
            sql+=" and b.name like '%"+doctor+"%'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        mixEnvelop.setTotalCount(count.intValue());
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        return mixEnvelop;
    }
    public MixEnvelop findWlyyHttpLogInBase(String startTime, String endTime, String code,String faceName, String patient, String doctor,String responeKeyWord,String requestKeyWord, Integer page, Integer pageSize){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String sql = "select t.id as \"id\"," +
                "t.code as \"code\"," +
                "t.name as \"name\"," +
                "t.patient as \"patient\"," +
                "t.doctor as \"doctor\"," +
                "t.request as \"request\"," +
                "t.response as \"response\"," +
                "t.status as \"status\",";
        if("xm_ykyy_wx".equals(wxId)){
            if (flag){
                sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
            }else {
                sql+="  to_char(t.create_time,'yyyy-MM-dd HH24:mi:ss') as \"createTime\",";
            }
        }else{
            sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
        }
        sql+=" a.name as \"patientName\"," +
                "b.name as \"doctorName\"" +
                " from wlyy_http_log t left join base_patient a on t.patient = a.id " +
                " left join base_doctor b on t.doctor = b.id where 1=1 ";
        if (StringUtils.isNotBlank(startTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+=" and t.create_time > '"+startTime+"'";
@ -87,6 +158,9 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
                sql+="  and t.create_time<'" + endTime + "'";
            }
        }
        if (StringUtils.isNotBlank(code)){
            sql+=" and t.code = '"+code+"'";
        }
        if (StringUtils.isNotBlank(faceName)){
            sql+=" and t.name like '%"+faceName+"%'";
        }
@ -96,6 +170,120 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
        if (StringUtils.isNotBlank(doctor)){
            sql+=" and b.name like '%"+doctor+"%'";
        }
        if (StringUtils.isNotBlank(requestKeyWord)){
            sql+=" and t.request like '%"+requestKeyWord+"%'";
        }
        if (StringUtils.isNotBlank(responeKeyWord)){
            sql+=" and t.response like '%"+responeKeyWord+"%'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        mixEnvelop.setTotalCount(count.intValue());
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        return mixEnvelop;
    }
    public MixEnvelop findLoginLog(String startTime, String endTime, String userId,String userName, String openId, String userAgent,String loginType,String opreateStart, String opreateEnd,  Integer page, Integer pageSize) {
        MixEnvelop mixEnvelop = new MixEnvelop();
        String sql = "select t.id as \"id\"," +
                "t.user_id as \"userId\"," +
                "p.name as \"patientName\"," +
                "d.name as \"doctorName\"," +
                "t.user_agent as \"userAgent\"," +
                "t.login_type as \"loginType\"," +
                "t.openid as \"openid\"," ;
        if("xm_ykyy_wx".equals(wxId)){
            if (flag){
                sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
            }else {
                sql+="  to_char(t.create_time,'yyyy-MM-dd HH24:mi:ss') as \"createTime\",";
            }
        }else{
            sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
        }
        if("xm_ykyy_wx".equals(wxId)){
            if (flag){
                sql+="date_format(t.operate_time, '%Y-%m-%d %H:%i:%s')  as \"operateTime\",";
            }else {
                sql+="  to_char(t.operate_time,'yyyy-MM-dd HH24:mi:ss') as \"operateTime\",";
            }
        }else{
            sql+="date_format(t.operate_time, '%Y-%m-%d %H:%i:%s')  as \"operateTime\",";
        }
        sql+=" a.name as \"patientName\"," +
                "b.name as \"doctorName\"" +
                " from wlyy_http_log t left join base_patient p on t.user_id = p.id " +
                " left join base_doctor d on t.user_id = d.id where 1=1 ";
        if (StringUtils.isNotBlank(startTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+=" and t.create_time > '"+startTime+"'";
                }else {
                    sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time > '"+startTime+"'";
            }
        }
        if (StringUtils.isNotBlank(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+="  and t.create_time<'" + endTime + "'";
                }else {
                    sql+="  and t.create_time< to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sql+="  and t.create_time<'" + endTime + "'";
            }
        }
        if (StringUtils.isNotBlank(userId)){
            sql+=" and t.user_id = '"+userId+"'";
        }
        if (StringUtils.isNoneBlank(userName)){
            if ("2".equalsIgnoreCase(loginType)){
                sql+=" and d.name like '%"+userName+"%'";
            }else {
                sql+=" and p.name like '%"+userName+"%'";
            }
        }
        if (StringUtils.isNotBlank(loginType)){
            sql+=" and t.login_type ='"+loginType+"'";
        }
        if (StringUtils.isNotBlank(openId)){
            sql+=" and t.openId like '%"+openId+"%'";
        }
        if (StringUtils.isNotBlank(userAgent)){
            sql+=" and t.user_agent like '%"+userAgent+"%'";
        }
        if (StringUtils.isNotBlank(opreateStart)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+=" and t.operate_time > '"+opreateStart+"'";
                }else {
                    sql+=" and t.operate_time > to_date('" + opreateStart + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.operate_time > '"+opreateStart+"'";
            }
        }
        if (StringUtils.isNotBlank(opreateEnd)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+="  and t.operate_time<'" + opreateEnd + "'";
                }else {
                    sql+="  and t.operate_time< to_date('" + opreateEnd + "','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sql+="  and t.operate_time<'" + opreateEnd + "'";
            }
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;

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

@ -10,6 +10,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -151,4 +152,14 @@ public class PatientMappingService {
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(code);
        return patientMappingDO;
    }
    public PatientMappingDO findPatientNoByPatientCodeOrIdcard(String code,String idCard){
        if (StringUtils.isNotBlank(code)){
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(code);
            return patientMappingDO;
        }else if (StringUtils.isNoneBlank(idCard)){
            PatientMappingDO patientMappingDO =  patientMappingDao.findByIdcard(idCard);
            return patientMappingDO;
        }
        return null;
    }
}

+ 22 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/SystemMessageService.java

@ -1,9 +1,12 @@
package com.yihu.jw.hospital.message.service;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -21,6 +24,8 @@ public class SystemMessageService extends BaseJpaService<SystemMessageDO,SystemM
    @Autowired
    private SystemMessageDao systemMessageDao;
    @Autowired
    private ObjectMapper objectMapper;
    /**
@ -87,7 +92,23 @@ public class SystemMessageService extends BaseJpaService<SystemMessageDO,SystemM
        return systemMessageDO;
    }
    /**
     * 发送系统消息通用接口
     */
    public  SystemMessageDO commenSystemMessage(String jsonParam,String jsonContent) throws Exception{
        if (StringUtils.isNoneBlank(jsonParam)){
            SystemMessageDO systemMessageDO = objectMapper.readValue(jsonParam,SystemMessageDO.class);
            systemMessageDO.setDel("1");
            systemMessageDO.setIsRead("0");
            if (StringUtils.isNoneBlank(jsonContent)){
                JSONObject jsonObject = JSONObject.parseObject(jsonContent);
                systemMessageDO.setData(jsonObject.toJSONString());
            }
            systemMessageDao.save(systemMessageDO);
            return systemMessageDO;
        }
        return null;
    }
}

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

@ -495,7 +495,7 @@ public class TnPrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pr
            object.put("specification",map.get("YPGG"));
            object.put("pack_unit_name",map.get("YPDW"));
            object.put("mini_unit",map.get("UNITCODE"));
            object.put("mini_unit_name",map.get("UNITCODENAME"));
            object.put("mini_unit_name",map.get("UNTCODENAME"));
            object.put("weigh_unit_name",map.get("ZXDW"));
            object.put("weigh_unit",map.get("ZXDW"));
            object.put("pack_unit",map.get("YPDW"));

+ 36 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java

@ -266,7 +266,7 @@ public class TnyyEntranceService {
    public JSONArray findTnYpxx(String ypdm,String ypmc,String kusl,String pydm ,String hisCode) throws Exception {
        String sql ="SELECT yp.YPXH,yp.XTSB,yp.YPMC,yp.YPGG,yp.YFGG,yp.BFGG,yp.YPSX,yp.TSYP,yp.YPDW,yp.ZXDW,yp.ZXBZ,yp.YFBZ,yp.YFDW,yp.BFBZ," +
                "yp.BFDW,yp.ZFPB,yp.YLXZ,yp.FYFS,yp.PYDM,yp.YPBH,yp.MESS,yp.GYFF,yp.TYPE,yp.YPDM,yp.YPJL,yp.JLDW,yp.YKZF,yp.YFZF,yp.ZXCD,yp.YCYL," +
                "kc.YPCD,kc.LSJG,kc.KCSL,kc.BZLJ,yp.UNITCODE,yp.UNITCODENAME  FROM  YK_TYPK yp,YK_KCMX kc where 1=1 and kc.YPXH=yp.YPXH ";
                "kc.YPCD,kc.LSJG,kc.KCSL,kc.BZLJ,yp.UNITCODE,yp.UNTCODENAME  FROM  YK_TYPK yp,YK_KCMX kc where 1=1 and kc.YPXH=yp.YPXH ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and lower(YPDM) like '%"+ypdm.toLowerCase()+"%' ";
        }
@ -509,8 +509,8 @@ public class TnyyEntranceService {
                wlyyOutpatientVO.setIcd10Name(icdName);
                String admDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + "";
                String conDate = null == jsonObjectMgsInfo.get("KSSJ") ? "" : jsonObjectMgsInfo.get("KSSJ") + "";
                wlyyOutpatientVO.setAdmDate(DateUtil.strToDate(admDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVO.setConDate(DateUtil.strToDate(conDate, DateUtil.YYYY_MM_DD_HH_MM_SS_));
                wlyyOutpatientVO.setAdmDate(DateUtil.stampToDate(admDate));
                wlyyOutpatientVO.setConDate(DateUtil.stampToDate(admDate));
                List<WlyyInspectionVO> inspectionVOList = new ArrayList<>();
                /*JSONArray array = findV_ZKSG_JCCX(PAT_NO,wlyyOutpatientVO.getAdmNo(),demoFlag);
                for (int j=0;j<array.size();j++){
@ -701,13 +701,17 @@ public class TnyyEntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray selectMzRecord(String doctor) throws Exception {
    public JSONArray selectMzRecord(String doctor,String patientName) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String condition = "";
        if (doctorMappingDO!=null){
            condition = " and mz.YSDM ='"+doctorMappingDO.getMappingCode()+"' ";
        }
        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT mz.BRBH FROM YS_MZ_JZLS mz where 1=1 "+condition+" GROUP BY mz.BRBH ) and br.SFZH is not null and br.BRXM !='作废' ";
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and br.BRXM like '%"+patientName+"%'";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("selectMzRecord:"+sql);
@ -717,11 +721,23 @@ public class TnyyEntranceService {
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array = new JSONArray();
        JSONArray array1 = new JSONArray();
        if(status!=null&&status == 200){
            array = rs.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = JSONObject.parseObject(array.get(i).toString());
                if (jsonObject.get("SFZH")!=null){
                    String szfh = jsonObject.getString("SFZH");
                    jsonObject.put("sex",IdCardUtil.getSexForIdcard(szfh));
                    jsonObject.put("age",IdCardUtil.getAgeForIdcard(szfh));
                }
                array1.add(jsonObject);
            }
            logger.info("selectMzRecord size:"+array.size());
        }
        return array;
        return array1;
    }
    /**
@ -730,7 +746,7 @@ public class TnyyEntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray selectZyRecord(String doctor) throws Exception {
    public JSONArray selectZyRecord(String doctor,String patientName) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String condition = "";
        if (doctorMappingDO!=null){
@ -739,6 +755,9 @@ public class TnyyEntranceService {
            return null;
        }
        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay ,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT cast(brry.BAHM as numeric(18,0)) FROM ZY_BRRY brry where 1=1 and isnumeric(brry.BAHM) = 1 "+condition+" GROUP BY brry.BAHM) and br.BRXM !='作废' and br.SFZH is not null ";
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and br.BRXM like '%"+patientName+"%' ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("selectZyRecord:"+sql);
@ -748,11 +767,21 @@ public class TnyyEntranceService {
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array = new JSONArray();
        JSONArray array1 = new JSONArray();
        if(status!=null&&status == 200){
            array = rs.getJSONArray("detailModelList");
            for (int i = 0;i<array.size();i++){
                JSONObject jsonObject = JSONObject.parseObject(array.get(i).toString());
                if (jsonObject.get("SFZH")!=null){
                    String szfh = jsonObject.getString("SFZH");
                    jsonObject.put("sex",IdCardUtil.getSexForIdcard(szfh));
                    jsonObject.put("age",IdCardUtil.getAgeForIdcard(szfh));
                }
                array1.add(jsonObject);
            }
            logger.info("selectZyRecord size:"+array.size());
        }
        return array;
        return array1;
    }
@ -823,7 +852,6 @@ public class TnyyEntranceService {
                "\tV_ZY_BRRY brry\n" +
                "where\n" +
                "  brry.BAHM ='"+brid+"' ";
        sql += " order by h.KSSJ desc";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);

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

@ -376,9 +376,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("cert_no",  info.get("cert_no")== null ? "0":info.get("cert_no"));
                jb.put("prac_no",  info.get("prac_no")== null ? "0":info.get("prac_no"));
                //资格证书
                jb.put("doc_cert",ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"资格证.jpg"));
                jb.put("doc_cert",ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"zg.jpg"));
                //执业证书
                jb.put("cert_doc_prac", ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"执业证.jpg"));
                jb.put("cert_doc_prac", ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"zy.jpg"));
                jb.put("txt_introduction",StringUtils.isNoneBlank(superviseDataDict.getTxtIntroduction())?superviseDataDict.getTxtIntroduction():"");
            }catch (Exception e){

+ 1 - 1
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -4144,7 +4144,7 @@ public class StatisticsEsService {
            //已接诊
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode,"1");
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,lowCode,"0");
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel2(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel,lowCode,"0");
            logger.info("noReceiveTotal"+noReceiveTotal==null?"0":String.valueOf(noReceiveTotal.size())+";"+noReceiveTotal.get(0).getResult1());
                result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));
    }

+ 5 - 5
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -352,7 +352,7 @@ public class ElasticsearchUtil {
//        sql.append(" quotaCode='" + index + "'  ");
        sql.append(" quotaCode in(" + index + ")  ");
        sql.append(" and timeLevel='" + timeLevel + "'  ");
//        sql.append(" and areaLevel='6'");
        sql.append(" and areaLevel='6'");
        if (StringUtils.isNotEmpty(startDate)) {
            sql.append(" and quotaDate>='" + startDate + "'");
        }
@ -741,7 +741,7 @@ public class ElasticsearchUtil {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor asdoctor,doctorName asdoctorName,slaveKey1 asslaveKey1,slaveKey1Name asslaveKey1Name,slaveKey2 asslaveKey2,slaveKey2Name asslaveKey2Name,sum(result1) as result1,sum(result2) as result2 from " + esIndex + " where ");
            sql.append("select doctor as doctor,doctorName as doctorName,slaveKey1 as slaveKey1,slaveKey1Name as slaveKey1Name,slaveKey2 as slaveKey2,slaveKey2Name as slaveKey2Name,sum(result1) as result1,sum(result2) as result2 from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -777,7 +777,7 @@ public class ElasticsearchUtil {
                groupBy.append(",slaveKey2,slaveKey2Name");
            }
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city as city,cityName as cityName,slaveKey1 as slaveKey1,slaveKey1Name as slaveKey1Name,slaveKey2 as result1,slaveKey2Name as result1,sum(result1) as result1,sum(result2) as result2 from " + esIndex + " where ");
            sql.append("select city as city,cityName as cityName,slaveKey1 as slaveKey1,slaveKey1Name as slaveKey1Name,slaveKey2 as slaveKey2,slaveKey2Name as slaveKey2Name,sum(result1) as result1,sum(result2) as result2 from " + esIndex + " where ");
            groupBy.append("  group by city,cityName");
            if (!org.springframework.util.StringUtils.isEmpty(slaveKey1) || commonParams.equals(slaveKey1)) {
                groupBy.append(",slaveKey1,slaveKey1Name");
@ -803,7 +803,7 @@ public class ElasticsearchUtil {
        }
        sql.append(" quotaCode in(" + index + ")  ");
        sql.append(" and timeLevel='" + timeLevel + "'  ");
//        sql.append(" and areaLevel='6'");
        sql.append(" and areaLevel='6'");
        if (StringUtils.isNotEmpty(startDate)) {
            sql.append(" and quotaDate>='" + startDate + "'");
        }
@ -1831,7 +1831,7 @@ public class ElasticsearchUtil {
//        sql.append(" quotaCode='" + index + "'  ");
        sql.append(" quotaCode in(" + index + ")  ");
        sql.append(" and timeLevel='" + timeLevel + "'  ");
//        sql.append(" and areaLevel='5'");
        sql.append(" and areaLevel='6'");
        if (StringUtils.isNotEmpty(startDate)) {
            sql.append(" and quotaDate>='" + startDate + "'");
        }

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorServiceOrderDO.java

@ -541,6 +541,7 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
    private Integer conclusionStatus;//服务小结登记状态:1待补录;2-已补录
    private Integer prescriptionStatus;//开方状态:1开方完成,0未开方
    private String prescriptionCode;//处方单号,多个用逗号隔开
    private String outpatientId;//复诊id
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date prescriptionTime;//开方完成时间
    private Integer type;//发起工单类型(1本人发起 2家人待预约 3医生代预约)
@ -1183,4 +1184,12 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
        this.shortcutType = shortcutType;
    }
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
}

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

@ -1227,6 +1227,7 @@ public class BaseHospitalRequestMapping {
        public static final String updateMessage  = "/updateMessage";
        public static final String searchMessagePageList  = "/searchMessagePageList";
        public static final String queryById  = "/queryById";
        public static final String commenSystemMessage  = "/commenSystemMessage";
    }
    /**

+ 0 - 1
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/WlyyHospitalSysDictDao.java

@ -1,6 +1,5 @@
package com.yihu.jw.gateway.methlog;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

+ 9 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -9,6 +9,7 @@ import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -18,6 +19,7 @@ import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.WechatDao;
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.login.service.BaseLoginLogService;
import com.yihu.jw.security.model.*;
@ -154,6 +156,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @Autowired
    private WlyyHospitalSysDictDao wlyyhospitalSysdictDao;
    @PostConstruct
    private void init() {
        super.setTokenGranter(tokenGranter);
@ -1546,11 +1549,11 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            throw new InvalidRequestException("client_id is null");
        }
       /* if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
        if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
            //验证码正确
        } else {
            return ObjEnvelop.getError("验证码错误!");
        }*/
        }
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            try {
                List<BasePatientDO> basePatientDOS =basePatientDao.findByMobileAndDel(mobile,"1");
@ -1726,7 +1729,11 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
            if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
                if (captcha.equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){
                }else {
                    return ObjEnvelop.getError("验证码错误!");
                }
            }else {
                if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
                    //验证码正确

+ 14 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java

@ -4,15 +4,18 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.BasePatientMedicareCardDao;
import com.yihu.jw.security.dao.patient.BasePatientWechatDao;
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -37,9 +40,13 @@ public class RegisterService {
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private WlyyPatientFamilyMemberDao familyMemberDao;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private YkyyService ykyyService;
@ -133,7 +140,6 @@ public class RegisterService {
            patient.setLocked(0);
            patient.setCreateTime(new Date());
            patient.setUpdateTime(new Date());
            BasePatientDO temp = basePatientDao.save(patient);
            PatientMedicareCardDO medicareCardDO = new PatientMedicareCardDO();
@ -143,6 +149,13 @@ public class RegisterService {
            medicareCardDO.setPatientCode(temp.getId());
            basePatientMedicareCardDao.save(medicareCardDO);
            WlyyPatientFamilyMemberDO wlyyPatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
            wlyyPatientFamilyMemberDO.setIsDel(1);
            wlyyPatientFamilyMemberDO.setPatient(patient.getId());
            wlyyPatientFamilyMemberDO.setFamilyMember(patient.getId());
            wlyyPatientFamilyMemberDO.setFamilyRelation("7");
            wlyyPatientFamilyMemberDO.setFamilyRelationName("本人");
            familyMemberDao.save(wlyyPatientFamilyMemberDO);
            /*if (org.apache.commons.lang3.StringUtils.isNoneBlank(wxId)&&wxId.equalsIgnoreCase("xm_ykyy_wx")){
                ykyyService.registerYkt(temp.getId(),pw,captcha);
            }*/

+ 61 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/methodlog/MethodLogEndpoint.java

@ -3,7 +3,9 @@ package com.yihu.jw.base.endpoint.methodlog;
import com.yihu.jw.base.methlog.BaseMethodLogDO;
import com.yihu.jw.base.methlog.BaseMethodLogService;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
@ -12,10 +14,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -31,6 +30,8 @@ public class MethodLogEndpoint extends EnvelopRestEndpoint {
	
	@Autowired
	private BaseMethodLogService baseMethodLogService;
	@Autowired
	private WlyyHttpLogService wlyyHttpLogService;
	
	@GetMapping(value = BaseRequestMapping.BaseMethodLog.getLog)
	@ApiOperation(value = "获取分页")
@ -54,4 +55,60 @@ public class MethodLogEndpoint extends EnvelopRestEndpoint {
		int count = (int) baseMethodLogService.getCount(filters);
		return success(baseDoctors, count, page, size);
	}
	@PostMapping(value = "/findHttpLog")
	@ApiOperation(value = "查询接口操作日志")
	public MixEnvelop findHttpLog(@ApiParam(name = "startTime", value = "startTime")
								  @RequestParam(value = "startTime", required = false) String startTime,
								  @ApiParam(name = "endTime", value = "endTime")
								  @RequestParam(value = "endTime", required = false) String endTime,
								  @ApiParam(name = "interfaceName", value = "interfaceName")
								  @RequestParam(value = "interfaceName", required = false) String interfaceName,
								  @ApiParam(name = "code", value = "code")
                                  @RequestParam(value = "code", required = false) String code,
								  @ApiParam(name = "patient", value = "patient")
								  @RequestParam(value = "patient", required = false) String patient,
								  @ApiParam(name = "doctor", value = "doctor")
								  @RequestParam(value = "doctor", required = false) String doctor,
								  @ApiParam(name = "responseKeyWord", value = "返回值关键字")
									  @RequestParam(value = "responseKeyWord", required = false) String responseKeyWord,
								  @ApiParam(name = "requestKeyWord", value = "请求参数关键字")
									  @RequestParam(value = "requestKeyWord", required = false) String requestKeyWord,
								  @ApiParam(name = "page", value = "page")
								  @RequestParam(value = "page", required = false) Integer page,
								  @ApiParam(name = "pageSize", value = "pageSize")
								  @RequestParam(value = "pageSize", required = false) Integer pageSize
	) {
		return wlyyHttpLogService.findWlyyHttpLogInBase(startTime,endTime,code,interfaceName,patient,doctor,responseKeyWord,requestKeyWord,page,pageSize);
	}
	@GetMapping(value = "/findLoginLog")
	@ApiOperation(value = "查询接口操作日志")
	public MixEnvelop findLoginLog(@ApiParam(name = "startTime", value = "startTime")
								  @RequestParam(value = "startTime", required = false) String startTime,
								  @ApiParam(name = "endTime", value = "endTime")
								  @RequestParam(value = "endTime", required = false) String endTime,
								   @ApiParam(name = "opreateStart", value = "opreateStart")
									   @RequestParam(value = "opreateStart", required = false) String opreateStart,
								   @ApiParam(name = "opreateEnd", value = "opreateEnd")
									   @RequestParam(value = "opreateEnd", required = false) String opreateEnd,
								  @ApiParam(name = "userId", value = "userId")
								  @RequestParam(value = "userId", required = false) String userId,
								  @ApiParam(name = "userName", value = "userName")
								  @RequestParam(value = "userName", required = false) String userName,
								  @ApiParam(name = "openId", value = "openId")
								  @RequestParam(value = "openId", required = false) String openId,
								  @ApiParam(name = "userAgent", value = "userAgent")
								  @RequestParam(value = "userAgent", required = false) String userAgent,
								  @ApiParam(name = "loginType", value = "2医生 3 患者 4 授权")
								  @RequestParam(value = "loginType", required = false) String loginType,
								  @ApiParam(name = "page", value = "page")
								  @RequestParam(value = "page", required = false) Integer page,
								  @ApiParam(name = "pageSize", value = "pageSize")
								  @RequestParam(value = "pageSize", required = false) Integer pageSize
	) {
		return wlyyHttpLogService.findLoginLog(startTime,endTime,userId,userName,openId,userAgent, loginType, opreateStart, opreateEnd,page,pageSize);
	}
}

File diff suppressed because it is too large
+ 44 - 0
svr/svr-door-serivce/sql/初始sql.sql


+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoctorController.java

@ -84,7 +84,7 @@ public class DoctorController extends BaseController {
    @GetMapping(value = "/patientList")
    @ApiOperation("查询居民列表信息")
    public String patientList(
        @ApiParam(name = "name", value = "分页大小", required = false) @RequestParam(value = "name", required = false) String name,
        @ApiParam(name = "name", value = "居民姓名", required = false) @RequestParam(value = "name", required = false) String name,
        @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
        @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size
        ) {

+ 10 - 5
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java

@ -254,12 +254,17 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
            @ApiParam(name = "doctorName", value = "医生姓名") @RequestParam(value = "doctorName") String doctorName,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size) {
        JSONObject result = wlyyDoorServiceOrderService.queryDoctorList(getUID(),hospital, doctorName, null, page, size);
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return PageEnvelop.getError(result.getString(ResponseContant.resultMsg), -1);
        try {
            JSONObject result = wlyyDoorServiceOrderService.queryDoctorList(getUID(),hospital, doctorName, null, page, size);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
                return PageEnvelop.getError(result.getString(ResponseContant.resultMsg), -1);
            }
            int count = result.getIntValue(ResponseContant.count);
            return success((List) result.get(ResponseContant.resultMsg), count, page, size);
        }catch (Exception e){
            e.printStackTrace();
        }
        int count = result.getIntValue(ResponseContant.count);
        return success((List) result.get(ResponseContant.resultMsg), count, page, size);
        return PageEnvelop.getSuccess("查询失败");
    }
    @PostMapping("updateIsPatientConfirm")

+ 6 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -1,5 +1,6 @@
package com.yihu.jw.door.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -435,6 +436,11 @@ public class DoorOrderService {
        JSONObject json = new JSONObject();
        json.put("outpatientJson", outpatientJson);
        String res = httpClientUtil.postBody(url,json);
        JSONObject resJson = JSON.parseObject(res);
        if( 200 == resJson.getInteger("status")){
            orderDO.setOutpatientId(resJson.getJSONObject("obj").getString("id"));
            doorServiceOrderDao.save(orderDO);
        }
        System.out.println("appointmentRevisitOnDoor res:"+res);
    }

+ 1 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -629,6 +629,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        try {
            successOrNot = consultTeamService.addDoorServiceConsult(orderDO.getId());
        } catch (Exception e) {
            e.printStackTrace();
            String failMsg = "创建咨询时异常: " + e.getMessage();
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);

+ 18 - 18
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/statics/DoorStatisticAnalyzeService.java

@ -193,8 +193,8 @@ public class DoorStatisticAnalyzeService {
        }
        List<Map<String,Object>> result = new ArrayList<>();
        for(BaseTownDO one:areaCode) {
            List<SaveModel> townList = findDateQuotaLevel1(startDate, endDate, one.getCode(), 3, "121", "1", null, type);//区
            List<SaveModel> orgList = findDateQuotaLevel1(startDate, endDate, one.getCode(), 3, "121", "1", "4", type);//机构
            List<SaveModel> townList = findDateQuotaLevel1(startDate, endDate, one.getCode(), 3, "22", "1", null, type);//区
            List<SaveModel> orgList = findDateQuotaLevel1(startDate, endDate, one.getCode(), 3, "22", "1", "4", type);//机构
            Map<String, List<SaveModel>> map = townList.stream().collect(Collectors.groupingBy(SaveModel::getSlaveKey1));
            Map<String, List<SaveModel>> map1 = orgList.stream().collect(Collectors.groupingBy(SaveModel::getHospital));
@ -259,7 +259,7 @@ public class DoorStatisticAnalyzeService {
    public Map<String,Object> doorServiceOrderAnalyzeHead(String area,String startDate,String endDate, Integer type,Integer level)throws Exception{
        Map<String, Object> resultMap = new HashMap();
        String low_level = String.valueOf(level + 1);
        List<SaveModel> esModelList = findDateQuotaLevel1(startDate, endDate, area, level, "121", "1", low_level, type);
        List<SaveModel> esModelList = findDateQuotaLevel1(startDate, endDate, area, level, "22", "1", low_level, type);
        DecimalFormat df = new DecimalFormat("0.00");
        if (esModelList != null && esModelList.size() > 0) {
        Map<String, List<SaveModel>> map2 = esModelList.stream().collect(Collectors.groupingBy(SaveModel::getSlaveKey1));
@ -296,7 +296,7 @@ public class DoorStatisticAnalyzeService {
        }else{
            lowLevel = String.valueOf(level + 1);
        }
        List<SaveModel> esModelList = findDateQuotaLevel1(startDate, endDate, area, level, "121", "1", lowLevel, type);
        List<SaveModel> esModelList = findDateQuotaLevel1(startDate, endDate, area, level, "22", "1", lowLevel, type);
        Map<String, List<SaveModel>> map = null;
        DecimalFormat df = new DecimalFormat("0.00");
        if (esModelList != null && esModelList.size() > 0) {
@ -1179,7 +1179,7 @@ public class DoorStatisticAnalyzeService {
        resMap.put("doorPatientServiceCount", doorPatientService);
        //获取上门服务资质服务人群分析,到达量
        List<SaveModel> voucherList = findDateQuotaLevel1(endDate, endDate, area, level, "133", "2", level + "", null);
        List<SaveModel> voucherList = findDateQuotaLevel1(endDate, endDate, area, level, "23", "2", level + "", null);
        resMap.put("voucherList", voucherList);
        //获取上门服务处方主诊断疾病分析
@ -1193,8 +1193,8 @@ public class DoorStatisticAnalyzeService {
        resMap.put("itemList", itemList);
        //获取服务工单排行
        List<SaveModel> orderList = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, "121", "1", null, level + "");
        List<SaveModel> slaveList = findDateQuotaLevel1(startDate, endDate, area, level, "121", "1", level + "", null);
        List<SaveModel> orderList = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, "22", "1", null, level + "");
        List<SaveModel> slaveList = findDateQuotaLevel1(startDate, endDate, area, level, "22", "1", level + "", null);
        Map<String, List<SaveModel>> map = slaveList.stream().collect(Collectors.groupingBy(SaveModel::getSlaveKey1));
//        resMap.put("orderList", orderList);
        //计算服务评价均分
@ -1284,7 +1284,7 @@ public class DoorStatisticAnalyzeService {
    public JSONArray getOrderLowlevelAll(String startDate, String endDate, String area, int level, int sort, String lowLevel, String year) throws Exception {
        List<Map<String, Object>> resultList = new ArrayList<>();
        //工单状态列表
        List<SaveModel> slaveList = findDateQuotaLevel1(startDate, endDate, area, level, "121", "1", lowLevel, null);
        List<SaveModel> slaveList = findDateQuotaLevel1(startDate, endDate, area, level, "22", "1", lowLevel, null);
        Map<String, List<SaveModel>> map1 = new HashMap<>();
        if (SaveModel.OrgLevel.equals(lowLevel)) {
            map1 = slaveList.stream().collect(Collectors.groupingBy(SaveModel::getHospital));
@ -1374,11 +1374,11 @@ public class DoorStatisticAnalyzeService {
        startDate = statisticsUtilService.getStartDate(startDate,endDate);
        //已服务居民
        long servedPatientNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"178",null);
        long servedPatientNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"26",null);
        //服务工单
        long serviceOrderNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"121","5,6");
        long serviceOrderNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"22","5,6");
        //开具处方
        long doorPrescriptionNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"134",null);
        long doorPrescriptionNum = statisticsUtilService.getTotalAmountDDLOrZL(startDate,endDate,area,level,"24",null);
        resMap.put("serviceOrderNum", serviceOrderNum);
        resMap.put("doorPrescriptionNum", doorPrescriptionNum);
        resMap.put("servedPatientNum", servedPatientNum);
@ -1386,11 +1386,11 @@ public class DoorStatisticAnalyzeService {
        String ddlOrZl = statisticsUtilService.getDDLOrZL(startDate,endDate);
        //服务费用:上门服务的开单以及处方收入费用
        List<SaveModel> priceList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "177", ddlOrZl, null, "020", null, null);
        List<SaveModel> priceList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "25", ddlOrZl, null, "020", null, null);
        resMap.put("totalPrice", priceList.get(0).getResult1());
        //服务类型
        List<SaveModel> doorServiceTypeList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "121", ddlOrZl, null, statisticsUtilService.commonParams, null, null);
        List<SaveModel> doorServiceTypeList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "22", ddlOrZl, null, statisticsUtilService.commonParams, null, null);
        List<Map<String,Object>> doorServiceTypeList2 = new ArrayList<>();
        long patientOrderNum = 0;
        for(SaveModel saveModel:doorServiceTypeList){
@ -1408,7 +1408,7 @@ public class DoorStatisticAnalyzeService {
        resMap.put("doorServiceTypeList", doorServiceTypeList2);
        //服务人群分析,到达量
        List<SaveModel> voucherList = findDateQuotaLevel1(endDate, endDate, area, level, "133", ddlOrZl, level + "", null);
        List<SaveModel> voucherList = findDateQuotaLevel1(endDate, endDate, area, level, "23", ddlOrZl, level + "", null);
        List<Map<String,Object>> voucherList2 = new ArrayList<>();
        voucherList.forEach(one->voucherList2.add(statisticsUtilService.slaveKay1ToMapLong(one)));
        resMap.put("voucherList", voucherList2);
@ -1428,7 +1428,7 @@ public class DoorStatisticAnalyzeService {
    public List<Map<String,Object>> serviceOrderTrend(String area, int level, String startDate, String endDate,String interval) throws Exception {
        List<Map<String,Object>> list = new ArrayList<>();
        //新增服务工单趋势
        List<SaveModel> serviceOrderList = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, "121", SaveModel.timeLevel_ZL, interval, null);
        List<SaveModel> serviceOrderList = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, "22", SaveModel.timeLevel_ZL, interval, null);
        serviceOrderList.forEach(one->list.add(statisticsUtilService.saveModelToMap(one)));
        return list;
    }
@ -1447,7 +1447,7 @@ public class DoorStatisticAnalyzeService {
        List<Map<String,Object>> list = new ArrayList<>();
        startDate = statisticsUtilService.getStartDate(startDate,endDate);
        String ddlOrZl = statisticsUtilService.getDDLOrZL(startDate,endDate);
        List<SaveModel> doorServiceTypeList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "177", ddlOrZl, "xmijk_quota","020", null, null);
        List<SaveModel> doorServiceTypeList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "25", ddlOrZl, "xmijk_quota","020", null, null);
        for (SaveModel saveModel:doorServiceTypeList){
            if(StringUtils.isNoneBlank(saveModel.getSlaveKey1())){
                list.add(statisticsUtilService.slaveKay1ToMapLong2(saveModel));
@ -1485,9 +1485,9 @@ public class DoorStatisticAnalyzeService {
        String ddlOrZl = statisticsUtilService.getDDLOrZL(startDate,endDate);
        //服务工单数
        List<SaveModel> slaveList1 = elasticsearchUtil.findDateQuotaLevel0BySlaveKey1(startDate, endDate, area, level, "121", ddlOrZl,null, lowLevel,"5,6");
        List<SaveModel> slaveList1 = elasticsearchUtil.findDateQuotaLevel0BySlaveKey1(startDate, endDate, area, level, "22", ddlOrZl,null, lowLevel,"5,6");
        //服务费用
        List<SaveModel> slaveList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "177", ddlOrZl, slaveKey1,"020", null, lowLevel);
        List<SaveModel> slaveList = elasticsearchUtil.findDateQuotaLevel2(startDate, endDate, area, level, "25", ddlOrZl, slaveKey1,"020", null, lowLevel);
        System.out.println("服务工单数:"+slaveList1.size() + " , 服务费用数:" + slaveList.size());
        for (SaveModel saveModel:slaveList1){
            Map<String, Object> map = statisticsUtilService.getMapTurnDownResult2(saveModel, lowLevel, "num");

+ 6 - 6
svr/svr-door-serivce/src/main/resources/application.yml

@ -194,11 +194,11 @@ es:
    Statistics: hlw_quota_test
  type:
    Statistics: hlw_quota_test
  host:  http://172.26.0.112:9200
  tHost: 172.26.0.112:9300
  host:  http://172.26.0.55:9000
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: jw:jkzlehr
  user: jw
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
wlyy:
  url: http://ehr.yihu.com/wlyy/
@ -316,11 +316,11 @@ spring:
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
  fastdfs_file_url: http://365q88j171.oicp.vip:44840/fastdfs/
fast-dfs:
  tracker-server: 10.9.1.247:22122
  public-server: https://hlwyy.xmzsh.com/fastdfs/
  public-server: http://365q88j171.oicp.vip:44840/fastdfs/
neiwang:
  enable: true

+ 1 - 0
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -335,6 +335,7 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  ids: xm_xzzx_wx
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code:

+ 12 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/PrivateDictEndpoint.java

@ -134,4 +134,16 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
        return success(list, count, page, pageSize, SystemMessageDO.class);
    }
    @PostMapping(value = BaseHospitalRequestMapping.SystemMessage.commenSystemMessage)
    @ApiOperation(value = "发送系统消息通用接口")
    public Envelop commenSystemMessage(
            @ApiParam(name = "jsonParam", value = "实体参数")
            @RequestParam(value = "jsonParam", required = false) String jsonParam,
            @ApiParam(name = "jsonContent", value = "消息内容")
            @RequestParam(value = "jsonContent", required = false) String jsonContent)throws Exception{
        return success(systemMessageService.commenSystemMessage(jsonParam,jsonContent));
    }
}

+ 12 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -10,6 +10,7 @@ import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.family.service.PatientMemberDictService;
import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.restmodel.web.Envelop;
@ -65,6 +66,8 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.id}")
    private String wxId;
@ -142,8 +145,16 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
                return  mixEnvelop;
            }
        }
        }else if ("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            com.alibaba.fastjson.JSONArray jsonArray1 = tnyyEntranceService.selectPatientMappingCode(idCard);
            if (jsonArray1!=null&&jsonArray1.size()>0){
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法添加");
                return  mixEnvelop;
            }
        }
        if (StringUtils.isEmpty(client_id)) {
            mixEnvelop.setStatus(468);
            mixEnvelop.setMessage("client_id不能为空");

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -189,6 +189,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                             @RequestParam(value = "iswork", required = true)String iswork,
                                                            @ApiParam(name = "orgCode", value = "机构code")
                                                             @RequestParam(value = "orgCode", required = true,defaultValue = "350211A1002")String orgCode,
                                                            @ApiParam(name = "patientid", value = "patientid")
                                                                @RequestParam(value = "patientid", required = false)String patientid,
                                                            @ApiParam(name = "dept", value = "部门code")
                                                             @RequestParam(value = "dept", required = false)String dept,
                                                            @ApiParam(name = "diseaseKey", value = "疾病名称关键字")
@ -218,7 +220,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    ) throws Exception{
        logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
        return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,null,
        return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
                orgCode,dept,
                diseaseKey,doctorNameKey,
                jobTitleNameKey,outpatientType,

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

@ -2377,9 +2377,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询门诊记录下的患者列表")
    public Envelop selectMzRecord(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor) throws Exception {
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor,
            @ApiParam(name = "patientName", value = "patientName")
            @RequestParam(value = "patientName",defaultValue = "",required = false) String patientName) throws Exception {
        return success(tnyyEntranceService.selectMzRecord(doctor));
        return success(tnyyEntranceService.selectMzRecord(doctor,patientName));
    }
@ -2387,9 +2389,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询住院记录下的患者列表")
    public Envelop selectZyRecord(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor) throws Exception {
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor,
            @ApiParam(name = "patientName", value = "patientName")
            @RequestParam(value = "patientName",defaultValue = "",required = false) String patientName) throws Exception {
        return success(tnyyEntranceService.selectZyRecord(doctor));
        return success(tnyyEntranceService.selectZyRecord(doctor,patientName));
    }