Browse Source

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

# Conflicts:
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
wangzhinan 4 years ago
parent
commit
26322516d1
36 changed files with 1168 additions and 113 deletions
  1. 3 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java
  2. 9 0
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  3. 13 2
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java
  4. 12 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/BaseIncentiveDictService.java
  5. 179 3
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/WlyyHospitalSysDictService.java
  6. 3 3
      business/base-service/src/main/java/com/yihu/jw/hospital/httplog/service/WlyyHttpLogService.java
  7. 343 18
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  8. 67 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  9. 7 3
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  10. 54 5
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  11. 3 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  12. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperatorAES.java
  13. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/PatientHospitalRecordDO.java
  14. 9 9
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java
  15. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java
  16. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java
  17. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
  18. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanLogDO.java
  19. 2 2
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java
  20. 3 3
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java
  21. 4 4
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java
  22. 75 19
      common/common-entity/src/main/java/com/yihu/jw/entity/util/TransforSqlUtl.java
  23. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  24. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  25. 39 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictHospitalDeptEndpoint.java
  26. 66 6
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/WlyyHospitalSysDictEndpoint.java
  27. 139 13
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictHospitalDeptService.java
  28. 14 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  29. 24 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  30. 10 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  31. 4 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java
  32. 21 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  33. 2 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/PrivateDictEndpoint.java
  34. 36 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  35. 6 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  36. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java

@ -36,4 +36,7 @@ public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDo
    BaseDoctorHospitalDO findByOrgCodeAndDeptCodeAndDoctorCodeOnly(String orgCode,String deptCode,String doctorCode);
    List<BaseDoctorHospitalDO> findByOrgCodeAndDeptCodeAndDel(String orgCode,String deptCode,String del);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -435,6 +435,15 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        logger.info("修改眼科同密码后的信息:"+response);
        return response;
    }
/*    public static void main(String[] args) {
        String salt = "ssdq1";
        String pw6 = "250037";
        String pw = MD5.md5Hex(pw6 + "{" + salt + "}");
        System.out.println(pw);
    }*/
    public Boolean updateDoctorPw(String id,String pw,String orgPw){
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            BaseDoctorDO doctorDOs = baseDoctorDao.findById(id);

+ 13 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java

@ -26,6 +26,17 @@ public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyH
    List<WlyyHospitalSysDictDO> findByDictCode(String dictCode);
    List<WlyyHospitalSysDictDO> findByDictNameAndDictCode(String dictName,String dictCode);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1 order by sort asc")
    List<WlyyHospitalSysDictDO> findByDictNameOrderBySort(String dictName);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1 and hospital=?2 order by sort asc")
    List<WlyyHospitalSysDictDO> findByDictNameOrderBySort(String dictName,String orgCode);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1 and hospital=?2 order by sort desc ")
    List<WlyyHospitalSysDictDO> getMaxSort(String dictName,String hospital);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1 and hospital=?2 order by sort asc ")
    List<WlyyHospitalSysDictDO>  getMinSort(String dictName,String hospital);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1  and  hospital=?2 and sort >= ?3 order by sort asc")
    List<WlyyHospitalSysDictDO> findByDictNameSortOrderBySort(String dictName,String hospital,Integer sort);
}

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/BaseIncentiveDictService.java

@ -24,6 +24,8 @@ public class BaseIncentiveDictService extends BaseJpaService<BaseIncentiveDictDO
    private BaseIncentiveDictDao baseIncentiveDictDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /*
    * 查询激励词典
    * */
@ -40,6 +42,16 @@ public class BaseIncentiveDictService extends BaseJpaService<BaseIncentiveDictDO
            sql+=" and t.incentive_name like '%"+name+"%'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
        if (sysDictDOS!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                for (WlyyHospitalSysDictDO sysDictDO:sysDictDOS){
                    if (map.get("incentiveStatus").toString().equalsIgnoreCase(sysDictDO.getDictCode())){
                        map.put("incentiveStatusName",sysDictDO.getDictValue());
                    }
                }
            }
        }
        List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setCurrPage(page);

+ 179 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/dict/service/WlyyHospitalSysDictService.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.dict.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -7,6 +8,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.family.dao.BasePatientMemberDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
@ -39,7 +41,7 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
    @Value("${wechat.id}")
    private String wechatId;
    //查字典
    public List<Map<String,Object>> findDictsByNameCode(String modelName,String name,String code,String value,Integer page ,Integer pageSize){
    public MixEnvelop findDictsByNameCode(String modelName,String name,String code,String value,Integer page ,Integer pageSize){
        String  sql = "select t.id as \"id\"," +
                " t.dict_name  as \"dictName\","+
                " t.model_name  as \"modelName\","+
@ -68,8 +70,23 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
        }else {
            sql+=" and t.dict_code is not null and  t.dict_code != ''";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        return  list;
        if (page==null||page==null){
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setTotalCount(list==null?0:list.size());
            mixEnvelop.setDetailModelList(list);
            return  mixEnvelop;
        }else {
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
            List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
            mixEnvelop.setCurrPage(page);
            mixEnvelop.setPageSize(pageSize);
            mixEnvelop.setDetailModelList(list);
            return  mixEnvelop;
        }
    }
    //根据id修改或新增字典
    public WlyyHospitalSysDictDO updateOrCreateDict(String json) throws  Exception{
@ -80,6 +97,7 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
            if (modelNameList!=null&&modelNameList.size()>0){
                modelName= modelNameList.get(0).getModelName();
            }
        }
        wlyyHospitalSysDictDO.setModelName(modelName);
        if(StringUtils.isNoneBlank(wlyyHospitalSysDictDO.getId())){
@ -223,6 +241,164 @@ public class WlyyHospitalSysDictService extends BaseJpaService<WlyyHospitalSysDi
        }
        return envelop;
    }
    public WlyyHospitalSysDictDO downDoctor(String id) throws Exception{
        WlyyHospitalSysDictDO sysDictDO = wlyyHospitalSysDictDao.findOne(id);
        List<WlyyHospitalSysDictDO> maxSortList =  wlyyHospitalSysDictDao.getMaxSort(sysDictDO.getDictName(),sysDictDO.getHospital());
        int maxSort =0;
        if (maxSortList!=null&&maxSortList.size()>0){
            maxSort = maxSortList.get(0).getSort();
        }
        int sort = 0;
        if(null!=sysDictDO){
            sort = sysDictDO.getSort();
        }
        if (maxSort==sort){
            throw new Exception("不能下移");
        }
        String sql = "select t.id AS \"id\" from wlyy_hospital_sys_dict t where t.dict_name='"+sysDictDO.getDictName()+"' and t.hospital='"+sysDictDO.getHospital()+"' and t.sort > "+sort+" order by t.sort asc ";
        System.out.println(sql);
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,1,1);
        WlyyHospitalSysDictDO upPrevious = new WlyyHospitalSysDictDO();
        if (list.size()>0){
            String prviousId = list.get(0).get("id").toString();
            upPrevious =wlyyHospitalSysDictDao.findOne(prviousId);
        }
        //BaseBannerDO upPrevious = baseBannerDao.upBanner(sort);
        //交换sort值
        sysDictDO.setSort(upPrevious.getSort());
        upPrevious.setSort(sort);
        wlyyHospitalSysDictDao.save(sysDictDO);
        wlyyHospitalSysDictDao.save(upPrevious);
        return sysDictDO;
    }
    public WlyyHospitalSysDictDO upDoctor(String id) throws Exception{
        WlyyHospitalSysDictDO sysDictDO = wlyyHospitalSysDictDao.findOne(id);
        List<WlyyHospitalSysDictDO> minSortList =  wlyyHospitalSysDictDao.getMinSort(sysDictDO.getDictName(),sysDictDO.getHospital());
        int minSort =0;
        if (minSortList!=null&&minSortList.size()>0){
            minSort = minSortList.get(0).getSort();
        }
        int sort = 0;
        if(null!=sysDictDO){
            sort = sysDictDO.getSort();
        }
        if (minSort==sort){
            throw new Exception("不能上移");
        }
        String sql = "select t.id AS \"id\" from wlyy_hospital_sys_dict t where t.dict_name='"+sysDictDO.getDictName()+"' and t.hospital ='"+sysDictDO.getHospital()+"' and t.sort < "+sort+" order by t.sort asc ";
        System.out.println(sql);
        List<Map<String,Object>> list=hibenateUtils.createSQLQuery(sql,1,1);
        WlyyHospitalSysDictDO downPrevious = new WlyyHospitalSysDictDO();
        if (list.size()>0){
            String prviousId = list.get(0).get("id").toString();
            downPrevious =wlyyHospitalSysDictDao.findOne(prviousId);
        }
        //BaseBannerDO upPrevious = baseBannerDao.upBanner(sort);
        //交换sort值
        sysDictDO.setSort(downPrevious.getSort());
        downPrevious.setSort(sort);
        wlyyHospitalSysDictDao.save(sysDictDO);
        wlyyHospitalSysDictDao.save(downPrevious);
        return sysDictDO;
    }
    public void insertSort(String id,Integer sort){
        WlyyHospitalSysDictDO sysDictDO = wlyyHospitalSysDictDao.findOne(id);
        if (sysDictDO!=null){
            Integer  max= 0;
            List<WlyyHospitalSysDictDO> maxList = wlyyHospitalSysDictDao.getMaxSort("doctorFrontList",sysDictDO.getHospital());
            if (maxList!=null&&maxList.size()>0){
                max= maxList.get(0).getSort();
            }
            if (sort!=null&&sort<max){
                List<WlyyHospitalSysDictDO> list = wlyyHospitalSysDictDao.findByDictNameSortOrderBySort(sysDictDO.getDictName(),sysDictDO.getHospital(),sort);
                for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
                    wlyyHospitalSysDictDO.setSort(wlyyHospitalSysDictDO.getSort()+1);
                    wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO);
                }
                sysDictDO.setSort(sort);
                wlyyHospitalSysDictDao.save(sysDictDO);
            }else if (sort!=null&&sort>=max){
                sysDictDO.setSort(max+1);
                wlyyHospitalSysDictDao.save(sysDictDO);
            }
        }
    }
    public void saveDictDoctor(String json) throws Exception{
        JSONArray jsonArray = JSONArray.parseArray(json);
        if (jsonArray!=null&&jsonArray.size()>0){
            for (int i=0;i<jsonArray.size();i++){
               JSONObject jsonObject = jsonArray.getJSONObject(i);
               String orgCode = jsonObject.getString("hosptial");
               JSONArray dictArray = jsonObject.getJSONArray("dictList");
               Integer  max= 0;
               List<WlyyHospitalSysDictDO> maxList = wlyyHospitalSysDictDao.getMaxSort("doctorFrontList",orgCode);
               if (maxList!=null&&maxList.size()>0){
                   max= maxList.get(0).getSort();
               }
               if (max==null){
                   max = 0;
               }
               for (int j=0;j<dictArray.size();j++){
                   JSONObject jsonObject1 = dictArray.getJSONObject(j);
                   WlyyHospitalSysDictDO wlyyHospitalSysDictDO = jsonObject1.toJavaObject(WlyyHospitalSysDictDO.class);
                   wlyyHospitalSysDictDO.setHospital(orgCode);
                   wlyyHospitalSysDictDO.setSort(max+1);
                   max++;
                   wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO);
               }
            }
        }
    }
    public MixEnvelop findSortDoctors(String orgCode,String del,String doctorName,Integer page ,Integer pageSize){
        String sql =" select DISTINCT t.id as \"id\"," +
                " t.dict_value as \"dict_value\"," +
                " t.dict_code as \"dict_code\"," +
                " t.sort as \"sort\"," +
                " t.hospital as \"hospital\"," +
                " b.idcard as \"idcard\"," +
                " b.del as \"del\"," +
                " case when b.sex =1 then '男' when b.sex =2 then '女' else '未知' end sex," +
                " b.mobile as \"mobile\"," +
                " b.job_title_name as \"jobTitleName\"," +
                " d.org_name as \"orgName\"" +
                "  from wlyy_hospital_sys_dict t left join base_doctor b on t.dict_code = b.id " +
                " left join base_doctor_hospital d on t.dict_code = d.doctor_code where 1=1 and dict_name ='doctorFrontList' ";
        if (StringUtils.isNoneBlank(orgCode)){
            sql+=" and t.hospital = '"+orgCode+"'";
        }
        if (StringUtils.isNoneBlank(del)){
            sql+=" and b.del = '"+del+"'";
        }
        if (StringUtils.isNoneBlank(doctorName)){
            sql+=" and b.name like '%"+doctorName+"%'";
        }
        sql+=" order by t.sort asc";
        System.out.println("sql++++++"+sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
        List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
        if (sysDictDOS!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                for (WlyyHospitalSysDictDO sysDictDO:sysDictDOS){
                    if (map.get("del").toString().equalsIgnoreCase(sysDictDO.getDictCode())){
                        map.put("delName",sysDictDO.getDictValue());
                    }
                }
            }
        }
        MixEnvelop mixEnvelop= new MixEnvelop();
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setTotalCount(listCount==null?0:list.size());
        return mixEnvelop;
    }
}

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

@ -162,13 +162,13 @@ public class WlyyHttpLogService  extends BaseJpaService<WlyyHttpLogDO, WlyyHttpL
            sql+=" and t.code = '"+code+"'";
        }
        if (StringUtils.isNotBlank(faceName)){
            sql+=" and t.name like '%"+faceName+"%'";
            sql+=" and (t.name like '%"+faceName+"%' or t.code = '"+faceName+"')";
        }
        if (StringUtils.isNotBlank(patient)){
            sql+=" and a.name like '%"+patient+"%'";
            sql+=" and (a.name like '%"+patient+"%' or t.patient = '"+patient+"')";
        }
        if (StringUtils.isNotBlank(doctor)){
            sql+=" and b.name like '%"+doctor+"%'";
            sql+=" and (b.name like '%"+doctor+"%'or t.doctor = '"+doctor+"')";
        }
        if (StringUtils.isNotBlank(requestKeyWord)){
            sql+=" and t.request like '%"+requestKeyWord+"%'";

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

@ -2127,6 +2127,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                log.setStatus(rsCode);
                log.setCreateTime(new Date());
                wlyyHttpLogDao.save(log);
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                    String type="";
                    if("1".equalsIgnoreCase(outpatientDO.getType())&&"1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                        type="9";
                    }else if("2".equalsIgnoreCase(outpatientDO.getType())&&"1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                        type="16";
                    }else if("1".equalsIgnoreCase(outpatientDO.getType())&&"3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                        type="1";
                    }
                    else if("2".equalsIgnoreCase(outpatientDO.getType())&&"3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
                        type="17";
                    }
                    if (StringUtils.isNoneBlank(type)){
                        try {
                            sendWxTemplateMsg(wechatId, outpatientDO.getId(),null, type, "doctorRefund", "");
                            String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
                            sendZsMsgFlow("OL_YSTZ",outpatientDO.getId(),"",msgUrl,"医生退诊");
                        }catch (Exception e){
                            e.printStackTrace();
                        }
                    }
                }
            }
        }
        return  res;
@ -4144,7 +4168,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyOutpatientDO.setPatientCancelRemark(cancelRemark);
            wlyyOutpatientDO.setPatientCancelType(cancelType);
            wlyyOutpatientDO.setPatientCancelValue(cancelValue);
            String type="";
            if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                type="9";
            }else if("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                type="16";
            }else if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                type="1";
            }
            else if("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                type="17";
            }
            description = "居民取消";
            if (StringUtils.isNoneBlank(type)){
                sendWxTemplateMsg(wxId, outPatientId,null, type, "patientCancel", "");
            }
        } else {
            //医生拒绝接诊
            wlyyOutpatientDO.setDoctorCancelRemark(cancelRemark);
@ -4307,6 +4345,63 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            first = outpatientDO.getConsumerName() + ",您好!";
            logger.info("outPatientTimeOutRemind:outpatientId="+outpatientId+"contentMsg"+contentMsg);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        }else if("doctorPick".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您发起的图文复诊已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文复诊,医生已接诊";
            }
            if ("16".equals(type)) {
                contentMsg =  "您发起的视频复诊已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊,医生已接诊";
            }
            if ("1".equals(type)) {
                contentMsg =  "您发起的图文咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询,医生已接诊";
            }
            if ("17".equals(type)) {
                contentMsg = "您发起的视频咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询,医生已接诊";
            }
            logger.info("doctorPick诊查费支付成功推送模板消息:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("doctorRefund".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已退号";
            }
            if ("16".equals(type)) {
                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊已退号";
            }
            if ("1".equals(type)) {
                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询已退号";
            }
            if ("17".equals(type)) {
                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询已退号";
            }
            logger.info("doctorRefund:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("patientCancel".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您发起的图文复诊已被您取消。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已被您取消,您可重新发起";
            }
            if ("16".equals(type)) {
                contentMsg =  "您发起的视频复诊已被您取消。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已被您取消,您可重新发起";
            }
            if ("1".equals(type)) {
                contentMsg =  "您发起的图文咨询已被您取消。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已被您取消,您可重新发起";
            }
            if ("17".equals(type)) {
                contentMsg = "您发起的视频咨询已被您取消。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
            }
            logger.info("patientCancel诊查费支付成功推送模板消息:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){
            //超过24小时未接诊,系统取消
            if ("9".equals(type)) {
@ -4343,7 +4438,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                first =  outpatientDO.getConsumerName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                logger.info("视频咨询订单待支付微信消息模板推送开始");
            }
        } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
        } else if ("paySuccess".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您已成功发起图文复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
                first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文复诊";
            }
            if ("16".equals(type)) {
                contentMsg =  "您已成功发起视频复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
                first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频复诊";
            }
            if ("1".equals(type)) {
                contentMsg =  "您已成功发起图文咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
                first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文咨询";
            }
            if ("17".equals(type)) {
                contentMsg = "您已成功发起视频咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生";
                first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频咨询";
            }
            logger.info("paySuccess诊查费支付成功推送模板消息:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        }else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            //开具处方后向患者发送支付提醒
            first = outpatientDO.getConsumerName() + ",您好! 医生已为您开具处方,请及时支付。";
            contentMsg = "医生已为您开具处方,请及时支付。";
@ -4474,7 +4588,82 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                logger.info("眼科微信消息模板推送 就诊支付提醒开始");
                logger.info("极光消息推送 就诊支付提醒开始");
                wxTempalteJPush("outpatient_pay",outpatientDO,null,"","","","");
            } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            } else if ("paySuccess".equalsIgnoreCase(titelType)) {
                //诊费支付成功提示
                scene = "zfcgtx";
                //就诊支付
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_pay_success", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                    newConfig.setKeyword1( "图文复诊支付");
                    newConfig.setRemark(config.getRemark().replace("key2","图文复诊"));
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                    newConfig.setRemark(config.getRemark().replace("key2","视频复诊"));
                    newConfig.setKeyword1( "视频复诊支付");
                }
                if ("1".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                    newConfig.setRemark(config.getRemark().replace("key2","图文咨询"));
                    newConfig.setKeyword1("图文咨询支付");
                } else if ("17".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                    newConfig.setRemark(config.getRemark().replace("key2","视频咨询"));
                    newConfig.setKeyword1("视频咨询支付");
                }
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            } else if ("doctorPick".equalsIgnoreCase(titelType)) {
                //诊费支付成功提示
                scene = "ysjzts";
                //就诊支付
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_doctor_pick", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                    newConfig.setKeyword1( "图文复诊接诊");
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                    newConfig.setKeyword1( "视频复诊接诊");
                }
                if ("1".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                    newConfig.setKeyword1("图文咨询接诊");
                } else if ("17".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                    newConfig.setKeyword1("视频咨询接诊");
                }
                newConfig.setRemark(config.getRemark().replace("key1",outpatientDO.getDoctorName()));
                newConfig.setKeyword2(outpatientDO.getHospitalName());
                newConfig.setKeyword3(outpatientDO.getDoctorName());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
            }else if ("patientCancel".equalsIgnoreCase(titelType)) {
                scene = "hzqxfz";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_patient_cancel", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                }else if ("1".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文咨询"));
                } else if ("17".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频咨询"));
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3(outpatientDO.getFee()==null?"0":outpatientDO.getFee().toString());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送");
            }else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
                //处方开具支付提醒
                scene = "cfzfts";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_prescription_pay_notice", scene, 1);
@ -5657,27 +5846,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                e.put("workTotal",0);
            }
        });
        list.stream().sorted(Comparator.comparing((Map<String, Object> h) -> ((String) h.get("workTotal"))).reversed().thenComparing(Comparator.comparing((Map<String, Object> h) -> ((String) h.get("consultStatus")))).reversed());*/
        String hospital="";
        for (Map<String,Object> map:list){
            String doctor = map.get("id").toString();
            //号别
            String deptTyepCode = "";
            if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                deptTyepCode = "6";
                List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(doctor);
                if (null!=depts&&depts.size()>0){
                    BaseDoctorHospitalDO baseDoctorHospitalDO = depts.get(0);
                    String deptcode =  baseDoctorHospitalDO.getDeptCode();
                    String hosptitalCode = baseDoctorHospitalDO.getOrgCode();
                    List<DictHospitalDeptDO> dictHospitalDeptDO = dictHospitalDeptDao.findByOrgCodeAndCode(hosptitalCode,deptcode);
                    if(null!=dictHospitalDeptDO&&dictHospitalDeptDO.size()>0){
                        if (StringUtils.isNotBlank(dictHospitalDeptDO.get(0).getDeptTypeCode())){
                            deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode();
                        }
                    }
            List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(doctor);
            if (null!=depts&&depts.size()>0){
                BaseDoctorHospitalDO baseDoctorHospitalDO = depts.get(0);
                hospital = baseDoctorHospitalDO.getOrgCode();
                }
            }
            /*List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
            if(null!=map.get("chargeType")){
                String chargeType = map.get("chargeType").toString();
@ -5740,7 +5921,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
        }
        List<WlyyHospitalSysDictDO> doctorFrontList = wlyyHospitalSysDictDao.findByDictNameOrderBySort("doctorFrontList");
        List<WlyyHospitalSysDictDO> doctorFrontList = wlyyHospitalSysDictDao.findByDictNameOrderBySort("doctorFrontList",hospital);
        if (doctorFrontList!=null&&doctorFrontList.size()>0){
            List<Map<String,Object>> frontDoctor = new ArrayList<>();
            if (list!=null&&list.size()>0){
@ -8392,6 +8573,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            free = res.getString("@total_charge");
                        }
                        ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1","WX_PUB");
                        if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                            String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+outpatientDO.getId()+"&id="+prescriptionId;
                            sendZsMsgFlow("OL_JSTX",outpatientDO.getId(),prescriptionId,msgUrl,"结算提醒");
                        }
                    }else {
                        throw new Exception(map.get("mes").toString());
                    }
@ -11623,6 +11808,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public String wxTempalteJPush(String templateCode,WlyyOutpatientDO wlyyOutpatientDO ,ConsultTeamDo consultTeamDo,String drugName ,String mailNo,String mailStatus,String prescriptionId){
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
        String userId = "";
        String content = "";
        String title="";
@ -11817,5 +12003,144 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return jPushMessage(isDoctor,userId,content,title,jsonObject);
        }
        return "";
    }
    //中山消息中心业务接口
    public String sendZsMsgFlow(String msgType ,String outpatientId,String prescriptionId,String jumpUrl,String remark){
        try {
            String visitId ="";//挂号流水号
            String msgId ="";//挂号流水号
            String idType ="01";//证件类型 01:身份证 * 02:户口簿* 03:护照* 04:军官证* 05:驾驶证* 06:港澳居民往来内地通行证* 07:台湾居民往来内地通行证* 99:其他法定有效证件
            String idNo ="";//证件号
            String patientName ="";//患者姓名
            String msgTime ="";//消息时间yyyy-MM-dd HH:mm:sss
            String msgContent ="";//消息内容
            String jumpType ="1";
            String miniAppId ="";
            String miniAppUrl ="";
            String sender ="";//发送系统
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            if ("OL_PAY_SUCCESS".equalsIgnoreCase(msgType)){//在线问诊-已支付问诊费
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientId);
                if(businessOrderDO!=null){
                    msgId=businessOrderDO.getOrderNo().substring(5);
                    visitId = businessOrderDO.getOrderNo().substring(5);
                }
                if (wlyyOutpatientDO!=null){
                    idNo=wlyyOutpatientDO.getIdcard();
                    patientName = wlyyOutpatientDO.getPatientName();
                    msgTime = sf.format(new Date());
                    sender ="ZJXL";
                    com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                    DoctorMappingDO doctorMappingDO =doctorMappingDao.findByDoctor(wlyyOutpatientDO.getDoctor());
                    if(doctorMappingDO!=null){
                        jsonObject.put("doctorId",doctorMappingDO.getMappingCode());
                    }
                    jsonObject.put("patientName",patientName);
                    jsonObject.put("idType",idType);
                    jsonObject.put("idNo",idNo);
                    jsonObject.put("doctorName",wlyyOutpatientDO.getDoctorName());
                    jsonObject.put("deptId",wlyyOutpatientDO.getDept());
                    jsonObject.put("deptName",wlyyOutpatientDO.getDeptName());
                    jsonObject.put("visitTime",sf.format(wlyyOutpatientDO.getCreateTime()));
                    msgContent= jsonObject.toString();
                }
            }else if ("OL_WZ_CANCEL".equalsIgnoreCase(msgType)||"OL_WZCS_CANCEL".equalsIgnoreCase(msgType)){
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientId);
                if(businessOrderDO!=null){
                    msgId=businessOrderDO.getOrderNo().substring(5);
                    visitId = businessOrderDO.getOrderNo().substring(5);
                }
                if (wlyyOutpatientDO!=null){
                    idNo=wlyyOutpatientDO.getIdcard();
                    patientName = wlyyOutpatientDO.getPatientName();
                    msgTime = sf.format(new Date());
                    sender ="ZJXL";
                    com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                    jsonObject.put("patientName",patientName);
                    jsonObject.put("idType",idType);
                    jsonObject.put("idNo",idNo);
                    jsonObject.put("doctorName",wlyyOutpatientDO.getDoctorName());
                    jsonObject.put("deptName",wlyyOutpatientDO.getDeptName());
                    jsonObject.put("visitTime",sf.format(wlyyOutpatientDO.getCreateTime()));
                    msgContent= jsonObject.toString();
                }
            }else if ("OL_WZ_START".equalsIgnoreCase(msgType)||"OL_WZ_END".equalsIgnoreCase(msgType)||"OL_YSTZ".equalsIgnoreCase(msgType)||"OL_JSTX".equalsIgnoreCase(msgType)){
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                if (wlyyOutpatientDO!=null){
                    visitId = wlyyOutpatientDO.getRegisterNo();
                    if (StringUtils.isNoneBlank(prescriptionId)){
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                        if(wlyyPrescriptionDO!=null){
                            msgId=wlyyPrescriptionDO.getVoucherNo();
                        }
                    }else {
                        msgId = wlyyOutpatientDO.getRegisterNo();
                    }
                    idNo=wlyyOutpatientDO.getIdcard();
                    patientName = wlyyOutpatientDO.getPatientName();
                    msgTime = sf.format(new Date());
                    sender ="ZJXL";
                    com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                    jsonObject.put("patientName",patientName);
                    jsonObject.put("idType",idType);
                    jsonObject.put("idNo",idNo);
                    jsonObject.put("doctorName",wlyyOutpatientDO.getDoctorName());
                    jsonObject.put("deptName",wlyyOutpatientDO.getDeptName());
                    jsonObject.put("visitTime",sf.format(wlyyOutpatientDO.getCreateTime()));
                    msgContent= jsonObject.toString();
                }
            } else if ("OL_JS_SUCCESS".equalsIgnoreCase(msgType)){
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
                if (wlyyOutpatientDO!=null){
                    visitId = wlyyOutpatientDO.getRegisterNo();
                    if (StringUtils.isNoneBlank(prescriptionId)){
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                        if(wlyyPrescriptionDO!=null){
                            msgId=wlyyPrescriptionDO.getVoucherNo();
                        }
                    }else {
                        msgId = wlyyOutpatientDO.getRegisterNo();
                    }
                    idNo=wlyyOutpatientDO.getIdcard();
                    patientName = wlyyOutpatientDO.getPatientName();
                    msgTime = sf.format(new Date());
                    sender ="ZJXL";
                    com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                    jsonObject.put("patientName",patientName);
                    List<WlyyPrescriptionInfoDO> list=prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
                    String drugName="";
                    if (list!=null&&list.size()>0){
                        for (int i=0;i<list.size();i++){
                            if(i==0){
                                drugName = list.get(0).getDrugName();
                            }else {
                                drugName+=","+list.get(i).getDrugName();
                            }
                        }
                    }
                    jsonObject.put("drugsName",drugName);
                    msgContent= jsonObject.toString();
                }
            }
            return entranceService.zsMsgFlow(visitId,msgId,idType,idNo,patientName,msgTime,msgType,msgContent,jumpType,jumpUrl,"","",remark,sender);
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}

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

@ -10,13 +10,16 @@ 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.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.DoctorZsInfoDao;
@ -129,6 +132,8 @@ public class EntranceService {
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
@ -2998,7 +3003,69 @@ public class EntranceService {
        return result;
    }
*/
    //中山消息中心通用接口
    public String zsMsgFlow(String visitId,String msgId,String idType,String idNo,String patientName,
                            String msgTime,String msgType,String msgContent,String jumpType
                                ,String jumpUrl,String miniAppId,String miniAppUrl,String remark,String sender) throws Exception{
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("zsMsgFlowUrl");
        String url = "";
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictValue();
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("visitId",visitId);
        jsonObject.put("msgId",msgId);
        jsonObject.put("idType",idType);
        jsonObject.put("idNo",idNo);
        jsonObject.put("patientName",patientName);
        jsonObject.put("msgTime",msgTime);
        jsonObject.put("msgType",msgType);
        jsonObject.put("msgContent",msgContent);
        jsonObject.put("jumpType",jumpType);
        jsonObject.put("jumpUrl",jumpUrl);
        jsonObject.put("miniAppId",miniAppId);
        jsonObject.put("miniAppUrl",miniAppUrl);
        jsonObject.put("remark",remark);
        jsonObject.put("sender",sender);
        String response="";
        logger.info("消息中心入参=="+jsonObject.toString());
        logger.info("url"+url);
        try {
            response =  httpClientUtil.postBody(url,jsonObject);
            logger.info("response"+response);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
            //{"code":200,"message":"SUCCESS","data":null}
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setRequest(jsonObject.toString());
            wlyyHttpLogDO.setResponse(response);
            wlyyHttpLogDO.setName(remark+"url=="+url);
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
            if(object.getInteger("code")==200){
                String message = object.getString("message");
                return message;
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    public String zsMsgFlowEntrance(String jsonData,String url){
        logger.info("消息中心入参==="+jsonData+"=====url"+url);
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        logger.info("jsonObject==="+jsonObject.toString());
        try {
            String res =  httpClientUtil.postBody(url,jsonObject);
            logger.info("res=="+res);
            return res;
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}

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

@ -93,7 +93,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    public String orgSub ;
    public String imgUrl;
    static String imgPath =File.separator+"usr"+File.separator+"local"+File.separator+"hospital"+File.separator+"svr-internet-hospital-job"+File.separator+"img"+File.separator;
    static String imgPath =File.separator+"data1"+File.separator+"ehr"+File.separator+"svr-internet-hospital-job"+File.separator+"img"+File.separator;
    public ObjectMapper objectMapper;
@ -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+"zg.jpg"));
                jb.put("doc_cert",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("cert_doc_prac", ImgUtils.getImageStr(imgPath+"doctor"+ File.separator+info.get("name")+File.separator+"资格证.jpg"));
                jb.put("txt_introduction",StringUtils.isNoneBlank(superviseDataDict.getTxtIntroduction())?superviseDataDict.getTxtIntroduction():"");
            }catch (Exception e){
@ -1364,6 +1364,10 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        return resInfo;
    }
    public static void main(String[] args) {
        String ss="";
        System.out.println(ss.split(","));
    }
    // 12.服务信息-过程图片上传     --- 完成
    public String upNsOnlineImg(String startDate, String endDate,String keyId) throws Exception {
        getBaseSurperviseDict();

+ 54 - 5
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -870,6 +870,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
            WlyyHospitalSysDictDO changeMethod = hospitalSysDictDao.findById("consultPay");
            String changeflag="0";
            String type="";
            if(null!=changeMethod){
                changeflag = changeMethod.getDictValue();
            }
@ -884,17 +885,33 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        wlyyOutpatientDO.setPayStatus(1);
                        outpatientDao.save(wlyyOutpatientDO);
                        prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                        if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            type="1";
                        }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            type="17";
                        }
                        if(StringUtils.isNoneBlank(type)){
                            prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, type, "paySuccess", "");
                        }
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                    wlyyOutpatientDO.setPayStatus(1);
                    outpatientDao.save(wlyyOutpatientDO);
                    prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                    if (StringUtils.isNoneBlank(wlyyOutpatientDO.getDoctor())){
                        BaseDoctorDO baseDoctorDO= doctorDao.findById(wlyyOutpatientDO.getDoctor());
                        if (baseDoctorDO!=null){
                            ykyySMSService.sendSmsByTempcode("outpatient_remind",wlyyOutpatientDO,null,baseDoctorDO.getMobile());
                            prescriptionService.wxTempalteJPush("outpatient_remind",wlyyOutpatientDO,null,"","","","");
                        }
                        if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            type="9";
                        }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
                            type="16";
                        }
                        if(StringUtils.isNoneBlank(type)){
                            prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, type, "paySuccess", "");
                        }
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
@ -1359,6 +1376,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                String age="";
                String date = "";
                String title = "";
                String type="";
                if (patientDO!=null){
                    sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                    age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
@ -1366,9 +1384,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                if (outpatientDO!=null){
                    if (outpatientDO.getType().equalsIgnoreCase("1")){
                        title = "图文咨询";
                        type="1";
                        msg = name+"("+sex+" "+age+"岁)向您发起了图文咨询,点击查看";
                    }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                        title = "视频咨询";
                        type="17";
                        date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                        msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看";
                    }
@ -1385,11 +1405,27 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                }
                System.out.println("发送企业模板消息成功");
                try {
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, type, "paySuccess", "");
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
           wlyyOutpatientDO.setPayStatus(1);
           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
           try {
               if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                   String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                   prescriptionService.sendZsMsgFlow("OL_PAY_SUCCESS",wlyyOutpatientDO.getId(),"",msgUrl,"已支付问诊费");
               }
           }catch (Exception e){
               e.printStackTrace();
           }
           if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
               //发送企业模板消息给医生
               BasePatientDO patientDO = new BasePatientDO();
@ -1400,7 +1436,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
               String age="";
               String date = "";
               String title = "";
               String type="";
               if (patientDO!=null){
                   sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                   age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
@ -1408,9 +1444,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
               if (outpatientDO!=null){
                   if (outpatientDO.getType().equalsIgnoreCase("1")){
                       title = "图文复诊";
                       type="9";
                       msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                   }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                       title = "视频复诊";
                       type="16";
                       date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                       msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                   }
@ -1425,7 +1463,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                   String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                   enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",outpatientDO.getDoctor(),title,msg,url);
               }
               prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, type, "paySuccess", "");
               System.out.println("发送企业模板消息成功");
           }
@ -1436,11 +1474,16 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
               wlyyPrescriptionDO.setPayStatus(1);
               prescriptionDao.save(wlyyPrescriptionDO);
               prescriptionLogService.addPrescriptionLog(businessOrderDO.getRelationCode(),30,1,businessOrderDO.getPatient(),businessOrderDO.getPatientName(),businessOrderDO.getDescription(),new Date());
               if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                   String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/prescriptionDetail?outpatientId="+wlyyPrescriptionDO.getOutpatientId()+"&id="+wlyyPrescriptionDO.getId();
                   prescriptionService.sendZsMsgFlow("OL_JS_SUCCESS",wlyyPrescriptionDO.getOutpatientId(),wlyyPrescriptionDO.getId(),msgUrl,"结算成功");
               }
           }
        }
        businessOrderDO.setUpdateTime(new Date());
        businessOrderDO.setStatus(1);
        businessOrderDao.save(businessOrderDO);
        return businessOrderDO;
    }
@ -1504,7 +1547,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        String url="https://intel.yanketong.com/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",outpatientDO.getDoctor(),title,msg,url);
                    }
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                        prescriptionService.sendZsMsgFlow("OL_PAY_SUCCESS",wlyyOutpatientDO.getId(),"",msgUrl,"已支付问诊费");
                    }
                    System.out.println("发送企业模板消息成功");
                }
            }
@ -1547,7 +1593,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    String url="https://intel.yanketong.com/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    enterpriseService.sendTWMesByDoctor("xm_ykyy_wx",outpatientDO.getDoctor(),title,msg,url);
                }
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                    String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                    prescriptionService.sendZsMsgFlow("OL_PAY_SUCCESS",wlyyOutpatientDO.getId(),"",msgUrl,"已支付问诊费");
                }
                System.out.println("发送企业模板消息成功");
            }
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {

+ 3 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -476,7 +476,9 @@ public class ImService {
			throw new Exception("咨询记录不存在!");
		}
		try {
			prescriptionService.wxTempalteJPush("consult_remind_doctor",null,consultModel,content,"","","");
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				prescriptionService.wxTempalteJPush("consult_remind_doctor",null,consultModel,content,"","","");
			}
		}catch (Exception e){
			e.printStackTrace();
		}

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/UuidIdentityEntityWithOperatorAES.java

@ -75,7 +75,7 @@ public abstract class UuidIdentityEntityWithOperatorAES extends UuidIdentityEnti
	}
	@Column(name = "create_user_name",updatable = false)
	@Convert(converter = StringFStringEncryptConverter.class)
//	@Convert(converter = StringFStringEncryptConverter.class)
	public String getCreateUserName() {
		return createUserName;
	}
@ -104,7 +104,7 @@ public abstract class UuidIdentityEntityWithOperatorAES extends UuidIdentityEnti
	}
	@Column(name = "update_user_name")
	@Convert(converter = StringFStringEncryptConverter.class)
//	@Convert(converter = StringFStringEncryptConverter.class)
	public String getUpdateUserName() {
		return updateUserName;
	}

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/PatientHospitalRecordDO.java

@ -111,7 +111,7 @@ public class PatientHospitalRecordDO extends UuidIdentityEntityWithOperator impl
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -218,7 +218,7 @@ public class PatientHospitalRecordDO extends UuidIdentityEntityWithOperator impl
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }

+ 9 - 9
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java

@ -59,14 +59,14 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
    private String signDoctor;//签约医生
    @Column(name = "sign_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    private String signDoctorName;//签约医生
    @Column(name = "health_doctor")
    private String healthDoctor;//健康管理师
    @Column(name = "health_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    private String healthDoctorName;//健康管理师姓名
    @Column(name = "sign_year")
@ -126,7 +126,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.doctor = doctor;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -143,7 +143,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -176,7 +176,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.signDoctor = signDoctor;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getSignDoctorName() {
        return signDoctorName;
    }
@ -193,7 +193,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.healthDoctor = healthDoctor;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getHealthDoctorName() {
        return healthDoctorName;
    }
@ -234,7 +234,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.healthAssistant = healthAssistant;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getHealthAssistantName() {
        return healthAssistantName;
    }
@ -332,7 +332,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -358,7 +358,7 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/GuidanceMessageLogDO.java

@ -37,7 +37,7 @@ public class GuidanceMessageLogDO extends UuidIdentityEntityWithOperatorAES impl
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java

@ -77,7 +77,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.patient = patient;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -118,7 +118,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.attendingDoctorCode = attendingDoctorCode;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAttendingDoctorName() {
        return attendingDoctorName;
    }
@ -175,7 +175,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java

@ -117,7 +117,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
    }
    @Column(name = "name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getName() {
        return name;
    }
@ -241,7 +241,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -267,7 +267,7 @@ public class PatientRehabilitationPlanDO extends UuidIdentityEntity implements S
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanLogDO.java

@ -38,7 +38,7 @@ public class PatientRehabilitationPlanLogDO extends UuidIdentityEntity implement
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }

+ 2 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java

@ -38,7 +38,7 @@ public class RehabilitationDetailAppointmentDO extends UuidIdentityEntity implem
    }
    @Column(name = "appointment_doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getAppointmentDoctorName() {
        return appointmentDoctorName;
    }
@ -84,7 +84,7 @@ public class RehabilitationDetailAppointmentDO extends UuidIdentityEntity implem
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -154,7 +154,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -234,7 +234,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -260,7 +260,7 @@ public class RehabilitationDetailDO extends UuidIdentityEntity implements Serial
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;

+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationOperateRecordsDO.java

@ -68,7 +68,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
    }
    @Column(name = "patient_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getPatientName() {
        return patientName;
    }
@ -87,7 +87,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
    }
    @Column(name = "doctor_name")
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getDoctorName() {
        return doctorName;
    }
@ -194,7 +194,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
        this.createUser = createUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getCreateUserName() {
        return createUserName;
    }
@ -220,7 +220,7 @@ public class RehabilitationOperateRecordsDO extends UuidIdentityEntity implement
        this.updateUser = updateUser;
    }
    @Convert(converter = StringFStringEncryptConverter.class)
//    @Convert(converter = StringFStringEncryptConverter.class)
    public String getUpdateUserName() {
        return updateUserName;
    }

File diff suppressed because it is too large
+ 75 - 19
common/common-entity/src/main/java/com/yihu/jw/entity/util/TransforSqlUtl.java


+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -657,6 +657,8 @@ public class BaseRequestMapping {
        public static final String saveDeptDoctor  = "/saveDeptDoctor";
        public static final String saveDept = "/saveDept";
        public static final String findSingleDept = "/findSingleDept";
        public static final String unUsedDept = "/unUsedDept";
        public static final String findDept = "/findDept";
    }

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

@ -40,6 +40,7 @@ public class BaseHospitalRequestMapping {
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String testJpush = "/testJpush";
        public static final String findYkCardCharge = "/findYkCardCharge";
        public static final String zsMsgFlowTest = "/zsMsgFlowTest";
        public static final String updateChannelId = "/updateChannelId";
        //=====================start=======================================
@ -1467,6 +1468,11 @@ public class BaseHospitalRequestMapping {
        public static final String findModelDict = "/findModelDict";
        public static final String updateDictGroup = "/updateDictGroup";
        public static final String delDictGroup = "/delDictGroup";
        public static final String upDoctorDict = "/upDoctorDict";
        public static final String downDoctorDict = "/downDoctorDict";
        public static final String insertSortDoctorDict = "/insertSortDoctorDict";
        public static final String saveSortDoctorDict = "/saveSortDoctorDict";
        public static final String findSortDoctorDict = "/findSortDoctorDict";
        //疾病首页标签配置
        public static final String findDiseaseHomepageBanner = "/findDiseaseHomepageBanner";

+ 39 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictHospitalDeptEndpoint.java

@ -120,10 +120,12 @@ public class DictHospitalDeptEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "doctorCode", value = "医生编码")
            @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "doctorName", value = "医生姓名")
            @RequestParam(value = "doctorName", required = false) String doctorName
            @RequestParam(value = "doctorName", required = false) String doctorName,
            @ApiParam(name = "orgCode", value = "机构编码")
            @RequestParam(value = "orgCode", required = false) String orgCode
            ) throws Exception {
        return success(dictHospitalDeptService.findDoctors(deptCode,deptName,doctorCode,doctorName));
        return success(dictHospitalDeptService.findDoctors(deptCode,deptName,doctorCode,doctorName,orgCode));
    }
    @GetMapping(value = BaseRequestMapping.DictHospitalDept.saveDeptDoctor)
@ -168,5 +170,40 @@ public class DictHospitalDeptEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = BaseRequestMapping.DictHospitalDept.findDept)
    @ApiOperation(value = "获取部门")
    public Envelop findDept(
            @ApiParam(name = "orgCode", value = "orgCode")
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "consultDeptFlag", value = "consultDeptFlag")
            @RequestParam(value = "consultDeptFlag", required = false) String consultDeptFlag,
            @ApiParam(name = "fatherDeptCode", value = "fatherDeptCode")
            @RequestParam(value = "fatherDeptCode", required = false) String fatherDeptCode,
            @ApiParam(name = "fatherDeptName", value = "fatherDeptName")
            @RequestParam(value = "fatherDeptName", required = false) String fatherDeptName,
            @ApiParam(name = "name", value = "name")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "deptCode", value = "deptCode")
            @RequestParam(value = "deptCode", required = false) String deptCode,
            @ApiParam(name = "page", value = "")
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "size", value = "")
            @RequestParam(value = "size", required = false) Integer size
    ) throws Exception {
        return    dictHospitalDeptService.queryDept(orgCode,consultDeptFlag,fatherDeptCode,name,deptCode,fatherDeptName,page,size);
    }
    @GetMapping(value = BaseRequestMapping.DictHospitalDept.unUsedDept)
    @ApiOperation(value = "生效失效科室")
    public Envelop unUsedDept(
            @ApiParam(name = "id", value = "部门id")
            @RequestParam(value = "id", required = false) Integer id,
            @ApiParam(name = "consultDeptFlag", value = "")
            @RequestParam(value = "consultDeptFlag", required = false) String  consultDeptFlag
    ) throws Exception {
        return success(dictHospitalDeptService.unUsed(id,consultDeptFlag));
    }
}

+ 66 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/WlyyHospitalSysDictEndpoint.java

@ -13,10 +13,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.*;
@RestController
@RequestMapping(value = BaseRequestMapping.DictDisease.PREFIX)
@ -27,7 +24,7 @@ public class WlyyHospitalSysDictEndpoint extends EnvelopRestEndpoint {
    private WlyyHospitalSysDictService wlyyHospitalSysDictService;
    @ApiOperation("查询字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findDict)
    public ListEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
    public MixEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
                                @RequestParam(value = "name", required = false)String name,
                                @ApiParam(name = "modelName", value = "modelName", required = false)
                                @RequestParam(value = "modelName", required = false)String modelName,
@ -40,7 +37,7 @@ public class WlyyHospitalSysDictEndpoint extends EnvelopRestEndpoint {
                                @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                @RequestParam(value = "pageSize", required = false)Integer pageSize){
        return success(wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value,page,pageSize));
        return wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value,page,pageSize);
    }
    @ApiOperation("删除字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.delDict)
@ -99,5 +96,68 @@ public class WlyyHospitalSysDictEndpoint extends EnvelopRestEndpoint {
        return wlyyHospitalSysDictService.deleteByModelName(preDictName);
    }
    @ApiOperation("上移推荐医生")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.upDoctorDict)
    public Envelop upDoctorDict(@ApiParam(name = "id", value = "", required = true)
                                @RequestParam(value = "id", required = true)String id){
        try {
           return success(wlyyHospitalSysDictService.upDoctor(id));
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
    @ApiOperation("下移推荐医生")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.downDoctorDict)
    public Envelop downDoctorDict(@ApiParam(name = "id", value = "", required = true)
                                @RequestParam(value = "id", required = true)String id){
        try {
            return success(wlyyHospitalSysDictService.downDoctor(id));
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
    @ApiOperation("插入推荐医生顺序")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.insertSortDoctorDict)
    public Envelop insertSortDoctorDict(@ApiParam(name = "id", value = "", required = true)
                                @RequestParam(value = "id", required = true)String id,
                                        @ApiParam(name = "sort", value = "", required = true)
                                        @RequestParam(value = "sort", required = true)Integer sort) throws Exception{
        wlyyHospitalSysDictService.insertSort(id,sort);
        return success("操作成功");
    }
    @ApiOperation("保存推荐医生词典")
    @PostMapping(value= BaseHospitalRequestMapping.PatientNoLogin.saveSortDoctorDict)
    public Envelop saveSortDoctorDict(@ApiParam(name = "json", value = "", required = true)
                                        @RequestParam(value = "json", required = true)String json
                                        ) {
        try {
            wlyyHospitalSysDictService.saveDictDoctor(json);
            return success("操作成功");
        } catch (Exception e) {
            return failed(e.getMessage());
        }
    }
    @ApiOperation("查询推荐医生词典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findSortDoctorDict)
    public MixEnvelop findSortDoctorDict(@ApiParam(name = "orgCode", value = "", required = false)
                                      @RequestParam(value = "orgCode", required = false)String orgCode,
                                      @ApiParam(name = "del", value = "", required = false)
                                      @RequestParam(value = "del", required = false)String del,
                                      @ApiParam(name = "doctorName", value = "", required = false)
                                          @RequestParam(value = "doctorName", required = false)String doctorName,
                                      @ApiParam(name = "page", value = "", required = false)
                                          @RequestParam(value = "page", required = false)Integer page,
                                      @ApiParam(name = "pageSize", value = "", required = false)
                                          @RequestParam(value = "pageSize", required = false)Integer pageSize) {
        return  wlyyHospitalSysDictService.findSortDoctors(orgCode,del,doctorName,page,pageSize);
    }
}

+ 139 - 13
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictHospitalDeptService.java

@ -9,8 +9,10 @@ import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
@ -21,7 +23,9 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import javax.sound.sampled.Mixer;
import java.io.IOException;
import java.lang.management.MemoryMXBean;
import java.util.*;
/**
@ -125,7 +129,7 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
        Map<String ,Object> returnMap = new HashMap<>();
        DictHospitalDeptDO dictHospitalDeptDO = dictHospitalDeptDao.findOne(id);
        if (StringUtils.isNoneBlank(dictHospitalDeptDO.getFatherDeptCode())){
            DictHospitalDeptDO fatherDeptDO =  dictHospitalDeptDao.findByCode(dictHospitalDeptDO.getFatherDeptCode());
            DictHospitalDeptDO fatherDeptDO =  dictHospitalDeptDao.findOne(Integer.parseInt(dictHospitalDeptDO.getFatherDeptCode()));
            if(fatherDeptDO!=null){
                dictHospitalDeptDO.setFatherDeptName(fatherDeptDO.getName());
            }
@ -135,12 +139,15 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                    " b.sex as \"sex\"," +
                    " b.idcard as \"idcard\"," +
                    " b.mobile as \"mobile\"," +
                    " d.dept_code as \"deptCode\"," +
                    " d.dept_name as \"deptName\"," +
                    " b.job_title_code as \"jobTitleCode\"," +
                    " b.job_title_name as \"jobTitleName\"" +
                    " from base_doctor_hospital d " +
                    " left join dict_hospital_dept p on d.dept_code = p.code" +
                    " left join base_doctor b on d.doctor_code = b.id" +
                    " where  d.dept_code = '"+dictHospitalDeptDO.getCode()+"'";
                    " where d.del='1' and d.dept_code = '"+dictHospitalDeptDO.getCode()+"'";
            System.out.println(sql);
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
            List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
            for (Map<String,Object> map:list){
@ -167,18 +174,28 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
        DictHospitalDeptDO dictHospitalDeptDO = objectMapper.readValue(jsonData,DictHospitalDeptDO.class);
        if (dictHospitalDeptDO.getId()!=null){
            dictHospitalDeptDO.setDeptTypeCode("6");
            if (StringUtils.isNoneBlank(dictHospitalDeptDO.getFatherDeptCode())){
                DictHospitalDeptDO father  =dictHospitalDeptDao.findOne(Integer.parseInt(dictHospitalDeptDO.getFatherDeptCode()));
                if (father!=null){
                    dictHospitalDeptDO.setFatherDeptName(father.getName());
                }
            }
            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(dictHospitalDeptDO.getOrgCode());
            dictHospitalDeptDO.setOrgCode(dictHospitalDeptDO.getOrgCode());
            if (baseOrgDO!=null){
                dictHospitalDeptDO.setOrgName(baseOrgDO.getName());
            }
            dictHospitalDeptDao.save(dictHospitalDeptDO);
            if (StringUtils.isNoneBlank(doctorIds)){
                if (doctorIds.contains(",")){
                    String[] doctorId = doctorIds.split(",");
                    List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByOrgCodeAndDeptCode(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode());
                    List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDel(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode(),"1");
                    for (int i=0;i<doctorId.length;i++){
                        List<BaseDoctorHospitalDO> doctors=  baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode(),doctorId[i]);
                        if (doctors!=null&&doctors.size()>0){
                        }else {
                            BaseDoctorHospitalDO baseDoctorHospitalDO = new BaseDoctorHospitalDO();
                            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(dictHospitalDeptDO.getOrgCode());
                            baseDoctorHospitalDO.setOrgCode(dictHospitalDeptDO.getOrgCode());
                            if (baseOrgDO!=null){
                                baseDoctorHospitalDO.setOrgName(baseOrgDO.getName());
@ -204,6 +221,37 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                           baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                       }
                    }
                }else {
                    List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDel(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode(),"1");
                    List<BaseDoctorHospitalDO> doctors=  baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode(),doctorIds);
                    if (doctors!=null&&doctors.size()>0){
                    }else {
                        BaseDoctorHospitalDO baseDoctorHospitalDO = new BaseDoctorHospitalDO();
                        baseDoctorHospitalDO.setOrgCode(dictHospitalDeptDO.getOrgCode());
                        if (baseOrgDO!=null){
                            baseDoctorHospitalDO.setOrgName(baseOrgDO.getName());
                        }
                        baseDoctorHospitalDO.setDoctorCode(doctorIds);
                        baseDoctorHospitalDO.setDeptName(dictHospitalDeptDO.getName());
                        baseDoctorHospitalDO.setDeptCode(dictHospitalDeptDO.getCode());
                        baseDoctorHospitalDO.setDel("1");
                        baseDoctorHospitalDO.setCreateTime(new Date());
                        baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                    }
                    if (depts!=null&&depts.size()>0){
                        for (int j=0;j<depts.size();j++){
                            if (depts.get(j).getDoctorCode().equalsIgnoreCase(doctorIds)){
                                depts.remove(j);
                            }
                        }
                    }
                    if (depts!=null&&depts.size()>0){
                        for (BaseDoctorHospitalDO baseDoctorHospitalDO:depts){
                            baseDoctorHospitalDO.setDel("0");
                            baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                        }
                    }
                }
            }else {
                List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByOrgCodeAndDeptCode(dictHospitalDeptDO.getOrgCode(),dictHospitalDeptDO.getCode());
@ -215,9 +263,20 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                }
            }
        }else {
            if (StringUtils.isNoneBlank(dictHospitalDeptDO.getFatherDeptCode())){
                DictHospitalDeptDO father  = dictHospitalDeptDao.findOne(Integer.parseInt(dictHospitalDeptDO.getFatherDeptCode()));
                if (father!=null){
                    dictHospitalDeptDO.setFatherDeptName(father.getName());
                }
            }
            BaseOrgDO baseOrgDO = baseOrgDao.findByCode(dictHospitalDeptDO.getOrgCode());
            dictHospitalDeptDO.setOrgCode(dictHospitalDeptDO.getOrgCode());
            if (baseOrgDO!=null){
                dictHospitalDeptDO.setOrgName(baseOrgDO.getName());
            }
            dictHospitalDeptDO.setCreateTime(new Date());
            dictHospitalDeptDO.setDeptTypeCode("6");
            dictHospitalDeptDao.save(dictHospitalDeptDO);
            dictHospitalDeptDO = dictHospitalDeptDao.save(dictHospitalDeptDO);
            if (StringUtils.isNotBlank(doctorIds)){
                if (doctorIds.contains(",")){
                    String[] doctorId = doctorIds.split(",");
@ -303,13 +362,16 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
       }
       return returnMap;
   }
   public List<Map<String,Object>> findDoctors(String deptCode,String deptName,String doctorCode,String doctorName){
        String sql = "select t.code as \"orgCode\",t.name as \"orgName\" from base_org t where 1=1 ";
   public List<Map<String,Object>> findDoctors(String deptCode,String deptName,String doctorCode,String doctorName,String orgid){
        String sql = "select t.code as \"code\",t.name as \"name\" from base_org t where 1=1 ";
        if (StringUtils.isNoneBlank(orgid)){
            sql+=" and t.code = '"+orgid+"'";
        }
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if (list!=null&&list.size()>0){
            for (Map<String,Object> orgMap:list){
                String orgCode = orgMap.get("orgCode").toString();
                String doctorDeptSql = "select t.code as \"deptCode\",t.name as \"deptName\" from dict_hospital_dept t where t.org_code ='"+orgCode+"'";
                String orgCode = orgMap.get("code").toString();
                String doctorDeptSql = "select t.code as \"code\",t.name as \"name\" from dict_hospital_dept t where t.org_code ='"+orgCode+"'";
                if (StringUtils.isNoneBlank(deptCode)){
                    doctorDeptSql+=" and t.code !='"+deptCode+"'";
                }
@ -319,8 +381,8 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                List<Map<String,Object>> listdept = hibenateUtils.createSQLQuery(doctorDeptSql);
                if (listdept!=null&&listdept.size()>0){
                    for (Map<String,Object> deptMap:listdept){
                        String dept = deptMap.get("deptCode").toString();
                        String doctorSql = "select b.name as \"doctorName\",b.id as \"doctorId\" from base_doctor_hospital t left join base_doctor b on t.doctor_code = b.id" +
                        String dept = deptMap.get("code").toString();
                        String doctorSql = "select b.name as \"name\",b.id as \"code\",t.dept_name as \"deptName\",b.mobile as \"mobile\",b.job_title_name as \"jobTitleName\" from base_doctor_hospital t left join base_doctor b on t.doctor_code = b.id" +
                                " left join base_doctor_mapping m on t.doctor_code = m.doctor  " +
                                " where t.dept_code = '"+dept+"' and t.org_code = '"+orgCode+"'";
                        if (StringUtils.isNoneBlank(doctorCode)){
@ -330,12 +392,76 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                            doctorSql+=" and b.name like '%"+doctorName+"%'";
                        }
                        List<Map<String,Object>> listDoctor = hibenateUtils.createSQLQuery(doctorSql);
                        deptMap.put("listDoctor",listDoctor);
                        deptMap.put("childList",listDoctor);
                    }
                    orgMap.put("listDept",listdept);
                    orgMap.put("childList",listdept);
                }
            }
        }
        return list;
   }
   public MixEnvelop queryDept(String orgCode,String consultDeptFlag,String fatherDeptCode,String deptName,String deptCode,String fatherDeptName,Integer page ,Integer size){
        String sql = "select t.id as \"id\"," +
                " t.org_code as \"orgCode\"," +
                " t.code as \"code\"," +
                " t.name as \"name\"," +
                " t.create_time as \"createTime\"," +
                " t.dept_type_code as \"deptTypeCode\"," +
                " t.father_dept_code as \"fatherDeptCode\"," +
                " t.father_dept_name as \"fatherDeptName\"," +
                " t.dept_type as \"deptType\"," +
                " t.dept_position as \"deptPosition\"," +
                " t.consult_dept_flag as \"consultDeptFlag\"," +
                " t.org_name as \"orgName\"," +
                " t.dept_logo as \"deptLogo\"," +
                " t.dept_img as \"deptImg\"," +
                " t.dept_description as \"deptDescription\","+
                " t.usual_name as \"usualName\" " +
                " from dict_hospital_dept t where 1=1";
        if (StringUtils.isNoneBlank(orgCode)){
            sql+=" and t.org_code ='"+orgCode+"'";
        }
       if (StringUtils.isNoneBlank(consultDeptFlag)){
           sql+=" and t.consult_dept_flag ='"+consultDeptFlag+"'";
       }
       if (StringUtils.isNoneBlank(deptCode)){
           sql+=" and t.code ='"+deptCode+"'";
       }
       if (StringUtils.isNoneBlank(fatherDeptCode)){
           sql+=" and t.father_dept_code ='"+fatherDeptCode+"'";
       }
       if (StringUtils.isNoneBlank(deptName)){
           sql+=" and t.name like '%"+deptName+"%'";
       }
       if (StringUtils.isNoneBlank(fatherDeptName)){
           sql+=" and t.father_dept_name like '%"+fatherDeptName+"%'";
       }
       List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,size);
       List<Map<String,Object>> listCount = hibenateUtils.createSQLQuery(sql);
       if (sysDictDOS!=null&&list.size()>0){
           for (Map<String,Object> map:list){
               for (WlyyHospitalSysDictDO sysDictDO:sysDictDOS){
                   if (map.get("consultDeptFlag").toString().equalsIgnoreCase(sysDictDO.getDictCode())){
                       map.put("consultDeptFlagName",sysDictDO.getDictValue());
                   }
               }
           }
       }
       MixEnvelop mixEnvelop = new MixEnvelop();
       mixEnvelop.setDetailModelList(list);
       mixEnvelop.setCurrPage(page);
       mixEnvelop.setPageSize(size);
       mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
       return mixEnvelop;
   }
    public DictHospitalDeptDO unUsed(Integer id,String consultFlag){
        DictHospitalDeptDO dictHospitalDeptDO= dictHospitalDeptDao.findOne(id);
        if (dictHospitalDeptDO!=null){
            dictHospitalDeptDO.setConsultDeptFlag(consultFlag);
            dictHospitalDeptDao.save(dictHospitalDeptDO);
        }
        return dictHospitalDeptDO;
    }
}

+ 14 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -25,9 +25,11 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorIncentiveDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.hospital.dict.BaseIncentiveDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
@ -127,6 +129,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
@ -1153,7 +1157,16 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        sql+=" group by  b.id,b.incentive_img,b.incentive_name" +
                "b.incentive_status ,b.is_del, b.incentive_code,b.create_time";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        List<WlyyHospitalSysDictDO> sysDictDOS=wlyyHospitalSysDictDao.findByDictName("drugStoreStatus");
        if (sysDictDOS!=null&&list.size()>0){
            for (Map<String,Object> map:list){
                for (WlyyHospitalSysDictDO sysDictDO:sysDictDOS){
                    if (map.get("incentiveStatus").toString().equalsIgnoreCase(sysDictDO.getDictCode())){
                        map.put("incentiveStatusName",sysDictDO.getDictValue());
                    }
                }
            }
        }
        return list;
    }
}

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

@ -240,7 +240,30 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                    }
            }
        }
    
        //機構管理員信息獲取
        String sql = "SELECT " +
                " g.code AS orgCode, " +
                " g.province_code AS provinceCode, " +
                " g.province_name AS privinceName, " +
                " g.city_code AS cityCode, " +
                " g.city_name AS cityName, " +
                " g.town_code AS townCode, " +
                " g.town_name AS townName, " +
                " g.street_code AS streetCode, " +
                " g.street_name AS streetName, " +
                " g.name, " +
                " address " +
                " FROM " +
                " base_org g " +
                " JOIN base_org_user u ON g.`code` = u.org_code " +
                " WHERE  " +
                " u.user_id = '" + id + "'";
        List<Map<String, Object>> org = jdbcTemplate.queryForList(sql);
        if (org != null && org.size() > 0) {
            userinfo.put("org", org);
        } else {
            userinfo.put("org", null);
        }
    
        //密码过期
        userinfo.put("authPw",findDoctorPwlimitDate(id));

+ 10 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -696,4 +696,14 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(entranceService.sysDoctorInfo(idcard,demoFlag));
    }
    //==================预约挂号end================
    @GetMapping(value = "/zsMsgFlow")
    @ApiOperation(value = "消息平台发送消息")
    public Envelop zsMsgFlow(@ApiParam(name = "jsonString", value = "入参")
                               @RequestParam(value = "jsonString", required = false) String jsonString,
                                 @ApiParam(name = "msgUrl", value = "消息接口地址")
                                 @RequestParam(value = "msgUrl", required = false) String msgUrl) throws Exception {
        return success(entranceService.zsMsgFlowEntrance(jsonString,msgUrl));
    }
}

+ 4 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -203,6 +203,10 @@ public class TimeoutOverDueService {
                                if(StringUtils.isNoneBlank(consultCode)) {
                                    imService.cancelRevisit(consultCode, "admin", 2);
                                }
                                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                                    String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId();
                                    prescriptionService.sendZsMsgFlow("OL_WZCS_CANCEL",wlyyOutpatientDO.getId(),"",msgUrl,"24 时未接诊,问诊超时取消");
                                }
                                }catch(Exception e)  {
                                    e.printStackTrace();
                                    logger.info("自动结束咨询报错 consultCode: "+consultCode);

+ 21 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -225,8 +225,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			if (outpatientDO.getStatus().equalsIgnoreCase("-1")){
				return failed("患者已取消!");
			}
			
			
//			int res = 0;
		
@ -285,7 +284,15 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
				}else {
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
				}
				try {
					prescriptionService.sendWxTemplateMsg(wxId, outpatientCode,null, consult.getType().toString(), "doctorPick", "");
					if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
						String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientCode;
						prescriptionService.sendZsMsgFlow("OL_WZ_START",outpatientCode,"",msgUrl,"医生已接诊");
					}
				}catch (Exception e){
					e.printStackTrace();
				}
			}
			return success("操作成功",result);
	}
@ -539,11 +546,22 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
				}
				outpatientDO.setEndTime(new Date());
				outpatientDao.save(outpatientDO);
				try {
				    ConsultDo consultDo = consultDao.findByRelationCode(outpatientDO.getId());
                    String msgUrl="";
                    if (consultDo!=null){
                        msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/fuwupingjia?consultCode="+consultDo.getId();
                    }
					prescriptionService.sendZsMsgFlow("OL_WZ_END",outpatientDO.getId(),"",msgUrl,"医生问诊结束");
				}catch (Exception e){
					e.printStackTrace();
				}
			}
		}
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}
		return success(jsonStr);
	}
	

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

@ -75,7 +75,7 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
    }
    @ApiOperation("查询字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findDict)
    public ListEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
    public MixEnvelop findDict(@ApiParam(name = "name", value = "name", required = false)
                                     @RequestParam(value = "name", required = false)String name,
                                @ApiParam(name = "modelName", value = "modelName", required = false)
                                @RequestParam(value = "modelName", required = false)String modelName,
@ -88,7 +88,7 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
                                @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                    @RequestParam(value = "pageSize", required = false)Integer pageSize){
        return success(wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value1,page,pageSize));
        return wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value1,page,pageSize);
    }
    @ApiOperation("删除字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.delDict)

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

@ -1775,4 +1775,40 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.zsMsgFlowTest)
    @ApiOperation(value = "消息中心发送消息测试接口", notes = "")
    public Envelop zsMsgFlowTest(@ApiParam(name = "visitId", value = "")
                                       @RequestParam(value = "visitId", required = false)String visitId,
                                       @ApiParam(name = "msgId", value = "")
                                       @RequestParam(value = "msgId", required = false)String msgId,
                                       @ApiParam(name = "idType", value = "")
                                       @RequestParam(value = "idType", required = false)String idType,
                                       @ApiParam(name = "idNo", value = "")
                                       @RequestParam(value = "idNo", required = false)String idNo,
                                       @ApiParam(name = "patientName", value = "")
                                       @RequestParam(value = "patientName", required = false)String patientName,
                                       @ApiParam(name = "msgTime", value = "")
                                       @RequestParam(value = "msgTime", required = false)String msgTime,
                                       @ApiParam(name = "msgType", value = "")
                                       @RequestParam(value = "msgType", required = false)String msgType,
                                       @ApiParam(name = "msgContent", value = "")
                                       @RequestParam(value = "msgContent", required = false)String msgContent,
                                       @ApiParam(name = "jumpType", value = "")
                                       @RequestParam(value = "jumpType", required = false)String jumpType,
                                       @ApiParam(name = "jumpUrl", value = "")
                                       @RequestParam(value = "jumpUrl", required = false)String jumpUrl,
                                    @ApiParam(name = "miniAppId", value = "")
                                        @RequestParam(value = "miniAppId", required = false)String miniAppId,
                                    @ApiParam(name = "miniAppUrl", value = "")
                                        @RequestParam(value = "miniAppUrl", required = false)String miniAppUrl,
                                    @ApiParam(name = "remark", value = "")
                                        @RequestParam(value = "remark", required = false)String remark,
                                    @ApiParam(name = "sender", value = "")
                                        @RequestParam(value = "sender", required = false)String sender)  throws Exception{
        return success(entranceService.zsMsgFlow(visitId,msgId,idType,idNo,patientName,msgTime,msgType,msgContent,jumpType,jumpUrl,miniAppId,miniAppUrl,remark,sender));
    }
}

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

@ -792,8 +792,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                    imService.cancelRevisit(consultCode, consultDo.getPatient(), 1);
                }
            }
            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outPatientId;
                prescriptionService.sendZsMsgFlow("OL_WZ_CANCEL",outPatientId,"",msgUrl,"取消问诊(用户)");
            }
        }catch (Exception e){
            System.out.println("居民取消复诊失败");
            e.printStackTrace();
        }
        return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1,wxId));

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -563,7 +563,7 @@ public class SpecialistService{
    public List<AdminTeamMemberVO> findTeamMember(Long teamId){
        String menberSql = "SELECT " +
                " m.doctor_code AS doctorCode " +
                " m.doctor_code AS doctorCode ," +
                        " d.`name` AS doctorName " +
                " FROM " +
                " "+basedb+".wlyy_admin_team_member m " +