wsl 2 gadi atpakaļ
vecāks
revīzija
e9a7887d17

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

@ -1900,7 +1900,7 @@ ADD COLUMN `status` tinyint(1) NULL DEFAULT 1 COMMENT '1可用,0禁用' AFTER
CREATE TABLE `base_pushrecord_log` (
  `id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `content` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '发送内容',
  `pushType` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '推送类型1立即发送 2 定时发送',
  `push_type` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '推送类型1立即发送 2 定时发送',
  `send_time` datetime DEFAULT NULL COMMENT '发送时间',
  `num` int(10) DEFAULT NULL COMMENT '发送人数',
  `status` tinyint(2) DEFAULT NULL COMMENT '状态(1已发送,0待发送)',

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/log/BasePushRecordLogEntity.java

@ -54,6 +54,7 @@ public class BasePushRecordLogEntity extends UuidIdentityEntity {
        this.content = content;
    }
    @Column(name = "push_type")
    public String getPushType() {
        return pushType;
    }

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/SvrBaseApplication.java

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
@ -36,6 +37,7 @@ public class SvrBaseApplication extends SpringBootServletInitializer {
        return factory.createMultipartConfig();
    }
    @LoadBalanced//为RestTemplate Bean添加了一个LoadBalancerInterceptor拦截器。可以将请求的地址中的服务逻辑名转为具体的服务地址
    @Bean//将RestTemplate注册到容器
    public RestTemplate RestTemplate(){
        return new RestTemplate();

+ 11 - 8
svr/svr-base/src/main/java/com/yihu/jw/base/service/ManageMessagePush/ManageSystemPushMessageService.java

@ -79,7 +79,7 @@ public class ManageSystemPushMessageService {
    public void addPushMessage(String content, Integer pushObjectType, String pushObjectJson, Integer pushDateType, String pushDate) {
        BasePushRecordLogEntity basePushRecordLogEntity = new BasePushRecordLogEntity();
        List<BasePatientDO> basePatientDOS = null;
        List<BasePushrecordLogInfoEntity> basePushrecordLogInfoEntityList = null;
        List<BasePushrecordLogInfoEntity> basePushrecordLogInfoEntityList = new ArrayList<>();
        Date date =DateUtil.strToDate(pushDate);
@ -128,8 +128,11 @@ public class ManageSystemPushMessageService {
        basePushRecordLogEntity.setMessageType(1);
        basePushRecordLogDao.save(basePushRecordLogEntity);
        if (basePushrecordLogInfoEntityList.size()>0) {
        if (null!=basePushrecordLogInfoEntityList&&basePushrecordLogInfoEntityList.size()>0) {
            basePushrecordLogInfoEntityList.forEach(basePushLogInfoEntity -> basePushLogInfoEntity.setPushId(basePushRecordLogEntity.getId()));
            basePushrecordLogInfoDao.save(basePushrecordLogInfoEntityList);
        }
    }
@ -159,7 +162,7 @@ public class ManageSystemPushMessageService {
            sql +=" and  send_object like '%"+name+"%'";
        }
        sql += " LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        sql += " ORDER BY send_time DESC  LIMIT  " + (page - 1) * pageSize + "," + pageSize + "";
        List<BasePushRecordLogEntity> entityList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePushRecordLogEntity.class));
        return entityList;
@ -176,8 +179,8 @@ public class ManageSystemPushMessageService {
        List<SystemMessageDO> messageDOS = new ArrayList<>();
        for (BasePatientDO basePatientDO : basePatientDOS) {
            String data = content;
            if (StringUtils.containsIgnoreCase(content,"【姓名】"))data.replace("【姓名】",basePatientDO.getName());
            if (StringUtils.containsIgnoreCase(content,"【称谓】"))data.replace("【称谓】",basePatientDO.getSex()==1?"大爷":"大妈");
            if (StringUtils.containsIgnoreCase(content,"【姓名】"))data = data.replace("【姓名】",basePatientDO.getName());
            if (StringUtils.containsIgnoreCase(content,"【称谓】"))data = data.replace("【称谓】",basePatientDO.getSex()==1?"大爷":"大妈");
            SystemMessageDO systemMessageDO = new SystemMessageDO();
            systemMessageDO.setId(UUID.randomUUID().toString().replace("-", ""));
@ -188,7 +191,7 @@ public class ManageSystemPushMessageService {
            systemMessageDO.setSenderName("系统推送助手");
            systemMessageDO.setReceiver(basePatientDO.getId());
            systemMessageDO.setReceiverName(basePatientDO.getName());
            systemMessageDO.setData(content);
            systemMessageDO.setContent(data);
            systemMessageDO.setOver("1");
            systemMessageDO.setDel("1");
            systemMessageDO.setCreateTime(new Date());
@ -219,8 +222,8 @@ public class ManageSystemPushMessageService {
    }
    public String audioUrl(String content){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://svr-cloud-care:10301/common/open/wordToVoice?text={1}", String.class, content);
    private String audioUrl(String content){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://svr-cloud-care/common/open/wordToVoice?text={1}", String.class, content);
        JSONObject jsonObject = JSONObject.parseObject(forEntity.getBody());
        if (jsonObject.getInteger("status") == 200){
            return jsonObject.getString("message");

+ 4 - 0
svr/svr-cloud-device/pom.xml

@ -169,6 +169,10 @@
            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-commons</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 2 - 0
svr/svr-cloud-device/src/main/java/com/yihu/SvrCloudDeviceApplication.java

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;
@ -30,6 +31,7 @@ public class SvrCloudDeviceApplication extends SpringBootServletInitializer {
        return builder.sources(SvrCloudDeviceApplication.class);
    }
    @LoadBalanced//为RestTemplate Bean添加了一个LoadBalancerInterceptor拦截器。可以将请求的地址中的服务逻辑名转为具体的服务地址
    @Bean//将RestTemplate注册到容器
    public RestTemplate RestTemplate(){
        return new RestTemplate();

+ 1 - 1
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/service/DeviceUploadService.java

@ -180,7 +180,7 @@ public class DeviceUploadService {
                        messageDO.setReceiverName(patientDO.getName());
                        messageDO.setOver("1");
                        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://svr-cloud-care:10301/common/open/wordToVoice?text={1}", String.class, typeName);
                        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://172.26.0.107:10301/common/open/wordToVoice?text={1}", String.class, typeName);
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(forEntity.getBody());
                        if (jsonObject.getInteger("status") == 200) {
                            messageDO.setAudioUrl(jsonObject.getString("message"));

+ 4 - 0
svr/svr-cloud-job/pom.xml

@ -146,6 +146,10 @@
            <version>2.0.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-commons</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 2 - 0
svr/svr-cloud-job/src/main/java/com/yihu/CloudApplicationJob.java

@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
@ -26,6 +27,7 @@ public class CloudApplicationJob extends SpringBootServletInitializer {
        return builder.sources(CloudApplicationJob.class);
    }
    @LoadBalanced//为RestTemplate Bean添加了一个LoadBalancerInterceptor拦截器。可以将请求的地址中的服务逻辑名转为具体的服务地址
    @Bean//将RestTemplate注册到容器
    public RestTemplate RestTemplate(){
        return new RestTemplate();

+ 1 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/DeviceLostMessageUtil.java

@ -508,7 +508,7 @@ public class DeviceLostMessageUtil {
    }
    public String audioUrl(String content){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://svr-cloud-care:10301/common/open/wordToVoice?text={1}", String.class, content);
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://172.26.0.107:10301/common/open/wordToVoice?text={1}", String.class, content);
        JSONObject jsonObject = JSONObject.parseObject(forEntity.getBody());
        if (jsonObject.getInteger("status") == 200){
            return jsonObject.getString("message");