wsl 2 yıl önce
ebeveyn
işleme
c583213ca0

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

@ -1962,4 +1962,32 @@ CREATE TABLE `base_child_manage` (
  `del` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1可用,0禁用',
  `click` int(5) DEFAULT '0' COMMENT '视频点击播放量',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幼儿管理\r\n';
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='幼儿管理\r\n';
-- 2022-07-27 wsl
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('pushOnOff7', NULL, 'pushOnOff', '7', '天气预报', 'true', 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('pushOnOff8', NULL, 'pushOnOff', '8', '整点报时', 'true', 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('pushMessageType7', NULL, 'pushMessageType', '7', '天气预报', NULL, 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('pushMessageType8', NULL, 'pushMessageType', '8', '整点报时', NULL, 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe1', NULL, 'padMessageSubscribe', '1', '时间整点报时', 'false', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe2', NULL, 'padMessageSubscribe', '2', '智能安居设备状态播报(必选)', 'false', 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe3', NULL, 'padMessageSubscribe', '3', '体征测量消息', 'false', 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe4', NULL, 'padMessageSubscribe', '4', '用药提醒', 'false', 4, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe5', NULL, 'padMessageSubscribe', '5', '天气预报', 'false', 5, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe6', NULL, 'padMessageSubscribe', '6', '服务预约提醒', 'false', 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe7', NULL, 'padMessageSubscribe', '7', '生日祝福提醒', 'false', 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `base`.`wlyy_hospital_sys_dict`(`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('padMessageSubscribe8', NULL, 'padMessageSubscribe', '8', '热点新闻播报', 'false', 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CREATE TABLE `base_patient_pad_pushonoff` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `patient` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '居民code',
  `type` int(3) DEFAULT NULL COMMENT '推送类型 ',
  `type_name` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '推送类型名字 ',
  `on_off` int(1) DEFAULT NULL COMMENT '开关状态 0 关 1开',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='居民pad推送开关';

+ 72 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/log/BasePatientPadPushOnOffEntity.java

@ -0,0 +1,72 @@
package com.yihu.jw.entity.log;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by wsl on 2022/7/28
 */
@Entity
@Table(name = "base_patient_pad_pushonoff")
public class BasePatientPadPushOnOffEntity extends IdEntity {
    private String patient;  //居民code
    private Integer type;  //推送类型
    private String typeName;  //推送类型名字
    private Integer onOff;  //开关状态 0 关 1开
    private Date createTime;  //创建时间
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "type_name")
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "on_off")
    public Integer getOnOff() {
        return onOff;
    }
    public void setOnOff(Integer onOff) {
        this.onOff = onOff;
    }
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/log/BasePatientPadPushOnOffDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.base.dao.log;
import com.yihu.jw.entity.log.BasePatientPadPushOnOffEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by wsl on 2022/7/28
 */
public interface BasePatientPadPushOnOffDao extends PagingAndSortingRepository<BasePatientPadPushOnOffEntity, String>, JpaSpecificationExecutor<BasePatientPadPushOnOffEntity> {
}

+ 13 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/ManageMessagePush/ManageSystemPushMessageController.java

@ -116,5 +116,18 @@ public class ManageSystemPushMessageController extends EnvelopRestEndpoint {
    }
    @ApiOperation("初始化居民推送开关")
    @PostMapping(value = "/patientPushOnOff")
    public Envelop patientPushOnOff(){
        try {
            mspmservice.patientPushOnOff();
            return success("成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return failed("初始化失败!",500);
        }
    }
}

+ 66 - 7
svr/svr-base/src/main/java/com/yihu/jw/base/service/ManageMessagePush/ManageSystemPushMessageService.java

@ -1,12 +1,15 @@
package com.yihu.jw.base.service.ManageMessagePush;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yihu.jw.base.dao.log.BasePatientPadPushOnOffDao;
import com.yihu.jw.base.dao.log.BasePushRecordLogDao;
import com.yihu.jw.base.dao.log.BasePushrecordLogInfoDao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.log.BasePatientPadPushOnOffEntity;
import com.yihu.jw.entity.log.BasePushRecordLogEntity;
import com.yihu.jw.entity.log.BasePushrecordLogInfoEntity;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -44,6 +47,8 @@ public class ManageSystemPushMessageService {
    @Autowired
    private BasePushrecordLogInfoDao basePushrecordLogInfoDao;
    @Autowired
    private BasePatientPadPushOnOffDao basePatientPadPushOnOffDao;
    @Autowired
    private WlyyHospitalSysDictDao dictDao;
    @Autowired
    private RestTemplate restTemplate;
@ -209,6 +214,66 @@ public class ManageSystemPushMessageService {
        basePushRecordLogDao.delete(id);
    }
    //初始化居民推送开关
    @Transactional(rollbackFor = Exception.class)
    public String patientPushOnOff(){
        JSONObject jsonObject = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        jsonObject.put("1","时间整点报时");
        jsonArray.add(jsonObject);
        jsonObject.put("2","智能安居设备状态播报(必选)");
        jsonArray.add(jsonObject);
        jsonObject.put("3","体征测量消息");
        jsonArray.add(jsonObject);
        jsonObject.put("4","用药提醒");
        jsonArray.add(jsonObject);
        jsonObject.put("5","天气预报");
        jsonArray.add(jsonObject);
        jsonObject.put("6","服务预约提醒");
        jsonArray.add(jsonObject);
        jsonObject.put("7","生日祝福提醒");
        jsonArray.add(jsonObject);
        jsonObject.put("8","热点新闻播报");
        jsonArray.add(jsonObject);
        String sql = "SELECT p.id FROM  base_patient p WHERE  p.sign_status = 1 AND p.del = 1  ";
        List<String> patientList = jdbcTemplate.queryForList(sql, String.class);
        List<BasePatientPadPushOnOffEntity> onOffEntityList = new ArrayList<>();
        patientList.forEach(patientId -> {
            for (int i = 1; i <= jsonArray.size(); i++) {
                BasePatientPadPushOnOffEntity onOffEntity = new BasePatientPadPushOnOffEntity();
                onOffEntity.setPatient(patientId);
                onOffEntity.setType(i);
                onOffEntity.setTypeName(jsonArray.getJSONObject(0).getString(i+""));
                onOffEntity.setOnOff(0);
                onOffEntity.setCreateTime(new Date());
                onOffEntityList.add(onOffEntity);
            }
        });
        
        basePatientPadPushOnOffDao.save(onOffEntityList);
        return null;
    }
    //推送开关修改
    public void pushOnOff(String id,String dictName,String pyCode) {
        dictDao.updatePyCode(pyCode,id,dictName);
    }
    private void SystemMessageDOListSave(List<BasePatientDO> basePatientDOS,String content){
        List<SystemMessageDO> messageDOS = new ArrayList<>();
        for (BasePatientDO basePatientDO : basePatientDOS) {
@ -238,6 +303,7 @@ public class ManageSystemPushMessageService {
    }
    //处理名字
    private String  nameStringHandle(List<BasePatientDO> basePatientDOS){
        String names = "";
@ -250,13 +316,6 @@ public class ManageSystemPushMessageService {
    }
    //推送开关修改
    public void pushOnOff(String id,String dictName,String pyCode) {
        dictDao.updatePyCode(pyCode,id,dictName);
    }
    //腾讯语音
    private String audioUrl(String content){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://svr-cloud-care/common/open/wordToVoice?text={1}", String.class, content);

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/PatientMessageService.java

@ -1,5 +1,6 @@
package com.yihu.jw.care.service.message;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.device.PatientSafeAreaConfirmDao;
import com.yihu.jw.care.dao.device.PatientSafeAreaDao;
@ -229,4 +230,20 @@ public class PatientMessageService {
        result.put(ResponseContant.resultMsg,"已确认");
        return result;
    }
    //pad端 获取居民推送开关
    public JSONArray patientPadPushOnOff(String patient){
        JSONArray result = new JSONArray();
        String sql = "select * from base_patient_pad_pushonoff where patient ='"+patient+"'";
        
        return result;
    }
}

+ 26 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/pushRecord/PushTimeIntegerPointJob.java

@ -0,0 +1,26 @@
package com.yihu.jw.care.job.pushRecord;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * Created by wsl on 2022/7/28
 */
public class PushTimeIntegerPointJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(PushTimeIntegerPointJob.class);
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
    }
}

+ 22 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/pushRecord/PushWeatherForecastJob.java

@ -0,0 +1,22 @@
package com.yihu.jw.care.job.pushRecord;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * Created by wsl on 2022/7/28
 */
public class PushWeatherForecastJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(PushWeatherForecastJob.class);
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
    }
}

+ 4 - 0
svr/svr-cloud-job/src/main/resources/system.properties

@ -46,3 +46,7 @@ PUSH_DEVICE_OFF_LONE_JOB= 0 30 9 * * ?
DEVICE_WATCH_OFF_WEAR_JOB= 0 0 11 * * ?
#\u624B\u8868\u7535\u91CF\u4F4E  \u6BCF\u4E00\u4E2A\u5C0F\u65F6\u83B7\u53D6\u4E00\u6B21 \u7535\u91CF
DEVICE_WATCH_REMAINING_POWER_JOB= 0 0 0/1 * * ?
#\u65F6\u95F4\u6574\u70B9\u62A5\u65F6\uFF1A\u65E9\u4E0A10\u70B9\u5230\u4E0B\u534818\u70B9\u8FDB\u884C\u51C6\u70B9\u64AD\u62A5
PUSH_MASSAGE_TIME_INTEGER_POINT= 0 10,11,12,13,14,15,16,17,18 * * ?
#\u5929\u6C14\u9884\u62A5\uFF1A\u6BCF\u5929\u65E9\u4E0A11\u70B9\u64AD\u62A5
PUSH_MESSAGE_WEATHER_FORECAST= 0 0 11 * * ?