吴世龙 3 years ago
parent
commit
75d56a0a4d

+ 10 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/event/ApplicationEvent.java

@ -3,6 +3,7 @@ package com.yihu.jw.care.event;
import com.yihu.jw.care.job.BirthdayReminderJob;
import com.yihu.jw.care.job.QuartzHelper;
import com.yihu.jw.care.job.consult.FinishConsultJob;
import com.yihu.jw.care.job.data.SaveDataPushJob;
import com.yihu.jw.care.job.device.DeviceLostAssociationJob;
import com.yihu.jw.care.job.device.PatientSosContactsJob;
import com.yihu.jw.care.job.message.DoctorSendUnreadJob;
@ -123,6 +124,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                logger.info("OVERTIME_VISIT_JOB exist");
            }
            //归集数据定时推送 每天晚上十一点
            if (!quartzHelper.isExistJob("SAVE_DATA_PUSH_JOB")){
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("SAVE_DATA_PUSH_JOB");
                quartzHelper.addJob(SaveDataPushJob.class, trigger, "SAVE_DATA_PUSH_JOB", new HashMap<String, Object>());
                logger.info("SAVE_DATA_PUSH_JOB success");
            }else {
                logger.info("SAVE_DATA_PUSH_JOB success");
            }
        } catch (Exception e) {
            logger.info(" job start failed");
        }

+ 19 - 14
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/data/SaveDataPush.java

@ -1,7 +1,6 @@
package com.yihu.jw.care.job.data;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.care.zhylyjkglxt.dao.*;
import com.yihu.jw.care.zhylyjkglxt.entity.*;
import org.quartz.Job;
@ -12,16 +11,13 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class SaveDataPush implements Job {
public class SaveDataPushJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(SaveDataPush.class);
    private static Logger logger = LoggerFactory.getLogger(SaveDataPushJob.class);
    @Autowired
    JdbcTemplate jdbcTemplate;
@ -49,7 +45,17 @@ public class SaveDataPush implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // id  日期  字段(保存的) 表名(从哪里取到的)
        String date = DateUtil.dateToStrShort(new Date());
        saveSecurityMonitoringOrder(date);
        saveEmergencyAssistanceOrder(date);
        saveDoorCoachOrder(date);
        saveDoorCoachFeeDetail(date);
        saveLifeCareOrder(date);
        saveLifeCareFeeDetail(date);
        savePatientInfo(date);
        saveServicePackageItem(date);
        savePatientDevice(date);
        saveWlyyDevice(date);
    }
@ -57,7 +63,6 @@ public class SaveDataPush implements Job {
    public void saveSecurityMonitoringOrder(String date){
        String securityMonitoringOrderSql="SELECT id,number,patient,serve_desc,serve_town,serve_address,doctor_name,`status`,hospital,service_status from base_security_monitoring_order WHERE create_time > '"+date+"'";
        List<ZhSecurityMonitoringOrderDO> query = jdbcTemplate.query(securityMonitoringOrderSql, new BeanPropertyRowMapper<>(ZhSecurityMonitoringOrderDO.class));
        zhSecurityMonitoringOrderDao.findAll();
        zhSecurityMonitoringOrderDao.save(query);
    }
@ -113,16 +118,16 @@ public class SaveDataPush implements Job {
    // 居民设备表
    public void savePatientDevice(String date){
        String patientDeviceSql = "SELECT id,device_id,`user`,category_code,device_name,user_idcard,doctor_name,hospital_name,device_type from wlyy_patient_device WHERE czrq >= '"+date+"'";
        List<ZhDeviceDetail> query = jdbcTemplate.query(patientDeviceSql, new BeanPropertyRowMapper<>(ZhDeviceDetail.class));
        zhDeviceDetailDao.save(query);
        List<ZhDevicePatientDevice> query = jdbcTemplate.query(patientDeviceSql, new BeanPropertyRowMapper<>(ZhDevicePatientDevice.class));
        zhDevicePatientDeviceDao.save(query);
    }
    //设备表
    public void saveWlyyDevice(String date){
        String deviceSql = "SELECT id,apply_date,org_name,linkman,tel,server_ip,device_name,manufacturer,applicant_name,applicant_identity,applicant_tel,applicant_mail,grant_org_code,grant_time,grant_doctor_name,device_type,contact_status_time,contact_status,iccid FROM wlyy_devices WHERE apply_date >= '"+date+"'";
        List<ZhDevicePatientDevice> query = jdbcTemplate.query(deviceSql, new BeanPropertyRowMapper<>(ZhDevicePatientDevice.class));
        zhDevicePatientDeviceDao.save(query);
        List<ZhDeviceDetail> query = jdbcTemplate.query(deviceSql, new BeanPropertyRowMapper<>(ZhDeviceDetail.class));
        zhDeviceDetailDao.save(query);
    }

+ 0 - 19
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/web/JobController.java

@ -3,7 +3,6 @@ package com.yihu.jw.care.web;
import com.yihu.jw.care.job.BirthdayReminderJob;
import com.yihu.jw.care.job.QuartzHelper;
import com.yihu.jw.care.job.consult.FinishConsultJob;
import com.yihu.jw.care.job.data.SaveDataPush;
import com.yihu.jw.care.job.device.DeviceLostAssociationJob;
import com.yihu.jw.care.job.message.DoctorSendUnreadJob;
import com.yihu.jw.care.job.message.PatientSendUnreadJob;
@ -41,8 +40,6 @@ public class JobController extends BaseController {
    private final QuartzHelper quartzHelper;
    @Autowired
    private BirthdayReminderService birthdayReminderService;
    @Autowired
    private  SaveDataPush  saveDataPush;
    @RequestMapping(value = "/deviceLostAssociationJob", method = RequestMethod.POST)
    @ApiOperation("医养物联网检测大屏失联率")
@ -320,22 +317,6 @@ public class JobController extends BaseController {
    @RequestMapping(value = "/saveData",method = RequestMethod.GET)
    @ApiOperation("保存数据")
    public String A(){
        String s = DateUtil.dateToStrShort(new Date());
        saveDataPush.saveSecurityMonitoringOrder(s);
        saveDataPush.saveEmergencyAssistanceOrder(s);
        saveDataPush.saveDoorCoachOrder(s);
        saveDataPush.saveDoorCoachFeeDetail(s);
        saveDataPush.saveLifeCareOrder(s);
        saveDataPush.saveLifeCareFeeDetail(s);
        saveDataPush.savePatientInfo(s);
        saveDataPush.saveServicePackageItem(s);
        saveDataPush.savePatientDevice(s);
        saveDataPush.saveWlyyDevice(s);
        return null;
    }
}

+ 6 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhBaseDoorCoachOrderDO.java

@ -1120,6 +1120,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.followupList = followupList;
    }
    @Column(name = "conclusion_status")
    public Integer getConclusionStatus() {
        return conclusionStatus;
    }
@ -1128,6 +1129,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.conclusionStatus = conclusionStatus;
    }
    @Column(name = "prescription_status")
    public Integer getPrescriptionStatus() {
        return prescriptionStatus;
    }
@ -1136,6 +1138,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.prescriptionStatus = prescriptionStatus;
    }
    @Column(name = "prescription_code")
    public String getPrescriptionCode() {
        return prescriptionCode;
    }
@ -1144,6 +1147,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.prescriptionCode = prescriptionCode;
    }
    @Column(name = "prescription_time")
    public Date getPrescriptionTime() {
        return prescriptionTime;
    }
@ -1160,6 +1164,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.type = type;
    }
    @Column(name = "authorize_image")
    public String getAuthorizeImage() {
        return authorizeImage;
    }
@ -1222,6 +1227,7 @@ public class ZhBaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
        this.followupDate = followupDate;
    }
    @Column(name = "pay_status")
    public Integer getPayStatus() {
        return payStatus;
    }

+ 12 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhBasePatientDO.java

@ -304,6 +304,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.medicalState = medicalState;
    }
    @Column(name = "card_type")
    public String getCardType() {
        return cardType;
    }
@ -312,6 +313,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.cardType = cardType;
    }
    @Column(name = "openid_time")
    public Date getOpenidTime() {
        return openidTime;
    }
@ -596,15 +598,16 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.del = del;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    @Column(name = "remark")
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "live_province_code")
    public String getLiveProvinceCode() {
        return liveProvinceCode;
    }
@ -613,6 +616,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceCode = liveProvinceCode;
    }
    @Column(name = "live_province_name")
    public String getLiveProvinceName() {
        return liveProvinceName;
    }
@ -621,6 +625,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceName = liveProvinceName;
    }
    @Column(name = "live_city_code")
    public String getLiveCityCode() {
        return liveCityCode;
    }
@ -629,6 +634,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityCode = liveCityCode;
    }
    @Column(name = "live_city_name")
    public String getLiveCityName() {
        return liveCityName;
    }
@ -637,6 +643,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityName = liveCityName;
    }
    @Column(name = "live_town_code")
    public String getLiveTownCode() {
        return liveTownCode;
    }
@ -645,6 +652,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveTownCode = liveTownCode;
    }
    @Column(name = "live_town_name")
    public String getLiveTownName() {
        return liveTownName;
    }
@ -687,6 +695,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.enabled = enabled;
    }
    @Column(name = "login_failure_count")
    public Integer getLoginFailureCount() {
        return loginFailureCount;
    }
@ -695,6 +704,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.loginFailureCount = loginFailureCount;
    }
    @Column(name = "locked_date")
    public Date getLockedDate() {
        return lockedDate;
    }
@ -703,6 +713,7 @@ public class ZhBasePatientDO extends UuidIdentityEntityWithOperator {
        this.lockedDate = lockedDate;
    }
    @Column(name = "login_date")
    public Date getLoginDate() {
        return loginDate;
    }

+ 2 - 1
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhDeviceDetail.java

@ -167,7 +167,7 @@ public class ZhDeviceDetail extends IdEntity {
        this.serverIp = serverIp;
    }
    @Column(name = "manufacturerCode")
    @Column(name = "manufacturer_code")
    public String getManufacturerCode() {
        return manufacturerCode;
    }
@ -368,6 +368,7 @@ public class ZhDeviceDetail extends IdEntity {
        this.imsi = imsi;
    }
    @Column(name = "category_code")
    public String getCategoryCode() {
        return categoryCode;
    }

+ 8 - 2
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhDevicePatientDevice.java

@ -298,7 +298,8 @@ public class ZhDevicePatientDevice extends IdEntity {
    public ZhDevicePatientDevice() {
    }
    
    @Column(name = "apply_status")
    public Integer getApplyStatus() {
        return applyStatus;
    }
@ -306,7 +307,8 @@ public class ZhDevicePatientDevice extends IdEntity {
    public void setApplyStatus(Integer applyStatus) {
        this.applyStatus = applyStatus;
    }
    
    @Column(name = "apply_reason")
    public String getApplyReason() {
        return applyReason;
    }
@ -315,6 +317,7 @@ public class ZhDevicePatientDevice extends IdEntity {
        this.applyReason = applyReason;
    }
    @Column(name = "refuse_reason")
    public String getRefuseReason() {
        return refuseReason;
    }
@ -332,6 +335,7 @@ public class ZhDevicePatientDevice extends IdEntity {
        this.deviceImgUrl = deviceImgUrl;
    }
    @Column(name = "device_type")
    public Integer getDeviceType() {
        return deviceType;
    }
@ -340,6 +344,7 @@ public class ZhDevicePatientDevice extends IdEntity {
        this.deviceType = deviceType;
    }
    @Column(name = "iot_device_sn")
    public String getIotDeviceSn() {
        return iotDeviceSn;
    }
@ -348,6 +353,7 @@ public class ZhDevicePatientDevice extends IdEntity {
        this.iotDeviceSn = iotDeviceSn;
    }
    @Column(name = "safe_area_gz")
    public String getSafeAreaGz() {
        return safeAreaGz;
    }

+ 25 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhEmergencyAssistanceDO.java

@ -1,8 +1,10 @@
package com.yihu.jw.care.zhylyjkglxt.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.care.securitymonitoring.EmergencyWarnConclusionDO;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
@ -91,6 +93,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
@ -99,6 +102,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.patientName = patientName;
    }
    @Column(name = "patient_phone")
    public String getPatientPhone() {
        return patientPhone;
    }
@ -107,6 +111,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.patientPhone = patientPhone;
    }
    @Column(name = "patient_idcard")
    public String getPatientIdcard() {
        return patientIdcard;
    }
@ -115,6 +120,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.patientIdcard = patientIdcard;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
@ -123,6 +129,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
@ -131,6 +138,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.orgName = orgName;
    }
    @Column(name = "serve_lat")
    public String getServeLat() {
        return serveLat;
    }
@ -139,6 +147,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.serveLat = serveLat;
    }
    @Column(name = "serve_lon")
    public String getServeLon() {
        return serveLon;
    }
@ -147,6 +156,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.serveLon = serveLon;
    }
    @Column(name = "session_id")
    public String getSessionId() {
        return sessionId;
    }
@ -163,6 +173,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
@ -171,6 +182,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.doctorName = doctorName;
    }
    @Column(name = "doctor_lat")
    public String getDoctorLat() {
        return doctorLat;
    }
@ -179,6 +191,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.doctorLat = doctorLat;
    }
    @Column(name = "doctor_lon")
    public String getDoctorLon() {
        return doctorLon;
    }
@ -195,6 +208,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.conclusion = conclusion;
    }
    @Column(name = "conclusion_img")
    public String getConclusionImg() {
        return conclusionImg;
    }
@ -211,6 +225,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.status = status;
    }
    @Column(name = "serve_address")
    public String getServeAddress() {
        return serveAddress;
    }
@ -218,6 +233,8 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
    public void setServeAddress(String serveAddress) {
        this.serveAddress = serveAddress;
    }
    @Column(name = "doctor_address")
    public String getDoctorAddress() {
        return doctorAddress;
    }
@ -226,6 +243,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.doctorAddress = doctorAddress;
    }
    @Column(name = "complete_time")
    public Date getCompleteTime() {
        return completeTime;
    }
@ -234,6 +252,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.completeTime = completeTime;
    }
    @Column(name = "team_code")
    public String getTeamCode() {
        return teamCode;
    }
@ -242,6 +261,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.teamCode = teamCode;
    }
    @Column(name = "proxy_patient")
    public String getProxyPatient() {
        return proxyPatient;
    }
@ -250,6 +270,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.proxyPatient = proxyPatient;
    }
    @Column(name = "proxy_patient_name")
    public String getProxyPatientName() {
        return proxyPatientName;
    }
@ -258,6 +279,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.proxyPatientName = proxyPatientName;
    }
    @Column(name = "proxy_patient_phone")
    public String getProxyPatientPhone() {
        return proxyPatientPhone;
    }
@ -328,6 +350,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.otherDoctorDistance = otherDoctorDistance;
    }
    @Column(name = "order_source")
    public Integer getOrderSource() {
        return orderSource;
    }
@ -345,6 +368,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.emergencyWarnConclusionDO = emergencyWarnConclusionDO;
    }
    @Column(name = "emergency_cancel")
    public Integer getEmergencyCancel() {
        return emergencyCancel;
    }
@ -353,6 +377,7 @@ public class ZhEmergencyAssistanceDO extends UuidIdentityEntityWithOperator {
        this.emergencyCancel = emergencyCancel;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }

+ 1 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhLifeCareOrderDO.java

@ -668,6 +668,7 @@ public class ZhLifeCareOrderDO extends UuidIdentityEntityWithOperator {
        this.conclusionTime = conclusionTime;
    }
    @Column(name = "pay_status")
    public Integer getPayStatus() {
        return payStatus;
    }

+ 8 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/zhylyjkglxt/entity/ZhSecurityMonitoringOrderDO.java

@ -612,6 +612,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.conclusionStatus = conclusionStatus;
    }
    @Column(name = "doctor_confirm_finish_img")
    public String getDoctorConfirmFinishImg() {
        return doctorConfirmFinishImg;
    }
@ -620,6 +621,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.doctorConfirmFinishImg = doctorConfirmFinishImg;
    }
    @Column(name = "doctor_confirm_finish_time")
    public Date getDoctorConfirmFinishTime() {
        return doctorConfirmFinishTime;
    }
@ -628,6 +630,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.doctorConfirmFinishTime = doctorConfirmFinishTime;
    }
    @Column(name = "order_source")
    public Integer getOrderSource() {
        return orderSource;
    }
@ -636,6 +639,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.orderSource = orderSource;
    }
    @Column(name = "emergency_cancel")
    public Integer getEmergencyCancel() {
        return emergencyCancel;
    }
@ -644,6 +648,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.emergencyCancel = emergencyCancel;
    }
    @Column(name = "topic_item")
    public String getTopicItem() {
        return topicItem;
    }
@ -652,6 +657,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.topicItem = topicItem;
    }
    @Column(name = "scene_img")
    public String getSceneImg() {
        return sceneImg;
    }
@ -660,6 +666,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.sceneImg = sceneImg;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -668,6 +675,7 @@ public class ZhSecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator
        this.deviceSn = deviceSn;
    }
    @Column(name = "warn_info")
    public String getWarnInfo() {
        return warnInfo;
    }

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

@ -30,3 +30,4 @@ EME_WARNING_OVERTIME_NOT_RESPONSE=0 0 * * * ?
EME_WARNING_OVERTIME_NOT_RESPONSE_DAY=0 30 9 * * ?
#\u5B9A\u65F6\u63A8\u9001\u4FDD\u5B58\u6570\u636E
SAVE_DATA_PUSH_JOB= 0 0 23 * * ?