yeshijie 3 年之前
父节点
当前提交
5fcc0de9ec

+ 20 - 0
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -851,4 +851,24 @@ public class ImUtil {
			throw new RuntimeException("获取会话成员!sessionId =" + sessionId);
		}
	}
	/**
	 * 获取在线人数
	 * helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
	 */
	public String getOnlineCountByType(String type) {
		String url = im_host + "api/v2/sessions/getOnlineCountByType?type="+type;
		String ret = HttpClientUtil.get(url, "UTF-8");
		return ret;
	}
	/**
	 * 获取在线人数列表
	 * helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
	 */
	public String getOnlineListByType(String type) {
		String url = im_host + "api/v2/sessions/getOnlineListByType?type="+type;
		String ret = HttpClientUtil.get(url, "UTF-8");
		return ret;
	}
}

+ 1 - 0
common/common-entity/sql记录

@ -1099,6 +1099,7 @@ ALTER table base.dm_device modify column need_register varchar(255) DEFAULT NULL
-- 2021-07-19 ysj
ALTER table base.base_patient add column pad_imei varchar(50) DEFAULT NULL COMMENT '平板imei';
ALTER table base.base_patient add column residential_area varchar(50) DEFAULT NULL COMMENT '居住小区';
CREATE TABLE `base_getui_client` (
  `id` varchar(50) NOT NULL,
  `user` varchar(50) DEFAULT NULL COMMENT '居民或医生code',

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -281,6 +281,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String latLon;//定位经纬度
    private String padImei;//绑定平板标志
    private String residentialArea;//居住小区
    public String getCardType() {
        return cardType;
@ -859,4 +860,13 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    public void setPadImei(String padImei) {
        this.padImei = padImei;
    }
    @Column(name = "residential_area")
    public String getResidentialArea() {
        return residentialArea;
    }
    public void setResidentialArea(String residentialArea) {
        this.residentialArea = residentialArea;
    }
}

+ 3 - 3
svr/svr-base/src/main/resources/application.yml

@ -172,7 +172,7 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: hz_yyyzh_wx
  url: https://zhyzh.hzxc.gov.cn/
  url: https://zhyzh.gongshu.gov.cn/
  flag: false
pay:
  flag: false
@ -632,7 +632,7 @@ wlyy:
  url: 1
wechat:
  id: hz_yyyzh_wx
  url: https://zhyzh.hzxc.gov.cn/
  url: https://zhyzh.gongshu.gov.cn/
  flag: false
pay:
  flag: false
@ -680,7 +680,7 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: hz_yyyzh_wx
  url: https://zhyzh.hzxc.gov.cn/
  url: https://zhyzh.gongshu.gov.cn/
  flag: false
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:

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

@ -61,4 +61,16 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "platformPeople")
    @ApiOperation(value = "平台人员实时统计")
    public ObjEnvelop platformPeople() {
        try {
            JSONObject result = statisticsService.platformPeople();
            return success(result);
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
}

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

@ -13,7 +13,6 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.entity.patient.Patient;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
import com.yihu.jw.restmodel.ResponseContant;
@ -194,6 +193,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        patientBrief.setArchiveType(patientDetail.getArchiveType());
        patientBrief.setSsc(patientDetail.getSsc());
        patientBrief.setMedicareNumber(patientDetail.getMedicareNumber());
        patientBrief.setResidentialArea(patientDetail.getResidentialArea());
        if (StringUtils.isNotBlank(patientDetail.getMobile())){
            patientBrief.setMobile(patientDetail.getMobile());
        }

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/pay/PayService.java

@ -602,7 +602,7 @@ public class PayService {
        reqMap.put("mch_id", mchId);
        reqMap.put("nonce_str", noceStr);
        // 此路径是微信服务器调用支付结果通知路径
        reqMap.put("notify_url", "https://zhyzh.hzxc.gov.cn/cloudCare/pay/open/wxPayNotify");
        reqMap.put("notify_url", "https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify");
        reqMap.put("out_trade_no", businessOrderDO.getOrderNo());
        reqMap.put("spbill_create_ip", IpUtil.getOneIpAddress(request));
        reqMap.put("product_id", businessOrderDO.getOrderNo());
@ -682,7 +682,7 @@ public class PayService {
        reqMap.put("mch_id", mchId);
        reqMap.put("nonce_str", noceStr);
        // 此路径是微信服务器调用支付结果通知路径
        reqMap.put("notify_url", "https://zhyzh.hzxc.gov.cn/cloudCare/pay/open/wxPayNotify");
        reqMap.put("notify_url", "https://zhyzh.gongshu.gov.cn/cloudCare/pay/open/wxPayNotify");
        reqMap.put("out_trade_no", businessOrderDO.getOrderNo());
        reqMap.put("spbill_create_ip", IpUtil.getOneIpAddress(request));
        reqMap.put("product_id", businessOrderDO.getOrderNo());

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

@ -1,5 +1,6 @@
package com.yihu.jw.care.service.statistics;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.util.ConstantUtil;
@ -9,6 +10,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.es.util.SaveModel;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.collections.map.HashedMap;
@ -45,6 +47,8 @@ public class StatisticsService {
    private BaseOrgDao orgDao;
    @Autowired
    private StatisticsUtilService statisticsUtilService;
    @Autowired
    private ImUtil imUtil;
    private static final String defalutArea = "330100";
@ -156,6 +160,100 @@ public class StatisticsService {
        return json;
    }
    /**
     * 平台人员实时统计
     */
    public JSONObject platformPeople(){
        JSONObject result = new JSONObject();
        Integer olderTotal = 0;
        Integer childTotal = 0;
        Integer helperTotal = 0;
        Integer teacherTotal = 0;
        //老人 儿童注册人数
        String sql1 = "SELECT COUNT(*) c,archive_type from base_patient WHERE archive_type is  not null and del='1' GROUP BY archive_type";
        List<Map<String,Object>> list1 = jdbcTemplate.queryForList(sql1);
        for(Map<String,Object> map:list1){
            String archive_type = map.get("archive_type").toString();
            Integer num = Integer.valueOf(map.get("c").toString());
            if("1".equals(archive_type)){
                olderTotal = num;
                continue;
            }
            if("2".equals(archive_type)){
                childTotal = num;
            }
        }
        //助老员和教师注册人数
        String sql2 = "SELECT COUNT(a.id) c,a.doctor_level from base_doctor a,base_doctor_hospital h where a.id=h.doctor_code and a.del = '1' and h.del = '1' " +
                "and a.doctor_level is not null and h.org_code not in ( " +
                "SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org'  " +
                ") GROUP BY a.doctor_level";
        List<Map<String,Object>> list2 = jdbcTemplate.queryForList(sql2);
        for(Map<String,Object> map:list2){
            String archive_type = map.get("doctor_level").toString();
            Integer num = Integer.valueOf(map.get("c").toString());
            if("2".equals(archive_type)){
                helperTotal = num;
                continue;
            }
            if("3".equals(archive_type)){
                teacherTotal = num;
            }
        }
        //helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
        String onlineCount = imUtil.getOnlineCountByType("");
        JSONObject jsonObject = JSON.parseObject(onlineCount).getJSONObject("data");
        //olderPad":0,"olderWx":0,"child":0,"teacher":0,"helper":0
        Integer helperOn = jsonObject.getInteger("helper");
        Integer teacherOn = jsonObject.getInteger("teacher");
        Integer childOn = jsonObject.getInteger("child");
        Integer olderWxOn = jsonObject.getInteger("olderWx");
        Integer olderPadOn = jsonObject.getInteger("olderPad");
        int repeatNum = 0;
        if(olderWxOn>0&&olderPadOn>0){
            //2个都大于0 要计算重复的人数
            String onlineOlderWx = imUtil.getOnlineListByType("olderWx");
            JSONObject olderWx = JSON.parseObject(onlineOlderWx);
            List<String> list = new ArrayList(olderWx.size());
            olderWx.entrySet().stream().forEach(one->{
                list.add(one.getKey());
            });
            String onlineOlderPad = imUtil.getOnlineListByType("olderPad");
            JSONObject olderPad = JSON.parseObject(onlineOlderPad);
            for (Map.Entry<String,Object> s:olderPad.entrySet()){
                if(list.contains(s.getKey())){
                    repeatNum++;
                }
            }
        }
        Integer olderOff = olderTotal - olderWxOn - olderPadOn + repeatNum;
        olderOff = olderOff>0?olderOff:0;
        Integer childOff = childTotal - childOn;
        Integer helperOff = helperTotal - helperOn;
        Integer teacherOff = teacherTotal - teacherOn;
        result.put("olderTotal",olderTotal);
        result.put("childTotal",childTotal);
        result.put("helperTotal",helperTotal);
        result.put("teacherTotal",teacherTotal);
        result.put("helperOn",helperOn);
        result.put("teacherOn",teacherOn);
        result.put("childOn",childOn);
        result.put("olderWxOn",olderWxOn);
        result.put("olderPadOn",olderPadOn);
        result.put("childOff",childOff);
        result.put("helperOff",helperOff);
        result.put("teacherOff",teacherOff);
        result.put("olderOff",olderOff);
        return result;
    }
    /**
     * 统计总数
     * @param endDate

+ 6 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/wechat/WeiXinEventProcess.java

@ -144,36 +144,36 @@ public class WeiXinEventProcess {
    public void setUrlItems(List<Map<String, String>> articles) {
        Map<String, String> articleBooking = new HashMap<>();
        // 图文URL
        String urlBooking = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fmedical-care-patient%2Fhome%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        String urlBooking = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fmedical-care-patient%2Fhome%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        urlBooking = urlBooking.replace("{appId}", appId);
        articleBooking.put("Url", urlBooking);
        articleBooking.put("Title", "你好啊,欢迎来到朝晖云照护!");
        articleBooking.put("Description", "这里是智慧养老和健康管理服务社区+幼儿成长教育服务平台\n" +
                "我们陪你一起,关爱老人,呵护孩子!\n" +
                "感谢关注,点击下方菜单直接进入朝晖云照护平台");
        articleBooking.put("PicUrl", "https://zhyzh.hzxc.gov.cn/image/index.png");
        articleBooking.put("PicUrl", "https://zhyzh.gongshu.gov.cn/image/index.png");
        articles.add(articleBooking);
        Map<String, String> articleDevice = new HashMap<>();
        // 图文URL
        String urlDevice = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fmedical-care-patient%2FonlineRegistration%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        String urlDevice = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fmedical-care-patient%2FonlineRegistration%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        urlDevice = urlDevice.replace("{appId}", appId);
        articleDevice.put("Url", urlDevice);
        articleDevice.put("Title", "在线入园");
        articleDevice.put("Description", "申请专业托育机构入园资格");
        articleDevice.put("PicUrl", "https://zhyzh.hzxc.gov.cn/image/doorCoach.png");
        articleDevice.put("PicUrl", "https://zhyzh.gongshu.gov.cn/image/doorCoach.png");
        articles.add(articleDevice);
        Map<String, String> articleFamily = new HashMap<>();
        // 图文URL
        String urlFamily = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fmedical-care-patient%2FlifeCare%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        String urlFamily = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri=https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fmedical-care-patient%2FlifeCare%2Findex&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect";
        urlFamily = urlFamily.replace("{appId}", appId);
        articleFamily.put("Url", urlFamily);
        articleFamily.put("Title", "上门预约");
        articleFamily.put("Description", "预约幼儿教育专家上门育儿指导");
        articleFamily.put("PicUrl", "https://zhyzh.hzxc.gov.cn/image/online.png");
        articleFamily.put("PicUrl", "https://zhyzh.gongshu.gov.cn/image/online.png");
        articles.add(articleFamily);
    }

+ 3 - 3
svr/svr-cloud-care/src/main/resources/application.yml

@ -429,7 +429,7 @@ spring:
    port: 6379  # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: https://zhyzh.hzxc.gov.cn/fastdfs/
  fastdfs_file_url: https://zhyzh.gongshu.gov.cn/fastdfs/
fast-dfs:
  tracker-server: 10.18.43.40:22122 #服务器地址
# 短信验证码发送的客户端标识,居民端
@ -455,7 +455,7 @@ wechat:
  apiKey: zhongjianxinlianxiamenkejiyouxia
  mchId: 1611059985
  wechat_token: 27eb3bb24f149a7760cf1bb154b08041
  wechat_base_url: https%3A%2F%2Fzhyzh.hzxc.gov.cn%2FcloudCare%2F
  wechat_base_url: https%3A%2F%2Fzhyzh.gongshu.gov.cn%2FcloudCare%2F
  accId: gh_da06ed9e5751
  id: hz_yyyzh_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
@ -511,4 +511,4 @@ base:
  hospitalUrl: http://127.0.0.7:10022/
cloudCare:
  deviceUrl: https://zhyzh.hzxc.gov.cn/device/
  deviceUrl: https://zhyzh.gongshu.gov.cn/device/

+ 1 - 1
svr/svr-cloud-care/src/main/resources/wechat/weixin_menu.txt

@ -3,7 +3,7 @@
   {
	  "name":"进入云照护",
	  "type":"view",
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx2c55f5b7b2f3cb56&redirect_uri=https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fmedical-care-patient%2Fhome%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx2c55f5b7b2f3cb56&redirect_uri=https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fmedical-care-patient%2Fhome%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   }
]
}

+ 2 - 2
svr/svr-cloud-job/src/main/resources/application.yml

@ -138,7 +138,7 @@ wechat:
  appId: wx2c55f5b7b2f3cb56
  appSecret: 0dd9927e58125ad5f0efb9299860d145
  wechat_token: 27eb3bb24f149a7760cf1bb154b08041
  wechat_base_url: https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fcityihealth%2FcloudCare%2F
  wechat_base_url: https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fcityihealth%2FcloudCare%2F
  accId: gh_da06ed9e5751
  id: hz_yyyzh_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
@ -196,7 +196,7 @@ wechat:
  appId: wx2c55f5b7b2f3cb56
  appSecret: 0dd9927e58125ad5f0efb9299860d145
  wechat_token: 27eb3bb24f149a7760cf1bb154b08041
  wechat_base_url: https%3A%2F%2Fzhyzh.hzxc.gov.cn%2Fcityihealth%2FcloudCare%2F
  wechat_base_url: https%3A%2F%2Fzhyzh.gongshu.gov.cn%2Fcityihealth%2FcloudCare%2F
  accId: gh_da06ed9e5751
  id: hz_yyyzh_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle