Explorar el Código

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

humingfen hace 4 años
padre
commit
9e5c35302d

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

@ -21,5 +21,13 @@ public interface SystemMessageDao extends PagingAndSortingRepository<SystemMessa
    @Query("from SystemMessageDO p where p.id = ?1")
    SystemMessageDO queryById(String id);
    @Modifying
    @Query("delete from SystemMessageDO a   where a.receiver = ?1 and a.relationCode = ?2 and a.type ='407'")
    int orderMessageDel(String doctor, String orderId);
    List<SystemMessageDO> queryByRelationCodeAndTypeIn(String relationCode,String[] type);
    //获取资质申请审核有效的未结束已发送的消息
    @Query("select a from SystemMessageDO a where a.type in ('401','408') and a.del='1' and a.over='1' and relationCode = ?1  ")
    List<SystemMessageDO> findMessageByRelationCode(String relationCode);
}

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

@ -10170,4 +10170,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return outpatient;
    }
    public String savePrescriptionToDoorService(String orderId,String prescriptionId){
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("doorServiceUrl");
        String url = "";
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("url:"+url);
        String res = "";
        Map map = new HashMap();
        map.put("orderId",orderId);
        map.put("prescriptionCode",prescriptionId);
        logger.info("入参:"+map);
        try {
            res = httpClientUtil.httpPost(url,map);
            logger.info("调用保存上门开方信息接口返回结果=>"+res);
            if (StringUtils.isNoneBlank(res)){
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                if ("200".equalsIgnoreCase(jsonObject.getString("status"))){
                    return jsonObject.getString("msg");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "接口调用失败";
    }
}

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

@ -659,6 +659,176 @@ public class TnyyEntranceService {
        return wlyyPrescriptionVOList;
    }
    /**
     * 获取检查检验字典
     * @throws Exception
     */
    public JSONArray findVpacsBw(String pyKey) throws Exception{
        String sql = " SELECT bw.DMMC,bw.jcbw,bw.fyxh,bw.FYMC,bw.FYDW,bw.fysl,bw.FYDJ,bw.jclx,bw.JCMC,bw.SRDM FROM V_pacs_BW bw WHERE 1=1   ";
        if (StringUtils.isNoneBlank(pyKey)){
            sql+= " and  lower(bw.SRDM) like '%"+pyKey+"%' ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array = new JSONArray();
        if(status!=null&&status == 200){
            JSONArray jsonArray = rs.getJSONArray("detailModelList");
            for (int i=0;i<jsonArray.size();i++){
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                JSONObject object = new JSONObject();
                object.put("name",jsonObject.getString("DMMC"));
                object.put("charge_unit",jsonObject.getString("FYDW"));
                object.put("charge_amount",jsonObject.getString("FYDJ"));
                object.put("py_code",jsonObject.getString("SRDM"));
                object.put("code",jsonObject.getString("jcbw"));
                object.put("exec_unit",jsonObject.getString("fyxh"));
                object.put("fysl",jsonObject.getString("fysl"));
                object.put("FYMC",jsonObject.getString("FYMC"));
                object.put("jclx",jsonObject.getString("jclx"));
                object.put("JCMC",jsonObject.getString("JCMC"));
                array.add(object);
            }
        }
        return array;
    }
    /**
     * 查询某个门诊患者记录
     * @param doctor
     * @return
     * @throws Exception
     */
    public JSONArray selectMzRecord(String doctor) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String condition = "";
        if (doctorMappingDO!=null){
            condition = " and mz.YSDM ='"+doctorMappingDO.getMappingCode()+"' ";
        }
        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT mz.BRBH FROM YS_MZ_JZLS mz where 1=1 "+condition+" GROUP BY mz.BRBH ) and br.SFZH is not null and br.BRXM !='作废' ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("selectMzRecord:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array = new JSONArray();
        if(status!=null&&status == 200){
            array = rs.getJSONArray("detailModelList");
            logger.info("selectMzRecord size:"+array.size());
        }
        return array;
    }
    /**
     * 查询某个医生住院患者记录
     * @param doctor
     * @return
     * @throws Exception
     */
    public JSONArray selectZyRecord(String doctor) throws Exception {
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String condition = "";
        if (doctorMappingDO!=null){
            condition = " and (brry.zyys= '"+doctorMappingDO.getMappingCode()+"' or brry.zzys= '"+doctorMappingDO.getMappingCode()+"' or brry.szys= '"+doctorMappingDO.getMappingCode()+"') ";
        }else {
            return null;
        }
        String sql = "SELECT br.BRID,br.BRXM,br.BRXB,CONVERT(varchar(100), br.CSNY, 120) as birthDay ,br.MZHM,br.SFZH from MS_BRDA br WHERE br.BRID IN(SELECT cast(brry.BAHM as numeric(18,0)) FROM ZY_BRRY brry where 1=1 and isnumeric(brry.BAHM) = 1 "+condition+" GROUP BY brry.BAHM) and br.BRXM !='作废' and br.SFZH is not null ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("selectZyRecord:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        JSONArray array = new JSONArray();
        if(status!=null&&status == 200){
            array = rs.getJSONArray("detailModelList");
            logger.info("selectZyRecord size:"+array.size());
        }
        return array;
    }
    /**
     * 健康档案中门诊记录
     * @throws Exception
     */
    public JSONArray findJKTA_V_ZKSG_HZCX_HIS(String brid) throws Exception{
        String sql = "SELECT h.JZXH,h.GHXH,h.BRBH,h.KSDM,h.YSDM,h.ZYZD,h.KSSJ,h.JSSJ,h.JZZT,h.FZRQ,h.GHFZ,ks.KSMC,yg.YGXM  from YS_MZ_JZLS h,GY_KSDM ks,GY_YGDM yg WHERE yg.YGDM=h.YSDM and ks.KSDM=h.KSDM and  h.BRBH = "+brid+" ";
        sql += " order by h.KSSJ desc";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("findJKTA_V_ZKSG_HZCX_HIS:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    /**
     * 获取健康档案住院记录
     * @param brid
     * @return
     * @throws Exception
     */
    public JSONArray findJKTA_ZY_RECORD(String brid) throws Exception{
        String sql = "SELECT\n" +
                "\tbrry.ZYH,\n" +
                "\tbrry.ZYHM,\n" +
                "\tbrry.ZYDM,\n" +
                "\tbrry.ZYYS,\n" +
                "\tbrry.ZZYS,\n" +
                "\tbrry.SZYS,\n" +
                "\tbrry.zyysxm ,\n" +
                "\tbrry.zzysxm ,\n" +
                "\tbrry.szysxm ,\n" +
                "\tbrry.KSRQ,\n" +
                "\tbrry.JSRQ,\n" +
                "\tbrry.JGDM,\n" +
                "\tbrry.KSMC,\n" +
                "\tbrry.BAHM,\n" +
                "\tbrry.BRXM\n" +
                "FROM\n" +
                "\tV_ZY_BRRY brry\n" +
                "where\n" +
                "  brry.BAHM ='"+brid+"' ";
        sql += " order by h.KSSJ desc";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("findJKTA_ZY_RECORD:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    public List<Map<String,Object>> queryBySql(String sql){
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);

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

@ -498,6 +498,14 @@ public class BaseHospitalRequestMapping {
        //作废处方
        public static final String disablePrescription="/disablePrescription";
        public static final String selectMzRecord = "/selectMzRecord";
        public static final String selectZyRecord = "/selectZyRecord";
        public static final String findJKTA_V_ZKSG_HZCX_HIS = "/findJKTA_V_ZKSG_HZCX_HIS";
        public static final String findJKTA_ZY_RECORD = "/findJKTA_ZY_RECORD";
        /*
        关注医生信息
         */
@ -524,6 +532,7 @@ public class BaseHospitalRequestMapping {
        public static final String findPatNoByPatient = "/findPatNoByPatient";
        public static final String appletSign= "/appletSign";
        public static final String doorServiceTest= "/doorServiceTest";
    }
    public static class YkyyPrescription extends BaseHospitalRequestMapping.Basic {

+ 16 - 54
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.util.ImUtil;
@ -24,8 +25,6 @@ import jxl.Workbook;
import jxl.write.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@ -121,13 +120,14 @@ public class DoorOrderService {
    private String hospitalUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private WlyyDoorCommentDao doorCommentDao;
    @Autowired
    private SystemMessageDao systemMessageDao;
    /**
     * 顶部状态栏订单各分类总条数
     * @param doctor
@ -427,9 +427,9 @@ public class DoorOrderService {
        outpatientJson.put("doctorName",doctorDO.getName());
        String url = hospitalUrl + "/open/noLogin/appointmentRevisitOnDoor";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("outpatientJson", outpatientJson.toJSONString()));
        String res = httpClientUtil.post(url,params,"UTF-8");
        JSONObject json = new JSONObject();
        json.put("outpatientJson", outpatientJson);
        String res = httpClientUtil.postBody(url,json);
        System.out.println("appointmentRevisitOnDoor res:"+res);
    }
@ -489,7 +489,7 @@ public class DoorOrderService {
        doorServiceOrderDao.save(doorServiceOrder);
        messageUtil.orderMessageDel(null,orderId,"407",doorServiceOrder.getDoctor());
        systemMessageDao.orderMessageDel(doorServiceOrder.getDoctor(),orderId);
        if(doorServiceOrder.getType() == null|| doorServiceOrder.getType() != 3) {
            //获取咨询
@ -544,25 +544,7 @@ public class DoorOrderService {
            logger.error(e.getMessage());
        }
        //  待接单消息设为已操作, 434 医生接单-- 王五接受了服务工单12345678
        List<SystemMessageDO> messages = messageUtil.findSystemMesage(orderId,"403,407");
        if (CollectionUtils.isEmpty(messages)){
            logger.error("当前工单没有医生待接单消息!orderId:" + orderId);
        }else {
            messages.forEach(message->{
                messageUtil.orderMessageDel(message.getId(),message.getRelationCode(),message.getType(),message.getReceiver());
                if (message.getType().equals("403") ) {
                    BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());//·
                    String msg=doorServiceOrder.getDispatcherName() + "接受了服务工单"+ doorServiceOrder.getNumber();
                    messageUtil.saveSystemMessage(message.getId(),message.getRelationCode(),"医生接单","434",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(),
                            doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver());
                }
                else{
                    message.setOver("0");
                    messageUtil.saveSystemMessage(message);
                }
            });
        }
        messageUtil.updateMessage(doorServiceOrder,new String[]{"403","407"},"434",null,null);
    }
    /**
@ -581,21 +563,12 @@ public class DoorOrderService {
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getProxyPatient());//·
            this.createMessage("代预约服务工单重新派单","403","system","system", doorServiceOrder.getId(), doorServiceOrder.getProxyPatient(),baseDoctorDO.getName() ,null, doorServiceOrder.getPatientName() + "的代预约服务工单需重新派单,请您前往处理");
        } else {
            messageUtil.orderMessageDel(null,orderId,"407",doorServiceOrder.getDoctor());
            systemMessageDao.orderMessageDel(doorServiceOrder.getDoctor(),orderId);
            if(StringUtils.isNotBlank(doorServiceOrder.getDispatcher())){
                BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());//·
                this.createMessage("服务工单拒单待重新派单","404","system","system", doorServiceOrder.getId(), doorServiceOrder.getDispatcher(),baseDoctorDO.getName() , null,doorServiceOrder.getDoctorName() + "拒绝了" + doorServiceOrder.getProxyPatientName() + "的服务预约申请,请重新派单");
                //  调度员-派单-实时工单消息:435 医生拒单-- 王五拒绝了服务工单12345678
                List<SystemMessageDO> messages = messageUtil.findSystemMesage(orderId,"431,433");
                if (CollectionUtils.isEmpty(messages)) {
                    logger.error("当前工单没有医生待接单消息!orderId:" + orderId);
                } else {
                    SystemMessageDO message = messages.get(0);
                    messageUtil.orderMessageDel(message.getId(),message.getRelationCode(),message.getType(),message.getReceiver());
                    String msg=doorServiceOrder.getDoctorName() + "拒绝了服务工单" + doorServiceOrder.getNumber() + ", 请重新派单";
                    messageUtil.saveSystemMessage(message.getId(),message.getRelationCode(),"医生拒单","435",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(),
                            doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver());
                }
                messageUtil.updateMessage(doorServiceOrder,new String[]{"431","433"},"435",null,null);
            }
        }
        doorServiceOrder.setDoctor(null);
@ -619,21 +592,11 @@ public class DoorOrderService {
        messageDO.setRelationCode(relationCode);
        messageDO.setReceiver(Receiver);
        messageDO.setReceiverName(ReceiverName);
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", ReceiverName);
        data.put("age", IdCardUtil.getAgeForIdcard(idCard));
        try {
            data.put("gender", IdCardUtil.getSexForIdcard(idCard));
        } catch (Exception e) {
            e.printStackTrace();
        }
        data.put("msg", msg);
        messageDO.setData(msg);
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = messageDO.getCreateTime();
        String dateTime=format.format(date);
        messageDO.setCreateTime(date);
        messageUtil.saveSystemMessage(messageDO);
        messageDO.setDel("1");
        messageDO.setOver("1");
        messageDO.setCreateTime(new Date());
        systemMessageDao.save(messageDO);
    }
    /**
@ -657,7 +620,7 @@ public class DoorOrderService {
                " o.patient_phone,o.remark,o.serve_desc,o.create_time,o.patient as patientCode ,o.exam_paper_status as examPaperStatus,o.number as serverCode,o.total_fee,h.org_level as hosLevel, " +
                "o.doctor, o.doctor_name as doctorName, o.doctor_type as doctorType "
                ;
        String sqlCount = " select count(*) as total ";
        String sqlCount = " select count(DISTINCT o.id) as total ";
        String sql = " from wlyy_door_service_order o " +
                " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f. STATUS = 1 AND f.expenses_status = 1 " +
                " LEFT JOIN base_org h on h.code=o.hospital and h.del=1 "
@ -771,8 +734,7 @@ public class DoorOrderService {
            // 获取或者基本信息
            BasePatientDO patient = patientInfoService.findById(String.valueOf(one.get("patientCode")));
            if (patient != null) {
                String sex = IdCardUtil.getSexForIdcard(patient.getIdcard());
                object.put("sex", "1".equals(sex) ? "男" : "2".equals(sex) ? "女" : "未知");
                object.put("sex", IdCardUtil.getSexForIdcard(patient.getIdcard()));
                object.put("age", IdCardUtil.getAgeByIdcardOrBirthday(patient.getIdcard(),patient.getBirthday()));
                object.put("photo", patient.getPhoto());

+ 8 - 8
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java

@ -7,12 +7,12 @@ import com.yihu.jw.door.dao.DoorServiceVoucherDao;
import com.yihu.jw.door.util.MessageUtil;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.door.WlyyDoorServiceApplicationDo;
import com.yihu.jw.entity.door.WlyyDoorServiceVoucherDo;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.family.dao.WlyyPatientFamilyMemberDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
@ -23,7 +23,6 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -74,6 +73,8 @@ public class DoorServiceApplicationService {
    private MessageUtil messageUtil;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @PostConstruct
    public void init() {
@ -505,11 +506,10 @@ public class DoorServiceApplicationService {
            wlyyDoorServiceApplicationDo.setUpdateUser(doctor.getId());
            wlyyDoorServiceApplicationDo.setUpdateUserName(doctor.getName());
            //将所有调度员的消息处理为结束
            List<SystemMessageDO> messages = messageUtil.findSystemMesage(String.valueOf(id),null);
            List<SystemMessageDO> messages = systemMessageDao.findMessageByRelationCode(String.valueOf(id));
            messages.forEach(item->{
                item.setOver("0");
                messageUtil.orderMessageDel(item.getId(),null,null,null);
                messageUtil.saveSystemMessage(item);
                systemMessageDao.save(item);
            });
/*            List<Message> messages=messageDao.findMessageByRelationCode(String.valueOf(id));
            messages.forEach(item->{
@ -544,11 +544,10 @@ public class DoorServiceApplicationService {
        }else {
            //处理消息
            List<SystemMessageDO> messages = messageUtil.findSystemMesage(String.valueOf(id),null);
            List<SystemMessageDO> messages = systemMessageDao.findMessageByRelationCode(String.valueOf(id));
            messages.forEach(item->{
                item.setOver("0");
                messageUtil.orderMessageDel(item.getId(),null,null,null);
                messageUtil.saveSystemMessage(item);
                systemMessageDao.save(item);
            });
/*            List<Message> messages=messageDao.findMessageByRelationCode(String.valueOf(id));
            messages.forEach(item->{
@ -691,6 +690,7 @@ public class DoorServiceApplicationService {
//        messageUtil.sendWXMes("xm_ykyy_wx","808080eb73e02e8f0173ebe51e1b007d","210503199507250313",first,contentMsg,remark,url);
        BasePatientDO temp = patientDao.findById("0000000067bab53a0167badd74f00004");
        BasePatientDO patient = patientInfoService.findById("0000000067bab53a0167badd74f00004");
        List<SystemMessageDO> messages = systemMessageDao.queryByRelationCodeAndTypeIn("2c9081aa6df16adb016df78bc56c66ef",new String[]{"6","9"});
        return "ss";
    }

+ 52 - 114
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -16,6 +16,7 @@ import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.org.dao.BaseOrgDao;
@ -53,7 +54,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -165,6 +165,11 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    private DoorServiceApplicationService doorServiceApplicationService;
    @Autowired
    private MessageUtil messageUtil;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private SystemMessageDao systemMessageDao;
    /**
     * 上门服务工单服务基本信息
     *
@ -1359,28 +1364,14 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            orderDO.setDispatcher(dispatcher);
            orderDO.setDispatcherName(dispatcherName);
        }
        //如果是调度员取消,推送IM取消工单json消息,
        orderDO.setStatus(WlyyDoorServiceOrderDO.Status.cancel.getType());
        this.save(orderDO);
        if(type == WlyyDoorServiceOrderDO.CancelType.dispatcher.getType()){
            List<SystemMessageDO> messages = messageUtil.findSystemMesage(orderId,"402,403,430");
            if(CollectionUtils.isEmpty(messages)){
                logger.error("当前工单没有系统消息!!orderId:" + orderId);
            } else {
                // 432 调度员拒单即取消工单-- 李四拒绝了张三的服务工单12345678
                messages.forEach(
                        message -> {
                            messageUtil.orderMessageDel(message.getId(),message.getRelationCode(),message.getType(),message.getReceiver());
                            if (message.getType() .equals("430")) {
                                String msg=orderDO.getDispatcherName() + "拒绝了"+ orderDO.getPatientName() +"的服务工单" + orderDO.getNumber();
                                messageUtil.saveSystemMessage(message.getId(),message.getRelationCode(),"调度员拒单","432",dispatcher,dispatcherName,
                                        dispatcher,dispatcherName,null,msg,message.getOver());
                            }else{
                                message.setOver("0");
                                messageUtil.saveSystemMessage(message);
                            }
                        }
                );
            }
            messageUtil.updateMessage(orderDO,new String[]{"402","403","430"},"432",dispatcher,dispatcher);
        }
        else if(type == WlyyDoorServiceOrderDO.CancelType.patient.getType()){                   //居民取消,消息列表也应该不显示
            messageUtil.updateMessage(orderDO,new String[]{"402","403","430"},"patientCancel",dispatcher,dispatcher);
        }
//        else if(type == WlyyDoorServiceOrderDO.CancelType.patient.getType()){                   //居民取消,消息列表也应该不显示
//
@ -1458,6 +1449,27 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        JSONObject confirmInfoJson = new JSONObject();
        confirmInfoJson.put("confirmInfo",confirmInfo);
        this.orderWithConfirmLogAdd(result,confirmInfo,orderId);
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        // 发送微信模板消息,通知居民工单已取消(smyyyqx-上门预约已取消)
        String first = "key1,您好,您的上门预约服务已退回,点击查看原因";
        BasePatientDO patient = patientDao.findById(orderDO.getPatient());
        first  = first.replace("key1", null != patient.getName() ? patient.getName() : "");
//        if(consult != null) {
//            json.put("consult", consult.getCode());
//        }else {
//            json.put("id", orderDO.getId());
//        }
//        if(json.has("consult")) {
//            temp.setUrl(url + json.getString("url") + "?openid=" + openid + "&consult=" + json.getString("consult"));
//        }else if (json.has("id")){
//            temp.setUrl(url + json.getString("url") + "?openid=" + openid + "&id=" + json.getString("id"));
//        }else if(json.has("relationCode")){
//            temp.setUrl(url + json.getString("url") + "?openid=" + openid );
//        }else if(json.has("resultCode")){
//            temp.setUrl(url + json.getString("url") + "?resultCode=" + json.getString("resultCode"));
//        }
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,null,null,DateUtil.dateToStrShort(new Date()),"上门预约已取消");
/*        Consult consult = consultDao.queryByRelationCode(orderId);
        // 发送微信模板消息,通知居民工单已取消(smyyyqx-上门预约已取消)
@ -1495,6 +1507,18 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        // 发送微信模板消息,通知居民工单已取消(smyyyqx-上门预约已取消)
        BasePatientDO patient = patientDao.findById(orderDO.getPatient());
        String first="key1,您好,您的上门预约服务已退回,点击查看原因";
        first = first.replace("key1", null != patient.getName() ? patient.getName() : "");
//        json.put("url", "appoint_service/html/appoint-serviceDetail.html?id="+orderId);
//        json.put("remark", templateConfig.getRemark());
//        if(consult != null) {
//            json.put("consult", consult.getCode());
//        }else {
//            json.put("id", orderDO.getId());
//        }
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,null,null,DateUtil.dateToStrShort(new Date()),"知情同意书已推送");
/*        BasePatientDO patient = patientDao.findById(orderDO.getPatient());
        WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_process_feedback","smyyyqx");
        String first = templateConfig.getFirst().replace("key1", null != patient.getName() ? patient.getName() : "");
@ -2082,7 +2106,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
        String sql = "select ds.doctor,d.name, d.job_name as jobName, 1 as sortFlag " +
        String sql = "select ds.doctor,d.name, d.job_title_name as jobName, 1 as sortFlag " +
                " from wlyy_door_doctor_status ds " +
                "        JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code='" + hospital + "')  d on ds.doctor = d.id " +
                " where ds.status in (1,2,3,4)" +
@ -2090,7 +2114,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        String countSql = "select count(ds.id) " +
                "from wlyy_door_doctor_status ds " +
                "         JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code= '" + hospital + "') d on ds.doctor = d.code " +
                "         JOIN (select b.* from base_doctor b,base_doctor_hospital dh where b.id=dh.doctor_code and dh.del = 1 and dh.org_code= '" + hospital + "') d on ds.doctor = d.id " +
                "where ds.status in (1,2,3,4)";
        List<Map<String,Object>> doctorList = new ArrayList<>();
        try {
@ -2219,33 +2243,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        imUtill.updateParticipant(sessionId,doctor,null);
        // 调度员处理完该单(新增预约的,或者是拒单重新派单的)
/*        List<Message> messages = messageDao.queryByRelationCodeAndTypeIn(orderId,new Integer[]{402,404,430,435});
        if(CollectionUtils.isEmpty(messages)){
            logger.error("当前工单没有 居民新增预约 消息!!orderId:" + orderId);
        }else{
            // 设置消息处理完毕
            messages.forEach(
                    message -> {
                        String title = "调度员派单(派给本社区医生)";
                        if("system".equals(dispatcher)){
                            title = "系统派单(派给服务医生)";
                        }
                        if (message.getType() == 430) {
                            message.setTitle(title);
                            message.setContent(doorServiceOrderDO.getDispatcherName() + "已将服务工单" + doorServiceOrderDO.getNumber() + "指派给" + doctorName + "医生");
                            message.setType(431);
                            message.setReceiver(dispatcher);
                            message.setSender(dispatcher);
                            message.setCreateTime(new Date());
                        }else{
                            message.setOver("0");
                        }
                        messageDao.save(message);
                    }
            );
        }*/
        messageUtil.updateMessage(doorServiceOrderDO,new String[]{"402","403","430","435"},"431",dispatcher,dispatcher);
        // 工单状态变更记录
        WlyyDoorProcessLogDO processLogDO = new WlyyDoorProcessLogDO();
@ -2320,29 +2318,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        imUtill.updateParticipant(sessionId,doctor,null);
        // 调度员处理完该单(新增预约的,或者是拒单重新派单的)
/*        List<Message> messages = messageDao.queryByRelationCodeAndTypeIn(orderId,new Integer[]{402,404,430,435});
        if(CollectionUtils.isEmpty(messages)){
            logger.error("当前工单没有 居民新增预约 消息!!orderId:" + orderId);
        }else{
            // 设置消息处理完毕
            messages.forEach(
                    message -> {
                        if (message.getType() == 430) {
                            message.setTitle("医生转派单(派给本社区医生)");
                            message.setContent(doorServiceOrderDO.getDispatcherName() + "已将服务工单" + doorServiceOrderDO.getNumber() + "转派给" + doctorName + "医生");
                            message.setType(431);
                            message.setReceiver(dispatcher);
                            message.setSender(dispatcher);
                            message.setCreateTime(new Date());
                        }else{
                            message.setOver("0");
                        }
                        messageDao.save(message);
                    }
            );
        }*/
        messageUtil.updateMessage(doorServiceOrderDO,new String[]{"402","403","430","435"},"431",dispatcher,dispatcher);
        // 工单状态变更记录
        WlyyDoorProcessLogDO processLogDO = new WlyyDoorProcessLogDO();
@ -2433,37 +2409,11 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        messageDO.setRelationCode(relationCode);
        messageDO.setReceiver(Receiver);
        messageDO.setReceiverName(ReceiverName);
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", ReceiverName);
        data.put("age", IdCardUtil.getAgeForIdcard(idCard));
        try {
            data.put("gender", IdCardUtil.getSexForIdcard(idCard));
        } catch (Exception e) {
            e.printStackTrace();
        }
        data.put("msg", msg);
        messageDO.setOver("1");
        messageDO.setData(msg);
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = messageDO.getCreateTime();
        String dateTime=format.format(date);
        messageDO.setCreateTime(date);
        messageUtil.saveSystemMessage(messageDO);
/*        Message message=new Message();
        message.setCzrq(new Date());
        message.setCreateTime(new Date());
        message.setRead(1);
        message.setState(1);
        message.setRelationCode(orderId);
        message.setOver("1");
        message.setReceiver(receiver);
        message.setSender(sender);
        message.setCode(getCode());
        message.setTitle(title);
        message.setContent(Content);
        //消息类型:401为资质申请审核
        message.setType(type);
        message.setDel("1");
        messageDao.save(message);*/
        messageDO.setDel("1");
        messageDO.setCreateTime(new Date());
        systemMessageDao.save(messageDO);
    }
    /**
@ -2733,15 +2683,6 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }
        //判断工单是否已存在,新建或者编辑
        if(StringUtils.isBlank(orderDO.getId())) {
/*            SignFamily signFamily = signFamilyDao.findSignFamilyByPatient(orderDO.getPatient());
            if (signFamily == null) {
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                String failMsg = "当前服务对象未完成家庭医生签约,请完成签约后再预约上门服务!";
                result.put(ResponseContant.resultMsg, failMsg);
                logger.error(failMsg);
                return result;
            }*/
            //已取消的订单也可以申请
            boolean bool = wlyyDoorServiceOrderDao.existsByPatientAndStatusIn(orderDO.getPatient(),
                    new Integer[]{WlyyDoorServiceOrderDO.Status.waitForAccept.getType(),
@ -2797,9 +2738,6 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                sql += " and d.id = '"+orderDO.getDoctor()+"'";
                List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
/*                BaseDoctorDO doctor = doctorDao.findById(orderDO.getDoctor());
                Hospital hospital = hospitalDao.findByCode(doctor.getHospital());
                doorOrderService.acceptOrder1(orderDO.getId(), doctor.getJob(), doctor.getJobName(), hospital.getLevel());*/
                doorOrderService.acceptOrder1(orderDO.getId(), list.get(0).get("job_title_code").toString(),
                        list.get(0).get("job_title_name").toString(), Integer.valueOf(list.get(0).get("org_level").toString()));
            }catch (Exception e){

+ 1 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/WlyyMessageService.java

@ -35,13 +35,12 @@ public class WlyyMessageService {
        String sqlCount = " select count(*) as total ";
        String sql =  " FROM base_system_message a " +
                " LEFT JOIN wlyy_door_service_application b ON a.relation_code = b.id ";
//        sql+= " where 1=1 AND a.state = 1 AND a.over = 1 ";
        sql+= " where a.del='1' AND a.over = 1  ";
        if(!StringUtils.isEmpty(message.getReceiver())){
            sql+=" AND a.receiver = '"+message.getReceiver()+"'";
        }
        if(!StringUtils.isEmpty(types)){
            sql+=" AND a.type IN ("+types+")";
            sql+=" AND a.type IN ('"+types.replaceAll(",","','")+"')";
        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlCount+sql);
        sql+=" ORDER BY a.create_time DESC LIMIT "+(page-1)*size+","+size;

+ 147 - 267
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/MessageUtil.java

@ -2,36 +2,31 @@ package com.yihu.jw.door.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.door.WlyyDoorServiceOrderDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.rm.base.WechatRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -54,13 +49,18 @@ public class MessageUtil {
    private WxTemplateConfigDao wxTemplateConfigDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @Autowired
    private WxAccessTokenDao wxAccessTokenDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    //发送微信模板消息
    public static String sendMessageUrl ="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    public static String sendMessageUrl = "http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    /**
     *
     * @param wxId
     * @param patient 患者id
     * @param patient       患者id
     * @param cardNo
     * @param first
     * @param noticeContent
@ -68,52 +68,52 @@ public class MessageUtil {
     * @param redirectUrl
     * @return
     */
    public String sendWXMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){
        String msg="first:"+first+"contentMsg:"+noticeContent+"remark:"+remark;
        logger.info("发送的信息="+msg);
    public String sendWXMes(String wxId, String patient, String cardNo, String first, String noticeContent, String remark, String redirectUrl) {
        String msg = "first:" + first + "contentMsg:" + noticeContent + "remark:" + remark;
        logger.info("发送的信息=" + msg);
        JSONObject params = new JSONObject();
        params.put("transType","sms.hospital.notice");
        params.put("merchId","3501000014");
        params.put("transType", "sms.hospital.notice");
        params.put("merchId", "3501000014");
        JSONObject p = new JSONObject();
        String openId = "";
        if(StringUtils.isNotBlank(patient)){
            String sql = "select * from base.base_patient_wechat where wechat_id='"+wxId+"'and patient_id='"+patient+"' ";
            List<BasePatientWechatDo> paientWechatDos = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(BasePatientWechatDo.class));
            if(paientWechatDos!=null&&paientWechatDos.size()>0){
        if (StringUtils.isNotBlank(patient)) {
            String sql = "select * from base.base_patient_wechat where wechat_id='" + wxId + "'and patient_id='" + patient + "' ";
            List<BasePatientWechatDo> paientWechatDos = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientWechatDo.class));
            if (paientWechatDos != null && paientWechatDos.size() > 0) {
                openId = paientWechatDos.get(0).getOpenid();
                p.put("openId",openId);
                p.put("openId", openId);
            }
        }else {
            p.put("cardNo",cardNo);
        } else {
            p.put("cardNo", cardNo);
        }
        p.put("first",first);
        p.put("noticeTime", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
        p.put("noticeContent",noticeContent);
        if(StringUtils.isNotBlank(redirectUrl)){
            p.put("redirectUrl",redirectUrl);
        p.put("first", first);
        p.put("noticeTime", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"));
        p.put("noticeContent", noticeContent);
        if (StringUtils.isNotBlank(redirectUrl)) {
            p.put("redirectUrl", redirectUrl);
        }
        p.put("remark",remark);
        params.put("param",p);
        p.put("remark", remark);
        params.put("param", p);
        logger.info("params :"+params.toString());
        logger.info("params :" + params.toString());
        if(StringUtils.isNotBlank(openId)||StringUtils.isNotBlank(cardNo)){
            String rs = HttpUtil.sendPost(sendMessageUrl,params.toJSONString());
        if (StringUtils.isNotBlank(openId) || StringUtils.isNotBlank(cardNo)) {
            String rs = HttpUtil.sendPost(sendMessageUrl, params.toJSONString());
            JSONObject rsJson = JSON.parseObject(rs);
            String resCode = rsJson.getString("respCode");
            if("000000".equals(resCode)){
            if ("000000".equals(resCode)) {
                return "1";
            }
            return "0";
        }else {
        } else {
            return "-1";
        }
    }
    public String ehospitalNotice(String userName, String idCard, String phone, String title, String content, String contentString,String url) {
        String msg="first:"+title+"contentMsg:"+content+"remark:"+contentString;
        logger.info("发送的信息="+msg);
    public String ehospitalNotice(String userName, String idCard, String phone, String title, String content, String contentString, String url) {
        String msg = "first:" + title + "contentMsg:" + content + "remark:" + contentString;
        logger.info("发送的信息=" + msg);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("userName", userName);
        jsonObject.put("idCard", idCard);
@ -128,142 +128,63 @@ public class MessageUtil {
        return responseMsg;
    }
    public void putTemplateWxMessage(String wechatId,String templateName,String scene,String openId,String first,String remark,String url,String ...keywords){
    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first, String remark, String url, String... keywords) {
        try {
            WxAccessTokenDO wxAccessTokenDO = getWxAccessTokenById(wechatId);
            if (wxAccessTokenDO==null){
                logger.info("wx_access_token表获取为空,wechatId"+wechatId);
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            if (wxAccessTokenDO == null) {
                logger.info("wx_access_token表获取为空,wechatId" + wechatId);
                return;
            }
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            String sql="select w.* from base.wx_template_config w where w.wechat_id='"+wechatId+"' and w.template_name='"+templateName+"' and w.scene='"+scene+"' and w.status=1";
            List<WxTemplateConfigDO> configList =  jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(WxTemplateConfigDO.class));
            WxTemplateConfigDO config =null;
            if (configList.size()>0){
                config = configList.get(0);
            }else {
                logger.info("微信模板不存在!请确认wechatId:"+wechatId+",templateName:"+templateName+",scene:"+scene);
            WxTemplateConfigDO newConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1);
            if (newConfig == null) {
                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene);
                return;
            }
            BeanUtils.copyProperties(config, newConfig);
            if (StringUtils.isNoneBlank(url)){
            if (StringUtils.isNoneBlank(url)) {
                newConfig.setUrl(url);
            }
            if (StringUtils.isNoneBlank(remark)){
            if (StringUtils.isNoneBlank(remark)) {
                newConfig.setRemark(remark);
            }
            newConfig.setFirst(first);
            int keyLength = keywords.length;
            if (keyLength>=1){
            if (keyLength >= 1) {
                newConfig.setKeyword1(keywords[0]);
            }
            if (keyLength>=2){
            if (keyLength >= 2) {
                newConfig.setKeyword1(keywords[1]);
            }
            if (keyLength>=3){
            if (keyLength >= 3) {
                newConfig.setKeyword1(keywords[2]);
            }
            if (keyLength>=4){
            if (keyLength >= 4) {
                newConfig.setKeyword1(keywords[3]);
            }
            if (keyLength>=5){
            if (keyLength >= 5) {
                newConfig.setKeyword1(keywords[4]);
            }
            if (keyLength>=6){
            if (keyLength >= 6) {
                newConfig.setKeyword1(keywords[5]);
            }
            if (keyLength>=7){
            if (keyLength >= 7) {
                newConfig.setKeyword1(keywords[6]);
            }
            //发起微信消息模板推送
            weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), openId, newConfig);
        }catch (Exception e){
            logger.info("微信模板推送异常");
            e.printStackTrace();
        }
    }
    public WxAccessTokenDO getWxAccessTokenById(String wechatId) {
        try {
            //根据wechatCode查找出appid和appSecret
            String sql ="select * from base.wx_wechat w where w.id = '"+wechatId+"' and w.status!=-1";
            List<WxWechatDO> wxWechatList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(WxWechatDO.class));
            WxWechatDO wxWechat=null;
            if (wxWechatList.size()>0){
                wxWechat = wxWechatList.get(0);
            }
            sql="select * from base.wx_access_token w where w.wechat_id ='"+wechatId+"' order by w.add_timestamp desc ";
            List<WxAccessTokenDO> wxAccessTokens =  jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(WxAccessTokenDO.class));
            if(wxWechat==null){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_wxWechat_is_no_exist, ExceptionCode.common_error_params_code);
            }
            if(wxAccessTokens!=null&&wxAccessTokens.size()>0){
                for (WxAccessTokenDO accessToken : wxAccessTokens) {
                    if ((System.currentTimeMillis() - accessToken.getAddTimestamp()) < (accessToken.getExpiresIn() * 500)) {
                        return accessToken;
                    } else {
                        sql="DELETE  from  base.wx_access_token where wechat_id='"+accessToken.getWechatId()+"' and access_token='"+accessToken.getAccessToken()+"'";
                        jdbcTemplate.execute(sql);
                        break;
                    }
                }
            }
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String appId="";
            String appSecret="";
            appId = wxWechat.getAppId();
            appSecret = wxWechat.getAppSecret();
            if (org.springframework.util.StringUtils.isEmpty(appId)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appId_is_null, ExceptionCode.common_error_params_code);
            }
            if (org.springframework.util.StringUtils.isEmpty(appSecret)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appSecret_is_null, ExceptionCode.common_error_params_code);
            }
            Map<String, Object> params = new HashMap<>();
            params.put("grant_type", "client_credential");
            params.put("appid", appId);
            params.put("secret", appSecret);
            String result = HttpUtils.doGet(token_url, params).getContent();
            logger.info("--------------wechat token return:"+result+"---------------");
            org.json.JSONObject json = new org.json.JSONObject(result);
            if (json.has("access_token")) {
                sql="INSERT INTO `base`.`wx_access_token` (`id`, `wechat_id`, `access_token`, `add_timestamp`, `expires_in`, `czrq`, `code`) \n" +
                        "VALUES ('?1', '?2', '?3', '?4', '?5', '?6', '?7') ";
                String token = json.get("access_token").toString();
                String expires_in = json.get("expires_in").toString();
                WxAccessTokenDO newaccessToken = new WxAccessTokenDO();
                newaccessToken.setAccessToken(token);
                newaccessToken.setExpiresIn(Long.parseLong(expires_in));
                newaccessToken.setAddTimestamp(System.currentTimeMillis());
                newaccessToken.setCzrq(new Date());
                newaccessToken.setCode(UUID.randomUUID().toString().replace("-",""));
                newaccessToken.setWechatId(wechatId);
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                sql.replace("?1",UUID.randomUUID().toString().replace("-",""));
                sql.replace("?2",newaccessToken.getWechatId());
                sql.replace("?3",newaccessToken.getAccessToken());
                sql.replace("?4",newaccessToken.getAddTimestamp()+"");
                sql.replace("?5",newaccessToken.getExpiresIn()+"");
                sql.replace("?6",format.format(newaccessToken.getCzrq()));
                sql.replace("?7",newaccessToken.getCode());
                jdbcTemplate.execute(sql);
                return newaccessToken;
            } else {
                return null;
            }
        } catch (Exception e) {
            logger.info("微信模板推送异常");
            e.printStackTrace();
            return null;
        }
    }
    /**
     *
     */
    public SystemMessageDO saveSystemMessage(String messageId,String relationCode,String title,String type,String sender,String senderName,String receiver,String receiverName,String idCard,String msg,String over) {
    public SystemMessageDO saveSystemMessage(String messageId, String relationCode, String title, String type, String sender, String senderName, String receiver, String receiverName, String idCard, String msg, String over) {
        SystemMessageDO messageDO = new SystemMessageDO();
        if (StringUtils.isBlank(messageId)){
            messageDO.setId(UUID.randomUUID().toString().replace("-",""));
        if (StringUtils.isBlank(messageId)) {
            messageDO.setId(UUID.randomUUID().toString().replace("-", ""));
        }
        messageDO.setTitle(title);
        messageDO.setType(type);
@ -272,146 +193,105 @@ public class MessageUtil {
        messageDO.setRelationCode(relationCode);
        messageDO.setReceiver(receiver);
        messageDO.setReceiverName(receiverName);
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", receiverName);
        data.put("age", IdCardUtil.getAgeForIdcard(idCard));
        try {
            data.put("gender", IdCardUtil.getSexForIdcard(idCard));
        } catch (Exception e) {
            e.printStackTrace();
        }
        data.put("msg", msg);
        messageDO.setData(data.toString());
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = messageDO.getCreateTime();
        String dateTime=format.format(date);
        String sql="INSERT INTO `base`.`base_system_message` (`id`, `type`, `title`, `sender`, `sender_name`, `receiver`, `receiver_name`, `relation_code`, `data`, `is_read`, `del`, `create_time`,`over`) \n" +
                "VALUES ('?!', '?2', '?3', '?4', '?5', '?6', '?7', '?8', '?9', '0', '1', '?10')";
        messageDO.setCreateTime(date);
        sql.replace("?1",messageDO.getId());
        sql.replace("?2",messageDO.getType());
        sql.replace("?3",messageDO.getTitle());
        sql.replace("?4",messageDO.getSender());
        sql.replace("?5",messageDO.getSenderName());
        sql.replace("?6",messageDO.getReceiver());
        sql.replace("?7",messageDO.getReceiverName());
        sql.replace("?8",messageDO.getRelationCode());
        sql.replace("?9",messageDO.getData());
        sql.replace("?10",dateTime);
        sql.replace("?11",over);
        jdbcTemplate.execute(sql);
        return messageDO;
    }
    public SystemMessageDO saveSystemMessage(SystemMessageDO messageDO){
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (StringUtils.isBlank(messageDO.getId())){
            messageDO.setId(UUID.randomUUID().toString().replace("-",""));
        }
        Date date = messageDO.getCreateTime();
        String dateTime=format.format(date);
        String sql="INSERT INTO `base`.`base_system_message` (`id`, `type`, `title`, `sender`, `sender_name`, `receiver`, `receiver_name`, `relation_code`, `data`, `is_read`, `del`, `create_time`,`over`) \n" +
                "VALUES ('?!', '?2', '?3', '?4', '?5', '?6', '?7', '?8', '?9', '0', '1', '?10','?11')";
        messageDO.setCreateTime(date);
        sql.replace("?1",messageDO.getId());
        sql.replace("?2",messageDO.getType());
        sql.replace("?3",messageDO.getTitle());
        sql.replace("?4",messageDO.getSender());
        sql.replace("?5",messageDO.getSenderName());
        sql.replace("?6",messageDO.getReceiver());
        sql.replace("?7",messageDO.getReceiverName());
        sql.replace("?8",messageDO.getRelationCode());
        sql.replace("?9",messageDO.getData());
        sql.replace("?10",dateTime);
        sql.replace("?11",messageDO.getOver());
        jdbcTemplate.execute(sql);
        messageDO.setData(msg);
        messageDO.setOver(over);
        messageDO.setCreateTime(new Date());
        systemMessageDao.save(messageDO);
        return messageDO;
    }
//    public void updateMessageByList(String orderId,String typeCondition,String title) {
//        List<SystemMessageDO> messages = findSystemMesage(orderId, "403,407");
//        if (CollectionUtils.isEmpty(messages)) {
//            logger.error("当前工单没有医生待接单消息!orderId:" + orderId);
//        } else {
//            messages.forEach(message -> {
//                orderMessageDel(message.getId(), message.getRelationCode(), message.getType(), message.getReceiver());
//                if (message.getType().equals("403")) {
//                    message.setTitle("医生接单");
//                    message.setType(434 + "");
//                    message.setReceiver(doorServiceOrder.getDispatcher());
//                    message.setReceiverName(doorServiceOrder.getDispatcherName());
//                    message.setSender(doorServiceOrder.getDoctor());
//                    message.setSenderName(doorServiceOrder.getDoctorName());
//                    message.setCreateTime(new Date());
//                    JSONObject data = JSONObject.parseObject(message.getData());
//                    String msg = doorServiceOrder.getDispatcherName() + "接受了服务工单" + doorServiceOrder.getNumber();
//                    BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());//·
//                    data.put("name", message.getReceiverName());
//                    data.put("age", IdCardUtil.getAgeForIdcard(baseDoctorDO.getIdcard()));
//                    try {
//                        data.put("gender", IdCardUtil.getSexForIdcard(baseDoctorDO.getIdcard()));
//                    } catch (Exception e) {
//                        e.printStackTrace();
//                    }
//                    data.put("msg", msg);
//                    message.setData(data.toJSONString());
//                }
////                else{
////                    message.setOver("0");
////                }
//                saveSystemMessage(message);
//
//            });
//        }
//    }
    public void updateMessage(SystemMessageDO message) {
        orderMessageDel(message.getId(),null,null,null);
    }
    public List<SystemMessageDO> findSystemMesage(String relationCode,String type){
        StringBuilder sql =new StringBuilder("select * from base.base_system_message where 1=1 ");
        if (StringUtils.isNoneBlank(relationCode)){
            sql.append(" and relation_code='"+relationCode+"' ");
    public void updateMessage(WlyyDoorServiceOrderDO doorServiceOrder,String[] type,String toType,String sender,String receiver){
        String orderId=doorServiceOrder.getId();
        List<SystemMessageDO> messages = systemMessageDao.queryByRelationCodeAndTypeIn(orderId,type);
        if (toType.equals("434")){//医生接单
            if (CollectionUtils.isEmpty(messages)){
                logger.error("当前工单没有医生待接单消息!orderId:" + orderId);
            }else {
                messages.forEach(message->{
                    systemMessageDao.orderMessageDel(message.getReceiver(),message.getRelationCode());
                    if (message.getType().equals("403") ) {
                        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());//·
                        String msg=doorServiceOrder.getDispatcherName() + "接受了服务工单"+ doorServiceOrder.getNumber();
                        saveSystemMessage(message.getId(),message.getRelationCode(),"医生接单","434",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(),
                                doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver());
                    }
                    else{
                        message.setOver("0");
                        systemMessageDao.save(message);
                    }
                });
            }
        }
        if (StringUtils.isNoneBlank(type)){
            sql.append(" and type in ('").append(type.replace(",","','")).append("') ");
        if (toType.equals("435")) {//医生拒单
            if (CollectionUtils.isEmpty(messages)) {
                logger.error("当前工单没有医生待接单消息!orderId:" + orderId);
            } else {
                SystemMessageDO message = messages.get(0);
                BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doorServiceOrder.getDispatcher());
                String msg=doorServiceOrder.getDoctorName() + "拒绝了服务工单" + doorServiceOrder.getNumber() + ", 请重新派单";
                saveSystemMessage(message.getId(),message.getRelationCode(),"医生拒单","435",doorServiceOrder.getDoctor(),doorServiceOrder.getDoctorName(),
                        doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver());
            }
        }
        List<SystemMessageDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper<>(SystemMessageDO.class));
        return list;
    }
        if (toType.equals("431")) {//调度员派单(派给本社区医生)
            if(CollectionUtils.isEmpty(messages)){
                logger.error("当前工单没有 居民新增预约 消息!!orderId:" + orderId);
            }else{
                // 设置消息处理完毕
                messages.forEach(
                        message -> {
                            String title = "调度员派单(派给本社区医生)";
                            if("system".equals(doorServiceOrder.getUpdateUser())){
                                title = "系统派单(派给服务医生)";
                            }
                            if (message.getType() .equals("430")) {
                                message.setTitle(title);
                                String msg = doorServiceOrder.getDispatcherName() + "已将服务工单" + doorServiceOrder.getNumber() + "指派给" + doorServiceOrder.getDoctorName() + "医生";
                                saveSystemMessage(message.getId(),message.getRelationCode(),title,"431",doorServiceOrder.getUpdateUser(),doorServiceOrder.getUpdateUserName(),
                                        doorServiceOrder.getUpdateUser(),doorServiceOrder.getUpdateUserName(),null,msg,message.getOver());
    public void orderMessageDel(String id,String relationCode,String type,String receiver){
        StringBuilder sql = new StringBuilder(" DELETE  from  base.base_system_message where 1=1 ");
        int runStatus=0;
        if (StringUtils.isNoneBlank(id)){
            sql.append(" and id='"+id+"' ");
            runStatus=1;
        }
        if (StringUtils.isNoneBlank(relationCode)){
            sql.append(" and relation_code='"+relationCode+"' ");
            runStatus=1;
        }
        if (StringUtils.isNoneBlank(type)){
            sql.append(" and type='"+type+"' ");
            runStatus=1;
                            }else{
                                message.setOver("0");
                                systemMessageDao.save(message);
                            }
                        }
                );
            }
        }
        if (StringUtils.isNoneBlank(receiver)){
            sql.append(" and receiver='"+receiver+"' ");
            runStatus=1;
        if (toType.equals("432")){//调度员拒单
            if(CollectionUtils.isEmpty(messages)){
                logger.error("当前工单没有系统消息!!orderId:" + orderId);
            } else {
                // 432 调度员拒单即取消工单-- 李四拒绝了张三的服务工单12345678
                messages.forEach(
                        message -> {
                            if (message.getType() .equals("430")) {
                                String msg=doorServiceOrder.getDispatcherName() + "拒绝了"+ doorServiceOrder.getPatientName() +"的服务工单" + doorServiceOrder.getNumber();
                                saveSystemMessage(message.getId(),message.getRelationCode(),"调度员拒单","432",doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),
                                        doorServiceOrder.getDispatcher(),doorServiceOrder.getDispatcherName(),null,msg,message.getOver());
                            }else{
                                message.setOver("0");
                                systemMessageDao.save(message);
                            }
                        }
                );
            }
        }
        if (runStatus==1){
            jdbcTemplate.execute(sql.toString());
        if (toType.equals("patientCancel")){//居民取消 消息列表也应该不显示
            if(CollectionUtils.isEmpty(messages)){
                logger.error("当前工单没有系统消息!!orderId:" + orderId);
            } else {
                messages.forEach(
                        message -> {
                            message.setOver("0");
                            systemMessageDao.save(message);
                        }
                );
            }
        }
    }
    public  void test(){
        String sql="select w.* from base.wx_template_config w where w.wechat_id='xm_ykyy_wx' and w.template_name='template_evaluate_notice' and w.scene='fwqjtx' and w.status=1";
        List<Map<String,Object>> config =  jdbcTemplate.queryForList(sql);
//        wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus("xm_ykyy_wx", "template_pay_notice_jz", "mzxxtx", 1)
        System.out.println("!");
    }
    public static void main(String[] args){
        try {
            for (int i=0;i<10;i++){

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

@ -301,5 +301,84 @@ FileTempPath:
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
# 系统配置
systemSetting:
  isApplication: 0 # 是否需要资质申请 1需要 0 不需要
---
spring:
  profiles: tnJwprod
  datasource:
    url: jdbc:mysql://10.9.1.247:3306/base?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: qY#j2n5O
  redis:
    host: 10.9.1.247 # Redis server host.
    port: 6380 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 10.9.1.247:22122
  public-server: https://hlwyy.xmzsh.com/fastdfs/
neiwang:
  enable: true
  wlyy: http://59.61.92.90:9099/iot/
server:
  server_url: http://ehr.yihu.com/wlyy/
base:
  url: http://192.168.120.96:10020/svr-base/
  hospitalUrl: http://172.26.0.107:10022/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fwww.xmtyw.cn%2fwlyy
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
im:
  im_list_get: http://10.9.1.247:3000/
  data_base_name: im
es:
  pwflag: 1 # 1需要密码,2不需要密码
  index:
    Statistics: hlw_quota_prod
  type:
    Statistics: hlw_quota_prod
  host:  http://10.9.1.247:9200
  tHost: 10.9.1.247:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
  user: lion
  password: jkzlehr
wlyy:
  url: http://ehr.yihu.com/wlyy/
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
demo:
  flag: false
express:
  sf_url: https://mrds-admin.sf-express.com:443
  sf_code: WH000101
  sf_check_word: EDSAFWFAQWyjt8099
pay:
  flag: true
# 上传文件临时路径配置
FileTempPath:
  upload_temp_path : /var/local/temp
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
# 系统配置
systemSetting:
  isApplication: 0 # 是否需要资质申请 1需要 0 不需要

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

@ -345,7 +345,7 @@ express:
spring:
  profiles: tnJwprod
  datasource:
    url: jdbc:mysql://10.9.1.247:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false #jdbc:mysql://192.0.33.27:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    url: jdbc:mysql://10.9.1.247:3310/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false #jdbc:mysql://192.0.33.27:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: wlyy
    password: qY#j2n5O

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

@ -512,7 +512,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "prescriptionId", value = "处方id")
                                        @RequestParam(value = "prescriptionId", required = false)String prescriptionId,
                                    @ApiParam(name = "hisId", value = "审方唯一标识")
                                        @RequestParam(value = "hisId", required = false)String hisId)throws Exception {
                                        @RequestParam(value = "hisId", required = false)String hisId,
                                    @ApiParam(name = "orderId", value = "上门服务订单号")
                                        @RequestParam(value = "orderId", required = false)String orderId)throws Exception {
        Map<String,Object> result = prescriptionService.makeDiagnosis(outPatientId,prescriptionId,advice,type,infoJsons,diagnosisJson,inspectionJson,emrJson,hisId);
        try {
@ -535,6 +537,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outPatientId);
            String immsg = imService.pushHuiZhenMsg(msgObj,wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getDoctorName(),outPatientId,wlyyOutpatientDO.getPatient(),wlyyOutpatientDO.getOutpatientType());
            System.out.println("发送诊断消息成功:"+immsg);
            if (result.get("prescriptionId")!=null&&StringUtils.isNoneBlank(orderId)){
              prescriptionService.savePrescriptionToDoorService(orderId,result.get("prescriptionId").toString());
            }
        }catch (Exception e){
            System.out.println("发送诊断消息失败:"+e.getMessage());
//            e.printStackTrace();
@ -1125,6 +1131,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                //检验
                return success(xzzxEntranceService.selectLisApply(pyKey));
            }
        }if("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
            return  success(tnyyEntranceService.findVpacsBw(pyKey));
        }else {
            return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
        }
@ -2355,6 +2363,54 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.doorServiceTest)
    @ApiOperation(value = "测试上门复诊数据同步")
    public Envelop doorServiceTest(
            @ApiParam(name = "orderId", value = "orderId")
            @RequestParam(value = "orderId",defaultValue = "",required = false) String orderId,
            @ApiParam(name = "prId", value = "prId")
            @RequestParam(value = "prId",defaultValue = "",required = false) String prId) throws Exception {
        return success(prescriptionService.savePrescriptionToDoorService(orderId,prId));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.selectMzRecord)
    @ApiOperation(value = "查询门诊记录下的患者列表")
    public Envelop selectMzRecord(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor) throws Exception {
        return success(tnyyEntranceService.selectMzRecord(doctor));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.selectZyRecord)
    @ApiOperation(value = "查询住院记录下的患者列表")
    public Envelop selectZyRecord(
            @ApiParam(name = "doctor", value = "doctor")
            @RequestParam(value = "doctor",defaultValue = "",required = true) String doctor) throws Exception {
        return success(tnyyEntranceService.selectZyRecord(doctor));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findJKTA_V_ZKSG_HZCX_HIS)
    @ApiOperation(value = "查询某个患者的住院记录")
    public Envelop findJKTA_V_ZKSG_HZCX_HIS(
            @ApiParam(name = "brid", value = "患者id")
            @RequestParam(value = "brid",defaultValue = "",required = true) String brid) throws Exception {
        return success(tnyyEntranceService.findJKTA_V_ZKSG_HZCX_HIS(brid));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findJKTA_ZY_RECORD)
    @ApiOperation(value = "查询某个患者的住院记录")
    public Envelop findJKTA_ZY_RECORD(
            @ApiParam(name = "brid", value = "患者id")
            @RequestParam(value = "brid",defaultValue = "",required = true) String brid) throws Exception {
        return success(tnyyEntranceService.findJKTA_ZY_RECORD(brid));
    }
}

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

@ -869,7 +869,7 @@ spring:
  profiles: tnJwprod
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://10.9.1.247:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://10.9.1.247:3310/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: qY#j2n5O
#  elasticsearch: