Browse Source

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

wangzhinan 3 years ago
parent
commit
d36c9160c7

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

@ -13,13 +13,16 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.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.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
@ -32,12 +35,17 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionEmrDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.WebserviceUtil;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.PwdUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.domain.ext.RefundResult;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
@ -99,7 +107,7 @@ public class EntranceService {
    private static String BS16018 = "BS16018";
    //his退费接口
    private static String BS15021 = "BS15021";
    private static String BS15051 = "BS15051";
    //查询待扣费处方信息
    private static String BS15036 = "BS15036";
@ -147,6 +155,10 @@ public class EntranceService {
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private BusinessOrderDao businessOrderDao;
    @Autowired
    private BasePatientMedicareCardDao basePatientMedicareCardDao;
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
@ -1420,11 +1432,11 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray BS15021(String userId, String userName, String cardType, String cardNo, String accountType,String idNo,
    public JSONArray BS15051(String userId, String userName, String cardType, String cardNo, String accountType,String idNo,
                             String withdrawMode,String depositType,String ServiceType,String amount,String outRefundNo,
                             String outChargeNo,String origTraceNo,String traceSerial,String paydate,String notes,String tradeState,
                             String failReason,String failTime,String extra, boolean demoFlag) throws Exception {
        String fid = BS15021;
        String fid = BS15051;
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
@ -1502,7 +1514,7 @@ public class EntranceService {
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setRequest(sbs.toString());
            wlyyHttpLogDO.setResponse(resp);
            wlyyHttpLogDO.setCode(BS15021);
            wlyyHttpLogDO.setCode(BS15051);
            wlyyHttpLogDO.setName("预交金退款");
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
@ -1510,6 +1522,144 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 门诊预缴金退费接口
     *
     * @param outPatientId 门诊表id
     * @return
     * @throws Exception
     */
    public String hisRefund(String outPatientId) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId);
        if (outpatientDO == null){
            return "门诊信息表为空";
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        if (businessOrderDO == null){
            return "订单表为空";
        }
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(outpatientDO.getCardNo());
        if (patientMedicareCardDO == null){
            return "患者卡包为空";
        }
        String userId = outpatientDO.getPatient();
        String userName = outpatientDO.getPatientName();
        String idNo = outpatientDO.getIdcard();
        String cardType = "03";
        if ("A_01".equals(patientMedicareCardDO.getType())){
            cardType = "01";
        }
        String cardNo =outpatientDO.getCardNo();
        String accountType = "01";
        String withdrawMode = "";
        String depositType = "";
        if (businessOrderDO.getPayType()==3){
            depositType = "WX_PUB";
        }
        String ServiceType = "04";
        String outChargeNo = "";
        String traceSerial = "";
        String tradeState="";
        String paydate ="";
        String notes = "";
        String failReason = "";
        String failTime = "";
        String extra = "";
        boolean demoFlag = false;
        String amount = businessOrderDO.getPayPrice().toString();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
        String outRefundNo = uuid;
        String origTraceNo = businessOrderDO.getTraceNo();
        //调用his退费接口
        JSONArray jsonArray = BS15051(userId, userName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        YlzPayService ylzPayService = new YlzPayService();
        //调用易联众预缴金退款接口
        String refund = ylzPayService.refund(userId, userName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, withdrawMode, traceSerial, outRefundNo,cardNo);
        JSONObject jsonObject = JSONObject.parseObject(refund);
        //获取调用易联众退费接口交易状态
        String respCode = jsonObject.getString("respCode");
        if (respCode.equals("000000")){
            tradeState = "succ";
        }else {
            tradeState = "fail";
        }
        JSONArray resp = BS15051(userId, userName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        String result = resp.toString();
        return result;
    }
    /**
     * 门诊预缴金退费接口(系统自动退费)
     *
     * @param outPatientId 门诊表id
     * @return
     * @throws Exception
     */
    public String autoRefund(String outPatientId) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId);
        if (outpatientDO == null){
            return "门诊信息表为空";
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        if (businessOrderDO == null){
            return "订单表为空";
        }
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(outpatientDO.getCardNo());
        if (patientMedicareCardDO == null){
            return "患者卡包为空";
        }
        String operatorId = "9690";
        String operatorName = "9690";
        String userName = outpatientDO.getPatientName();
        String idNo = outpatientDO.getIdcard();
        String cardType = "03";
        if ("A_01".equals(patientMedicareCardDO.getType())){
            cardType = "01";
        }
        String cardNo = patientMedicareCardDO.getMedicareNumber();
        String accountType = "01";
        String withdrawMode = "1";
        String depositType = "";
        if (businessOrderDO.getPayType()==3){
            depositType = "WX_PUB";
        }
        String ServiceType = "04";
        String outChargeNo = "";
        String traceSerial = "";
        String tradeState="";
        String paydate ="";
        String notes = "";
        String failReason = "";
        String failTime = "";
        String extra = "";
        boolean demoFlag = false;
        String amount = businessOrderDO.getPayPrice().toString();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
        String outRefundNo = uuid;
        String origTraceNo = businessOrderDO.getTraceNo();
        //调用his退费接口
        JSONArray jsonArray = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        YlzPayService ylzPayService = new YlzPayService();
        //调用易联众预缴金退款接口
        String refund = ylzPayService.refund(operatorId, operatorName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, withdrawMode, traceSerial, outRefundNo,cardNo);
        JSONObject jsonObject = JSONObject.parseObject(refund);
        //获取调用易联众退费接口交易状态
        String respCode = jsonObject.getString("respCode");
        if (respCode.equals("000000")){
            tradeState = "succ";
        }else {
            tradeState = "fail";
        }
        JSONArray resp = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        String result = resp.toString();
        return result;
    }
    /**
     * 检查检验
     *

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java

@ -210,7 +210,7 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "findUserByType")
    @ApiOperation(value = "人员实时动态搜索")
    public Envelop findUserByType(@ApiParam(name = "type", value = "类型:1幼儿,2老人,3助老员,4医生。不传返回四个类型的数据")
    public Envelop findUserByType(@ApiParam(name = "type", value = "类型:1幼儿,2老人,3助老员,4医生,5老人家属。不传返回四个类型的数据")
                                  @RequestParam(value = "type", required = false) String type,
                                  @ApiParam(name = "name", value = "姓名")
                                  @RequestParam(value = "name", required = false) String name,

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -241,9 +241,9 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            return result;
        }
        assistanceDO = emergencyAssistanceDao.save(assistanceDO);
        //创建im会话  紧急救助咨询的sessionid  为居民code+(wlyy_consult_team表consult)+20
        //创建im会话  紧急救助咨询的sessionid  为居民code+20
        JSONObject IMObj = consultTeamService.addServiceConsult(assistanceDO.getId(),patient,agent,null);
        String sessionId=patient+"_"+ IMObj.getJSONObject("resultMsg").getString("consult") + "_20";
        String sessionId=patient + "_20";
        assistanceDO.setSessionId(sessionId);
        //向会话中发送一条消息
        ConsultTeamDo consultTeam = consultTeamDao.queryByRelationCode(assistanceDO.getId());

+ 5 - 108
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java

@ -195,7 +195,7 @@ public class ConsultTeamService {
        consultTeam.setConsult(consult.getId()); // 设置咨询标识
        //(im创建咨询) 紧急救助咨询的sessionid为居民code+咨询类型
        String sessionId = patient + "_" + consult.getId() + "_" + consultTeam.getType();
        String sessionId = patient + "_" + consultTeam.getType();
        //4、 紧急救助咨询-参与者
        JSONObject participants = new JSONObject();
@ -313,8 +313,8 @@ public class ConsultTeamService {
        consult.setRelationCode(doorServiceOrderDO.getId());//关联业务code
        consultTeam.setConsult(consult.getId()); // 设置咨询标识
        //(im创建咨询) 上门服务咨询的sessionid为居民code+咨询code+工单编号+咨询类型
        String sessionId = patient + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() +  "_" + consultTeam.getType();
        //(im创建咨询) 上门服务咨询的sessionid为居民code+咨询类型
        String sessionId = patient + "_" + consultTeam.getType();
        //4、 上门服务咨询-参与者
        JSONObject participants = new JSONObject();
@ -411,8 +411,8 @@ public class ConsultTeamService {
        consult.setRelationCode(orderId);//关联业务code
        consultTeam.setConsult(consult.getId()); // 设置咨询标识
        //(im创建咨询) 安防警报咨询的sessionid为居民code+咨询id+咨询类型
        String sessionId = patient + "_" + consult.getId() + "_" + consultTeam.getType();
        //(im创建咨询) 安防警报咨询的sessionid为居民code+咨询类型
        String sessionId = patient + "_" + consultTeam.getType();
        //4、安防警报咨询-参与者  提供服务的助老员 老人本人 家属
        JSONObject participants = new JSONObject();
@ -567,109 +567,6 @@ public class ConsultTeamService {
            throw new RuntimeException(String.valueOf(obj.get("message")));
        }
        //结束咨询才发送推送给IM文字消息
//        if (endType == 1) {
//            BasePatientDO p = patientDao.findOne(endOperator);
//            endName = p.getName();
//            if (consultTeam.getType() == 2 || consultTeam.getType() == 8) {
//                String openId = p.getOpenid();
//
//                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxpj");
//                String first = templateConfig.getFirst();
//                first = first.replace("key1", (endName == null ? "" : endName));
//                String keyword1 = templateConfig.getKeyword1();
//
//                org.json.JSONObject json = new org.json.JSONObject();
//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//                json.put("keyword1", keyword1);
//                json.put("keyword2", sdf.format(new Date()));
//                json.put("toUser", p.getCode());
//                json.put("represented", p.getCode());//被代理人
//                json.put("remark", "");
//                json.put("consult", consult);
//                if (consultTeam.getType() == 8) {
//                    first = first.replace("key2", "续方");
//                } else {
//                    first = first.replace("key2", "");
//                }
//                json.put("first", first);
//                if (StringUtils.isNotBlank(p.getOpenid())) {
//                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
//                } else {
//                    //发送代理人
//                    org.json.JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(), p.getOpenid());
//                    if (jsonArray != null && jsonArray.length() > 0) {
//                        for (int i = 0; i < jsonArray.length(); i++) {
//                            org.json.JSONObject j = jsonArray.getJSONObject(i);
//                            Patient member = (Patient) j.get("member");
//                            org.json.JSONObject data = json;
//                            data.remove("toUser");
//                            data.put("toUser", member.getCode());
//                            data.remove("first");
//                            data.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
//                            pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, member.getOpenid(), p.getName(), data);
//                        }
//                    }
//                }
//            }
//        } else {
//            if (consultTeam.getType() == 2 || consultTeam.getType() == 8) {
//                Patient p = patientDao.findByCode(consultTeam.getPatient());
//                String name = p.getName();
//                String openId = p.getOpenid();
//
//                WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxpj");
//
//                if (endOperator.equals("admin")) {
//                    templateConfig = templateConfigDao.findByScene("template_doctor_survey", "zxcspj");
//                }
//                String first = templateConfig.getFirst();
//                first = first.replace("key1", (name == null ? "" : name));
//                String keyword1 = templateConfig.getKeyword1();
//
//                org.json.JSONObject json = new org.json.JSONObject();
//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//                json.put("keyword1", keyword1);
//                json.put("keyword2", sdf.format(new Date()));
//                json.put("toUser", p.getCode());
//                json.put("represented", p.getCode());//被代理人
//                json.put("remark", "");
//                json.put("consult", consult);
//
//                if (consultTeam.getType() == 8) {
//                    first += "续方";
//                    first = first.replace("key2", "续方");
//                } else {
//                    first = first.replace("key2", "");
//                }
//                /*if (endOperator.equals("admin")) {
//                    first += "咨询超时未回复,系统自动关闭,请及时对咨询医生进行评价。";
//                }else {
//                    first += "咨询已结束,请及时对咨询医生进行评价。";
//                }*/
//                json.put("first", first);
//                if (StringUtils.isNotBlank(p.getOpenid())) {
//                    pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
//                } else {
//                    //发送代理人
//                    org.json.JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(p.getCode(), p.getOpenid());
//                    if (jsonArray != null && jsonArray.length() > 0) {
//                        for (int i = 0; i < jsonArray.length(); i++) {
//                            org.json.JSONObject j = jsonArray.getJSONObject(i);
//                            Patient member = (Patient) j.get("member");
//                            org.json.JSONObject data = json;
//                            data.remove("toUser");
//                            data.put("toUser", member.getCode());
//                            data.remove("first");
//                            data.put("first", weiXinOpenIdUtils.getTitleMes(p, j.getInt("relation"), p.getName()) + first);
//                            pushMsgTask.putWxMsg(accessTokenUtils.getAccessToken(), 17, member.getOpenid(), p.getName(), data);
//                        }
//                    }
//                }
//
//            }
//        }
        consultTeam.setEndMsgId(obj.getString("id"));
        cons.setEndTime(new Date());
        consultTeam.setEndTime(new Date());

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -866,7 +866,7 @@ public class DoctorDoorCoachOrderService {
                "  o.serve_lat as lat, " +
                "  o.`status` as status, " +
                "  o.`dispatcher_name` as dispatcherName, " +
                "  concat( o.patient,'_' ,c.id, '_',o.`number`,'_21' ) as sessionId " +
                "  concat( o.patient,'_21' ) as sessionId " +
                patientTypeTemp +
                " FROM " +
                " ( base_door_coach_order o " +

+ 33 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -558,6 +558,11 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            re.put("helperTotal",findHelperTotal(name,filter));
        }
        if("5".equals(type)||StringUtils.isBlank(type)){//老人家属
            List<Map<String,Object>> list = findOlderFamily(name,limit,filter);
            re.put("oldFamily",list);
            re.put("oldFamilyCount",findOlderFamilyTotal(name,filter));
        }
        return re;
    }
@ -729,7 +734,35 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }
    public List<Map<String,Object>> findOlderFamily(String name,String limit,String fileter){
        String sql = "select t2.id,t2.name,t2.sex,t2.mobile,t2.idcard,if(t2.openid is null,0,1) online,t2.photo,t1.family_relation,t1.patient older,t3.name olderName " +
                "from base_patient t2 left JOIN base_patient_family_member t1 on t1.family_member = t2.id " +
                "left join base_patient t3 on t3.id = t1.patient  " +
                "where t2.archive_type=3 and t2.del=1 ";
        if (StringUtils.isNotBlank(name)){
            sql += " and t3.name like '%"+name+"%'";
        }
        sql += fileter + "GROUP BY t2.id,t1.patient ";
        sql += limit;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object>tmp:list){
            tmp.put("relaholder", familyMemberService.relations.get(tmp.get("family_relation")));
        }
        return list;
    }
    public Integer findOlderFamilyTotal(String name,String fileter){
        String sql = "select t2.id,t1.patient " +
                "from base_patient t2 left JOIN base_patient_family_member t1 on t1.family_member = t2.id " +
                "left join base_patient t3 on t3.id = t1.patient  " +
                "where t2.archive_type=3 and t2.del=1 ";
        if (StringUtils.isNotBlank(name)){
            sql += " and t3.name like '%"+name+"%'";
        }
        sql += fileter +" group by t2.id,t1.patient ";
        String sqlCount = "SELECT count(*) from ( "+sql+")A";
        return jdbcTemplate.queryForObject(sqlCount,Integer.class);
    }
    public void intiPatient(){
        String sql = "SELECT * from base_patient WHERE residential_area is not null and `password` is null";

+ 11 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -243,9 +243,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        orderDO.setType(1);//发起类型
        orderDO.setServiceStatus("2");
        this.save(orderDO);
        //创建im会话  安防警报咨询的sessionid  为居民code+(wlyy_consult_team表consult)+20
        //创建im会话  安防警报咨询的sessionid  为居民code+22
        JSONObject IMObj = consultTeamService.addSecurityMoConsult(orderDO.getId(), orderDO.getPatient(), null, null, orderDO.getServeDesc());
        String sessionId = orderDO.getPatient() + "_" + IMObj.getJSONObject("resultMsg").getString("consult") + "_22";
        String sessionId = orderDO.getPatient() + "_22";
        orderDO.setSessionId(sessionId);
        if (StringUtils.isNotBlank(orderDO.getServeDesc())) {
            ConsultTeamDo consultTeam = consultTeamDao.queryByRelationCode(orderDO.getId());
@ -1736,6 +1736,15 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                            result.put("fences", fencesEnables);
                        }
                    }
                    //手表剩余电量
                    if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
                        result.put("remaining_power", response.get("remaining_power"));
                    }
                    //手表佩戴状态
                    if (response.containsKey("wear_flag") && response.get("wear_flag") != null) {
                        result.put("wear_flag", response.get("wear_flag"));
                        result.put("wear_flagName", 1==response.getInteger("wear_flag")?"未佩戴":"已佩戴");
                    }
                }
            }
            if (devicePatientDeviceDos2.size() > 0 && (16 == categoryCode || 0 == categoryCode)) {//拐杖

+ 30 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.device.PatientDeviceDao;
import com.yihu.jw.care.service.patient.CarePatientService;
import com.yihu.jw.care.util.CommonUtil;
import com.yihu.jw.care.util.ConstantUtil;
import com.yihu.jw.care.vo.NumVo;
@ -91,6 +92,8 @@ public class StatisticsService {
    private String esIndex;
    @Value("${es.type.Statistics}")
    private String esType;
    @Autowired
    private CarePatientService carePatientService;
    private static final String defalutArea = "330100";
@ -652,6 +655,10 @@ public class StatisticsService {
        Integer olderOn = 0;
        Integer olderWxOn = 0;
        Integer olderPadOn = 0;
        Integer olderFamilyTotal = 0;//老人家属
        Integer olderFamilyOn = 0;
        Integer olderFamilyOff = 0;
        Integer olderFamilyBinding = 0;//家属绑定老人数量
        //儿童注册人数
        String childFilter = "";
        String sqlChildtmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older'  ";
@ -729,6 +736,23 @@ public class StatisticsService {
        helperTotal = helperOff + helperOn;
        teacherTotal = teacherOff + teacherOn;
        //老人家属
        sql2 = " select count(id) count,if(openid is null,0,1) online from base_patient where  archive_type=3 and del=1 GROUP BY online; ";
        List<Map<String, Object>> oldFamilyList2 = jdbcTemplate.queryForList(sql2);
        for(Map<String,Object>tmp:oldFamilyList2){
            Integer num = Integer.valueOf(tmp.get("count").toString());
            Integer online = Integer.valueOf(tmp.get("online").toString());
            if (0==online){
                olderFamilyOff+=num;
            }
            if (1==online){
                olderFamilyOn+=num;
            }
        }
        olderFamilyTotal = olderFamilyOff+olderFamilyOn;
        //家属绑定老人数量
        olderFamilyBinding = carePatientService.findOlderFamilyTotal(null,"");
        //helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
        result.put("olderTotal", olderTotal);
        result.put("childTotal", childTotal);
@ -743,6 +767,12 @@ public class StatisticsService {
        result.put("helperOff", helperOff);
        result.put("teacherOff", teacherOff);
        result.put("olderOff", olderOff);
        //老人家属
        result.put("olderFamilyTotal", olderFamilyTotal);
        result.put("olderFamilyOn", olderFamilyOn);
        result.put("olderFamilyOff", olderFamilyOff);
        result.put("olderFamilyBinding", olderFamilyBinding);
        return result;
    }

+ 1 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/order/EmeWarnOrderDayJob.java

@ -95,7 +95,7 @@ public class EmeWarnOrderDayJob implements Job {
                    }else {
                        message = new JSONObject();
                        String sessionId = map.get("patient")+"_"+ map.get("consult") + "_22";
                        String sessionId = map.get("patient") + "_22";
                        message.put("session_id",sessionId);
                        message.put("sender_name",map.get("patientName"));
                        message.put("content_notice",map.get("patientName")+" "+map.get("serverDesc")+"!");

+ 1 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/order/EmeWarnOrderJob.java

@ -97,7 +97,7 @@ public class EmeWarnOrderJob implements Job {
                    }else {
                        message = new JSONObject();
                        String sessionId = map.get("patient")+"_"+ map.get("consult") + "_22";
                        String sessionId = map.get("patient") + "_22";
                        message.put("session_id",sessionId);
                        message.put("sender_name",map.get("patientName"));
                        message.put("content_notice",map.get("patientName")+" "+map.get("serverDesc")+"!");

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

@ -1183,6 +1183,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                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, "取消问诊(用户)");
                    String refund = entranceService.hisRefund(outPatientId);
                }
            } catch (Exception e) {