瀏覽代碼

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java
wangzhinan 3 年之前
父節點
當前提交
c0662a0ebb
共有 76 個文件被更改,包括 2342 次插入147 次删除
  1. 27 1
      common/common-entity/sql记录
  2. 99 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseHomePageDO.java
  3. 67 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseRulesDO.java
  4. 67 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseWebInfoDO.java
  5. 15 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  6. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/contacts/PatientSosContactsDO.java
  7. 5 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BasePatientOutBed.java
  8. 7 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BasePatientStepDo.java
  9. 21 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepDeviceReport.java
  10. 8 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepNightRecord.java
  11. 7 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepPlan.java
  12. 15 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepPlanDetail.java
  13. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepX1device.java
  14. 4 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseYxDeviceIndex.java
  15. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/Device.java
  16. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceDataPushLog.java
  17. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceDetail.java
  18. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceHealthIndex.java
  19. 8 2
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientDevice.java
  20. 13 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceSosLogDO.java
  21. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/HvDeviceRecord.java
  22. 7 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/PatientSafeAreaConfirm.java
  23. 6 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/PatientSafeAreaDO.java
  24. 8 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/YsConfigDo.java
  25. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/device/YsDeviceDo.java
  26. 42 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimDo.java
  27. 51 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimFlowDo.java
  28. 50 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimVoicesDo.java
  29. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java
  30. 3 0
      common/common-entity/src/main/java/com/yihu/jw/entity/patient/PatientDevice.java
  31. 9 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/emergency/EmergencyOrderVO.java
  32. 12 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseHomePageDao.java
  33. 12 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseRulesDao.java
  34. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseWebInfoDao.java
  35. 18 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/FileUploadController.java
  36. 254 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/gw/ZjxlGwEndpoint.java
  37. 155 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/gw/ZjxlGwOpenEndpoint.java
  38. 55 55
      svr/svr-base/src/main/java/com/yihu/jw/base/filter/XssAndHttpServletRequestWrapper.java
  39. 25 25
      svr/svr-base/src/main/java/com/yihu/jw/base/filter/XssFiter.java
  40. 5 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/article/KnowledgeArticleService.java
  41. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseHomePageService.java
  42. 18 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseRulesService.java
  43. 20 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseWebInfoService.java
  44. 44 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/ZjxlGwService.java
  45. 6 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/NetworkCardConfig.java
  46. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java
  47. 9 5
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/family/FamilyMemberEndpoint.java
  48. 31 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java
  49. 56 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java
  50. 4 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/admin/AdminDoorCoachOrderService.java
  51. 11 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java
  52. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java
  53. 2 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/contacts/ContactsService.java
  54. 59 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/NetworkCardService.java
  55. 3 3
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java
  56. 4 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java
  57. 36 7
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/family/PatientFamilyMemberService.java
  58. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/PatientMessageService.java
  59. 13 5
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java
  60. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/safeArea/SafeAreaService.java
  61. 100 10
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java
  62. 3 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/DetectionPlatformService.java
  63. 48 6
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java
  64. 14 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/config/NetworkCardConfig.java
  65. 11 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimDao.java
  66. 20 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimFlowDao.java
  67. 20 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimVoiceDao.java
  68. 30 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/event/ApplicationEvent.java
  69. 5 6
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/data/SaveDataPushJob.java
  70. 127 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/GetSimsVoiceFlowDayJob.java
  71. 134 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/GetSimsVoiceFlowMonthJob.java
  72. 116 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/UpdateSimsJob.java
  73. 210 0
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/WlyysimFlowVoiceService.java
  74. 13 1
      svr/svr-cloud-job/src/main/java/com/yihu/jw/care/web/JobController.java
  75. 1 1
      svr/svr-cloud-job/src/main/resources/application.yml
  76. 10 1
      svr/svr-cloud-job/src/main/resources/system.properties

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

@ -1637,4 +1637,30 @@ CREATE TABLE `base_sleep_x1device` (
  `total` int(11) NULL DEFAULT NULL COMMENT '检测次数',
  `del` int(1) DEFAULT NULL COMMENT '是否有效 1有效 0无效',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='爱牵挂X1手表睡眠数据';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='爱牵挂X1手表睡眠数据';
--
CREATE TABLE `wlyy_sims` (
  `id` varchar(50) NOT NULL COMMENT '主键',
  `msisdn` varchar(20) DEFAULT NULL COMMENT '物联网卡msisdn',
  `iccid` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'iccid',
  `imsi` varchar(255) DEFAULT NULL COMMENT '物联网卡imsi',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物联网卡信息';
CREATE TABLE `wlyy_sims_flow` (
  `id` varchar(50) NOT NULL COMMENT '主键',
  `msisdn` varchar(20) DEFAULT NULL COMMENT '物联网卡msisdn',
  `day` varchar(10) DEFAULT NULL COMMENT '日期',
  `type` int(1) DEFAULT NULL COMMENT '1月统计 2日统计',
  `value` varchar(11) DEFAULT NULL COMMENT '使用量KB',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物联网卡流量使用信息';
CREATE TABLE `wlyy_sims_voices` (
  `id` varchar(50) NOT NULL COMMENT '主键',
  `msisdn` varchar(20) DEFAULT NULL COMMENT '物联网卡msisdn',
  `day` varchar(10) DEFAULT NULL COMMENT '日期',
  `type` int(1) DEFAULT NULL COMMENT '1月统计 2日统计',
  `value` varchar(11) DEFAULT NULL COMMENT '使用量/分钟',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='物联网卡语音使用情况';

+ 99 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseHomePageDO.java

@ -0,0 +1,99 @@
package com.yihu.jw.entity.base.gw;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * 制度表
 * Created by yeshijie on 2022/2/21.
 */
@Entity
@Table(name = "base_home_page")
public class BaseHomePageDO extends UuidIdentityEntityWithCreateTime {
    private String name;//名称
    private Integer type;//1 banner,2产品生态与亮点 3解决方案 4新闻中心
    private String img;//图片
    private String url;//链接
    private Integer del;//失效标志 0失效 1生效
    private Long sort;//排序
    private String articleId;//文章id
    private String articleTitle;//文章标题
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    @Column(name = "url")
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "sort")
    public Long getSort() {
        return sort;
    }
    public void setSort(Long sort) {
        this.sort = sort;
    }
    @Column(name = "article_id")
    public String getArticleId() {
        return articleId;
    }
    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }
    @Transient
    public String getArticleTitle() {
        return articleTitle;
    }
    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }
}

+ 67 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseRulesDO.java

@ -0,0 +1,67 @@
package com.yihu.jw.entity.base.gw;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 制度表
 * Created by yeshijie on 2022/2/21.
 */
@Entity
@Table(name = "base_rules")
public class BaseRulesDO extends UuidIdentityEntityWithCreateTime {
    private String name;//制度名称
    private String fileUrl;//文件地址
    private String fileFormat;//文件格式
    private String img;//
    private Integer del;//失效标志 0失效 1生效
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "file_url")
    public String getFileUrl() {
        return fileUrl;
    }
    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }
    @Column(name = "file_format")
    public String getFileFormat() {
        return fileFormat;
    }
    public void setFileFormat(String fileFormat) {
        this.fileFormat = fileFormat;
    }
    @Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 67 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/gw/BaseWebInfoDO.java

@ -0,0 +1,67 @@
package com.yihu.jw.entity.base.gw;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 制度表
 * Created by yeshijie on 2022/2/21.
 */
@Entity
@Table(name = "base_web_info")
public class BaseWebInfoDO extends UuidIdentityEntityWithCreateTime {
    private String name;
    private String address;//地址
    private String mobile;//联系方式
    private String recordNumber;//备案号
    private String qrcode;//二维码
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "address")
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    @Column(name = "record_number")
    public String getRecordNumber() {
        return recordNumber;
    }
    public void setRecordNumber(String recordNumber) {
        this.recordNumber = recordNumber;
    }
    @Column(name = "qrcode")
    public String getQrcode() {
        return qrcode;
    }
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }
}

+ 15 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -304,6 +304,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.medicalState = medicalState;
    }
    @Column(name = "card_type")
    public String getCardType() {
        return cardType;
    }
@ -312,6 +313,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.cardType = cardType;
    }
    @Column(name = "openid_time")
    public Date getOpenidTime() {
        return openidTime;
    }
@ -596,15 +598,16 @@ public class BasePatientDO 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 BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceCode = liveProvinceCode;
    }
    @Column(name = "live_province_name")
    public String getLiveProvinceName() {
        return liveProvinceName;
    }
@ -621,6 +625,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceName = liveProvinceName;
    }
    @Column(name = "live_city_code")
    public String getLiveCityCode() {
        return liveCityCode;
    }
@ -629,6 +634,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityCode = liveCityCode;
    }
    @Column(name = "live_city_name")
    public String getLiveCityName() {
        return liveCityName;
    }
@ -637,6 +643,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityName = liveCityName;
    }
    @Column(name = "live_town_code")
    public String getLiveTownCode() {
        return liveTownCode;
    }
@ -645,6 +652,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveTownCode = liveTownCode;
    }
    @Column(name = "live_town_name")
    public String getLiveTownName() {
        return liveTownName;
    }
@ -671,6 +679,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveStreetName = liveStreetName;
    }
    @Column(name = "locked")
    public Integer getLocked() {
        return locked;
    }
@ -679,6 +688,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.locked = locked;
    }
    @Column(name = "enabled")
    public Integer getEnabled() {
        return enabled;
    }
@ -687,6 +697,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.enabled = enabled;
    }
    @Column(name = "login_failure_count")
    public Integer getLoginFailureCount() {
        return loginFailureCount;
    }
@ -695,6 +706,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.loginFailureCount = loginFailureCount;
    }
    @Column(name = "locked_date")
    public Date getLockedDate() {
        return lockedDate;
    }
@ -703,6 +715,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.lockedDate = lockedDate;
    }
    @Column(name = "login_date")
    public Date getLoginDate() {
        return loginDate;
    }
@ -720,6 +733,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.userId = userId;
    }
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/contacts/PatientSosContactsDO.java

@ -4,6 +4,7 @@ package com.yihu.jw.entity.care.contacts;
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 javax.persistence.Transient;
@ -29,6 +30,7 @@ public class PatientSosContactsDO extends IdEntity {
    private String relationName;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -37,6 +39,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "sos_name")
    public String getSosName() {
        return sosName;
    }
@ -45,6 +48,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.sosName = sosName;
    }
    @Column(name = "sos_phone")
    public String getSosPhone() {
        return sosPhone;
    }
@ -53,6 +57,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.sosPhone = sosPhone;
    }
    @Column(name = "relation")
    public Integer getRelation() {
        return relation;
    }
@ -62,6 +67,7 @@ public class PatientSosContactsDO extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
@ -70,6 +76,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.updateTime = updateTime;
    }
    @Column(name = "success_flag")
    public Integer getSuccessFlag() {
        return successFlag;
    }
@ -78,6 +85,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.successFlag = successFlag;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
@ -95,6 +103,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.relationName = relationName;
    }
    @Column(name = "phone_seqid")
    public Integer getPhoneSeqid() {
        return phoneSeqid;
    }
@ -103,6 +112,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.phoneSeqid = phoneSeqid;
    }
    @Column(name = "update_info")
    public String getUpdateInfo() {
        return updateInfo;
    }
@ -111,6 +121,7 @@ public class PatientSosContactsDO extends IdEntity {
        this.updateInfo = updateInfo;
    }
    @Column(name = "error_info")
    public String getErrorInfo() {
        return errorInfo;
    }

+ 5 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BasePatientOutBed.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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;
@ -18,6 +19,7 @@ public class BasePatientOutBed extends IdEntity {
    private Integer status;//是否回床 0否,1是
    private Date createTime;// 创建日期 即起床时间
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -26,6 +28,7 @@ public class BasePatientOutBed extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -34,6 +37,7 @@ public class BasePatientOutBed extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
@ -43,6 +47,7 @@ public class BasePatientOutBed extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

+ 7 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BasePatientStepDo.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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;
@ -20,6 +21,7 @@ public class BasePatientStepDo extends IdEntity{
    private Date createTime;
    private Integer del;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -28,6 +30,7 @@ public class BasePatientStepDo extends IdEntity{
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -36,6 +39,7 @@ public class BasePatientStepDo extends IdEntity{
        this.deviceSn = deviceSn;
    }
    @Column(name = "steps")
    public String getSteps() {
        return steps;
    }
@ -44,6 +48,7 @@ public class BasePatientStepDo extends IdEntity{
        this.steps = steps;
    }
    @Column(name = "day")
    public String getDay() {
        return day;
    }
@ -53,6 +58,7 @@ public class BasePatientStepDo extends IdEntity{
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
@ -61,6 +67,7 @@ public class BasePatientStepDo extends IdEntity{
        this.createTime = createTime;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }

+ 21 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepDeviceReport.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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;
@ -36,6 +37,7 @@ public class BaseSleepDeviceReport extends IdEntity {
    public Date createTime; // //日期
    public Integer del; //是否有效 1有效 0无效
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -44,6 +46,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -52,6 +55,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "falla_sleep")
    public String getFallaSleep() {
        return fallaSleep;
    }
@ -60,6 +64,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.fallaSleep = fallaSleep;
    }
    @Column(name = "sleep_time")
    public String getSleepTime() {
        return sleepTime;
    }
@ -68,6 +73,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.sleepTime = sleepTime;
    }
    @Column(name = "rest_time")
    public String getRestTime() {
        return restTime;
    }
@ -76,6 +82,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.restTime = restTime;
    }
    @Column(name = "awake_time")
    public String getAwakeTime() {
        return awakeTime;
    }
@ -84,6 +91,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.awakeTime = awakeTime;
    }
    @Column(name = "light_time")
    public String getLightTime() {
        return lightTime;
    }
@ -92,6 +100,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.lightTime = lightTime;
    }
    @Column(name = "rem_time")
    public String getRemTime() {
        return remTime;
    }
@ -100,6 +109,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.remTime = remTime;
    }
    @Column(name = "deep_time")
    public String getDeepTime() {
        return deepTime;
    }
@ -108,6 +118,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.deepTime = deepTime;
    }
    @Column(name = "bucket")
    public String getBucket() {
        return bucket;
    }
@ -116,6 +127,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.bucket = bucket;
    }
    @Column(name = "avghr")
    public String getAvghr() {
        return avghr;
    }
@ -124,6 +136,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.avghr = avghr;
    }
    @Column(name = "avgbr")
    public String getAvgbr() {
        return avgbr;
    }
@ -132,6 +145,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.avgbr = avgbr;
    }
    @Column(name = "awake_per")
    public String getAwakePer() {
        return awakePer;
    }
@ -140,6 +154,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.awakePer = awakePer;
    }
    @Column(name = "rem_per")
    public String getRemPer() {
        return remPer;
    }
@ -148,6 +163,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.remPer = remPer;
    }
    @Column(name = "light_per")
    public String getLightPer() {
        return lightPer;
    }
@ -156,6 +172,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.lightPer = lightPer;
    }
    @Column(name = "deep_per")
    public String getDeepPer() {
        return deepPer;
    }
@ -164,6 +181,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.deepPer = deepPer;
    }
    @Column(name = "efficiency")
    public String getEfficiency() {
        return efficiency;
    }
@ -172,6 +190,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.efficiency = efficiency;
    }
    @Column(name = "score")
    public String getScore() {
        return score;
    }
@ -181,6 +200,7 @@ public class BaseSleepDeviceReport extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
@ -189,6 +209,7 @@ public class BaseSleepDeviceReport extends IdEntity {
        this.createTime = createTime;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }

+ 8 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepNightRecord.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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;
@ -21,6 +22,7 @@ public class BaseSleepNightRecord extends IdEntity {
    private Date createTime;// 创建日期 即起床时间
    private Date updateTime;// 更新日期
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -29,6 +31,7 @@ public class BaseSleepNightRecord extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -37,6 +40,7 @@ public class BaseSleepNightRecord extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "out_time")
    public String getOutTime() {
        return outTime;
    }
@ -45,6 +49,7 @@ public class BaseSleepNightRecord extends IdEntity {
        this.outTime = outTime;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
@ -53,6 +58,7 @@ public class BaseSleepNightRecord extends IdEntity {
        this.status = status;
    }
    @Column(name = "day")
    public String getDay() {
        return day;
    }
@ -62,6 +68,7 @@ public class BaseSleepNightRecord extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
@ -71,6 +78,7 @@ public class BaseSleepNightRecord extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

+ 7 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepPlan.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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 javax.persistence.Transient;
@ -25,6 +26,7 @@ public class BaseSleepPlan extends IdEntity {
    private String nightRestTime;
    private Date createTime;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -33,6 +35,7 @@ public class BaseSleepPlan extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -41,6 +44,7 @@ public class BaseSleepPlan extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "get_up_time")
    public String getGetUpTime() {
        return getUpTime;
    }
@ -49,6 +53,7 @@ public class BaseSleepPlan extends IdEntity {
        this.getUpTime = getUpTime;
    }
    @Column(name = "nap_time")
    public String getNapTime() {
        return napTime;
    }
@ -57,6 +62,7 @@ public class BaseSleepPlan extends IdEntity {
        this.napTime = napTime;
    }
    @Column(name = "night_rest_time")
    public String getNightRestTime() {
        return nightRestTime;
    }
@ -66,6 +72,7 @@ public class BaseSleepPlan extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

+ 15 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepPlanDetail.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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 javax.persistence.Transient;
@ -34,6 +35,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    private String breath;
    private Integer bedStatus; //0未在床 1在床
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -42,6 +44,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -50,6 +53,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "day")
    public String getDay() {
        return day;
    }
@ -58,6 +62,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.day = day;
    }
    @Column(name = "up_status")
    public Integer getUpStatus() {
        return upStatus;
    }
@ -67,6 +72,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "up_time")
    public Date getUpTime() {
        return upTime;
    }
@ -75,6 +81,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.upTime = upTime;
    }
    @Column(name = "siesta_status")
    public Integer getSiestaStatus() {
        return siestaStatus;
    }
@ -84,6 +91,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "siesta_time_begin")
    public Date getSiestaTimeBegin() {
        return siestaTimeBegin;
    }
@ -93,6 +101,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "siesta_time_end")
    public Date getSiestaTimeEnd() {
        return siestaTimeEnd;
    }
@ -101,6 +110,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.siestaTimeEnd = siestaTimeEnd;
    }
    @Column(name = "siesta_long")
    public String getSiestaLong() {
        return siestaLong;
    }
@ -109,6 +119,7 @@ public class BaseSleepPlanDetail extends IdEntity {
        this.siestaLong = siestaLong;
    }
    @Column(name = "in_status")
    public Integer getInStatus() {
        return inStatus;
    }
@ -118,6 +129,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "in_time_begin")
    public Date getInTimeBegin() {
        return inTimeBegin;
    }
@ -127,6 +139,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "in_time_end")
    public Date getInTimeEnd() {
        return inTimeEnd;
    }
@ -136,6 +149,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
@ -145,6 +159,7 @@ public class BaseSleepPlanDetail extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseSleepX1device.java

@ -28,6 +28,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
    private Integer total; // 检测次数
    private Integer del;  //是否有效 1有效 0无效
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -36,6 +37,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.patient = patient;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -44,6 +46,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "sleep_time")
    public String getSleepTime() {
        return sleepTime;
    }
@ -52,6 +55,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.sleepTime = sleepTime;
    }
    @Column(name = "deep_sleep")
    public String getDeepSleep() {
        return deepSleep;
    }
@ -60,6 +64,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.deepSleep = deepSleep;
    }
    @Column(name = "light_sleep")
    public String getLightSleep() {
        return lightSleep;
    }
@ -68,6 +73,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.lightSleep = lightSleep;
    }
    @Column(name = "awake_time")
    public String getAwakeTime() {
        return awakeTime;
    }
@ -96,6 +102,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.endTime = endTime;
    }
    @Column(name = "interval_time")
    public Integer getIntervalTime() {
        return intervalTime;
    }
@ -104,6 +111,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.intervalTime = intervalTime;
    }
    @Column(name = "total")
    public Integer getTotal() {
        return total;
    }
@ -112,6 +120,7 @@ public class BaseSleepX1device extends UuidIdentityEntity {
        this.total = total;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }

+ 4 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/BaseYxDeviceIndex.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -20,6 +21,7 @@ public class BaseYxDeviceIndex extends UuidIdentityEntityWithCreateTime{
    private String lat;//纬度
    private String lon;//经度
    @Column(name = "sn")
    public String getSn() {
        return sn;
    }
@ -28,6 +30,7 @@ public class BaseYxDeviceIndex extends UuidIdentityEntityWithCreateTime{
        this.sn = sn;
    }
    @Column(name = "lat")
    public String getLat() {
        return lat;
    }
@ -36,6 +39,7 @@ public class BaseYxDeviceIndex extends UuidIdentityEntityWithCreateTime{
        this.lat = lat;
    }
    @Column(name = "lon")
    public String getLon() {
        return lon;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/Device.java

@ -112,6 +112,7 @@ public class Device extends IdEntity {
		this.del = del;
	}
	@Column(name = "service_topic")
	public String getServiceTopic() {
		return serviceTopic;
	}
@ -120,6 +121,7 @@ public class Device extends IdEntity {
		this.serviceTopic = serviceTopic;
	}
	@Column(name = "need_register")
	public String getNeedRegister() {
		return needRegister;
	}
@ -128,6 +130,7 @@ public class Device extends IdEntity {
		this.needRegister = needRegister;
	}
	@Column(name = "device_type")
	public Integer getDeviceType() {
		return deviceType;
	}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceDataPushLog.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@ -23,6 +24,7 @@ public class DeviceDataPushLog extends IdEntity {
    private Date createTime;
    @Column(name="patient")
    public String getPatient() {
        return patient;
    }
@ -31,6 +33,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.patient = patient;
    }
    @Column(name="patient_name")
    public String getPatientName() {
        return patientName;
    }
@ -39,6 +42,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.patientName = patientName;
    }
    @Column(name="device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -47,6 +51,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name="device_name")
    public String getDeviceName() {
        return deviceName;
    }
@ -55,6 +60,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.deviceName = deviceName;
    }
    @Column(name="device_category")
    public String getDeviceCategory() {
        return deviceCategory;
    }
@ -63,6 +69,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.deviceCategory = deviceCategory;
    }
    @Column(name="api_name")
    public String getApiName() {
        return apiName;
    }
@ -71,6 +78,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.apiName = apiName;
    }
    @Column(name="data")
    public String getData() {
        return data;
    }
@ -79,6 +87,7 @@ public class DeviceDataPushLog extends IdEntity {
        this.data = data;
    }
    @Column(name="create_time")
    public Date getCreateTime() {
        return createTime;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceDetail.java

@ -354,6 +354,7 @@ public class DeviceDetail extends IdEntity {
        this.contactStatusTime = contactStatusTime;
    }
    @Column(name = "iccid")
    public String getIccid() {
        return iccid;
    }
@ -362,6 +363,7 @@ public class DeviceDetail extends IdEntity {
        this.iccid = iccid;
    }
    @Column(name = "imsi")
    public String getImsi() {
        return imsi;
    }
@ -370,6 +372,7 @@ public class DeviceDetail extends IdEntity {
        this.imsi = imsi;
    }
    @Column(name = "category_code")
    public String getCategoryCode() {
        return categoryCode;
    }

+ 6 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceHealthIndex.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -23,6 +24,7 @@ public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
    private String unit;//单位
    private String recordTime;//记录时间
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -31,6 +33,7 @@ public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
        this.deviceSn = deviceSn;
    }
    @Column(name = "device_type")
    public String getDeviceType() {
        return deviceType;
    }
@ -39,6 +42,7 @@ public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
        this.deviceType = deviceType;
    }
    @Column(name = "value")
    public String getValue() {
        return value;
    }
@ -47,6 +51,7 @@ public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
        this.value = value;
    }
    @Column(name = "unit")
    public String getUnit() {
        return unit;
    }
@ -55,6 +60,7 @@ public class DeviceHealthIndex extends UuidIdentityEntityWithCreateTime{
        this.unit = unit;
    }
    @Column(name = "record_time")
    public String getRecordTime() {
        return recordTime;
    }

+ 8 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DevicePatientDevice.java

@ -298,7 +298,8 @@ public class DevicePatientDevice extends IdEntity {
    public DevicePatientDevice() {
    }
    
    @Column(name = "apply_status")
    public Integer getApplyStatus() {
        return applyStatus;
    }
@ -306,7 +307,8 @@ public class DevicePatientDevice 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 DevicePatientDevice extends IdEntity {
        this.applyReason = applyReason;
    }
    @Column(name = "refuse_reason")
    public String getRefuseReason() {
        return refuseReason;
    }
@ -332,6 +335,7 @@ public class DevicePatientDevice extends IdEntity {
        this.deviceImgUrl = deviceImgUrl;
    }
    @Column(name = "device_type")
    public Integer getDeviceType() {
        return deviceType;
    }
@ -340,6 +344,7 @@ public class DevicePatientDevice extends IdEntity {
        this.deviceType = deviceType;
    }
    @Column(name = "iot_device_sn")
    public String getIotDeviceSn() {
        return iotDeviceSn;
    }
@ -348,6 +353,7 @@ public class DevicePatientDevice extends IdEntity {
        this.iotDeviceSn = iotDeviceSn;
    }
    @Column(name = "safe_area_gz")
    public String getSafeAreaGz() {
        return safeAreaGz;
    }

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/DeviceSosLogDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@ -26,6 +27,8 @@ public class DeviceSosLogDO extends IdEntity {
    private String sosSendMessage; //紧急救助返回消息
    private Date createTime;//
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -34,6 +37,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
@ -42,6 +46,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.patientName = patientName;
    }
    @Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
@ -50,6 +55,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.idcard = idcard;
    }
    @Column(name = "category_code")
    public String getCategoryCode() {
        return categoryCode;
    }
@ -58,6 +64,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.categoryCode = categoryCode;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -66,6 +73,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "sos_address")
    public String getSosAddress() {
        return sosAddress;
    }
@ -74,6 +82,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.sosAddress = sosAddress;
    }
    @Column(name = "sos_lat")
    public String getSosLat() {
        return sosLat;
    }
@ -82,6 +91,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.sosLat = sosLat;
    }
    @Column(name = "sos_lon")
    public String getSosLon() {
        return sosLon;
    }
@ -90,6 +100,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.sosLon = sosLon;
    }
    @Column(name = "sos_send_status")
    public String getSosSendStatus() {
        return sosSendStatus;
    }
@ -98,6 +109,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.sosSendStatus = sosSendStatus;
    }
    @Column(name = "sos_send_message")
    public String getSosSendMessage() {
        return sosSendMessage;
    }
@ -106,6 +118,7 @@ public class DeviceSosLogDO extends IdEntity {
        this.sosSendMessage = sosSendMessage;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/HvDeviceRecord.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -19,6 +20,7 @@ public class HvDeviceRecord extends UuidIdentityEntity {
    private String deviceId;//海康平台设备id
    private String deviceSn;//设备sn
    @Column(name = "device_id")
    public String getDeviceId() {
        return deviceId;
    }
@ -27,6 +29,7 @@ public class HvDeviceRecord extends UuidIdentityEntity {
        this.deviceId = deviceId;
    }
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }

+ 7 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/PatientSafeAreaConfirm.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
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;
@ -22,6 +23,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
    private Date createTime;
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -30,6 +32,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
        this.patient = patient;
    }
    @Column(name = "doctor_code")
    public String getDoctorCode() {
        return doctorCode;
    }
@ -38,6 +41,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
        this.doctorCode = doctorCode;
    }
    @Column(name = "safe_id")
    public String getSafeId() {
        return safeId;
    }
@ -46,6 +50,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
        this.safeId = safeId;
    }
    @Column(name = "del")
    public String getDel() {
        return del;
    }
@ -54,6 +59,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
        this.del = del;
    }
    @Column(name = "manage_status")
    public Integer getManageStatus() {
        return manageStatus;
    }
@ -63,6 +69,7 @@ public class PatientSafeAreaConfirm extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

+ 6 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/PatientSafeAreaDO.java

@ -24,6 +24,7 @@ public class PatientSafeAreaDO extends IdEntity {
    private String del;//作废标识,1正常,0作废
    private Integer manageStatus;//电子围栏确认情况 0待确认 1已确认
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
@ -41,6 +42,7 @@ public class PatientSafeAreaDO extends IdEntity {
        this.safeAreaGz = safeAreaGz;
    }
    @Column(name = "success_flag")
    public Integer getSuccessFlag() {
        return successFlag;
    }
@ -50,6 +52,7 @@ public class PatientSafeAreaDO extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
@ -59,6 +62,7 @@ public class PatientSafeAreaDO extends IdEntity {
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
@ -67,6 +71,7 @@ public class PatientSafeAreaDO extends IdEntity {
        this.updateTime = updateTime;
    }
    @Column(name = "manage_status")
    public Integer getManageStatus() {
        return manageStatus;
    }
@ -75,6 +80,7 @@ public class PatientSafeAreaDO extends IdEntity {
        this.manageStatus = manageStatus;
    }
    @Column(name = "del")
    public String getDel() {
        return del;
    }

+ 8 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/YsConfigDo.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -20,6 +21,7 @@ public class YsConfigDo extends IdEntity {
    private String iotAccessTokenKey; //iot token Key
    private String secretKey; //设备的解密秘钥 key
    @Column(name = "config_id")
    public Integer getConfigId() {
        return configId;
    }
@ -28,6 +30,7 @@ public class YsConfigDo extends IdEntity {
        this.configId = configId;
    }
    @Column(name = "app_key")
    public String getAppKey() {
        return appKey;
    }
@ -36,6 +39,7 @@ public class YsConfigDo extends IdEntity {
        this.appKey = appKey;
    }
    @Column(name = "app_secret")
    public String getAppSecret() {
        return appSecret;
    }
@ -44,6 +48,7 @@ public class YsConfigDo extends IdEntity {
        this.appSecret = appSecret;
    }
    @Column(name = "msg_data_key")
    public String getMsgDataKey() {
        return msgDataKey;
    }
@ -52,6 +57,7 @@ public class YsConfigDo extends IdEntity {
        this.msgDataKey = msgDataKey;
    }
    @Column(name = "access_token_key")
    public String getAccessTokenKey() {
        return accessTokenKey;
    }
@ -60,6 +66,7 @@ public class YsConfigDo extends IdEntity {
        this.accessTokenKey = accessTokenKey;
    }
    @Column(name = "iot_access_token_key")
    public String getIotAccessTokenKey() {
        return iotAccessTokenKey;
    }
@ -68,6 +75,7 @@ public class YsConfigDo extends IdEntity {
        this.iotAccessTokenKey = iotAccessTokenKey;
    }
    @Column(name = "secret_key")
    public String getSecretKey() {
        return secretKey;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/device/YsDeviceDo.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.care.device;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -16,6 +17,7 @@ public class YsDeviceDo extends IdEntity {
    private String deviceSn;
    private Integer configId; //配置编号
    @Column(name = "device_sn")
    public String getDeviceSn() {
        return deviceSn;
    }
@ -24,6 +26,7 @@ public class YsDeviceDo extends IdEntity {
        this.deviceSn = deviceSn;
    }
    @Column(name = "config_id")
    public Integer getConfigId() {
        return configId;
    }

+ 42 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimDo.java

@ -0,0 +1,42 @@
package com.yihu.jw.entity.care.sim;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Bing on 2022/2/11.
 * 物联网卡--job更新
 */
@Entity
@Table(name = "wlyy_sims")
public class WlyySimDo extends UuidIdentityEntity {
    private String msisdn;
    private String iccid;
    private String imsi;
    public String getMsisdn() {
        return msisdn;
    }
    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }
    public String getIccid() {
        return iccid;
    }
    public void setIccid(String iccid) {
        this.iccid = iccid;
    }
    public String getImsi() {
        return imsi;
    }
    public void setImsi(String imsi) {
        this.imsi = imsi;
    }
}

+ 51 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimFlowDo.java

@ -0,0 +1,51 @@
package com.yihu.jw.entity.care.sim;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Bing on 2022/2/11.
 * 物联网卡流量使用
 */
@Entity
@Table(name="wlyy_sims_flow")
public class WlyySimFlowDo extends UuidIdentityEntity {
    private String msisdn;
    private String day;
    private Integer type;//1月统计 2日统计
    private String value;//使用量KB
    public String getMsisdn() {
        return msisdn;
    }
    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }
    public String getDay() {
        return day;
    }
    public void setDay(String day) {
        this.day = day;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 50 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/sim/WlyySimVoicesDo.java

@ -0,0 +1,50 @@
package com.yihu.jw.entity.care.sim;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Bing on 2022/2/11.
 */
@Entity
@Table(name="wlyy_sims_voices")
public class WlyySimVoicesDo extends UuidIdentityEntity {
    private String msisdn;
    private String day;
    private Integer type;//1月统计 2日统计
    private String value;//使用量/分钟
    public String getMsisdn() {
        return msisdn;
    }
    public void setMsisdn(String msisdn) {
        this.msisdn = msisdn;
    }
    public String getDay() {
        return day;
    }
    public void setDay(String day) {
        this.day = day;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -306,7 +306,7 @@ public class BusinessOrderDO extends IntegerIdentityEntity {
        this.traceNo = traceNo;
    }
    @Column(name = "last_pay_time")
    public Long getLastPayTime() {
        return lastPayTime;
    }

+ 3 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/patient/PatientDevice.java

@ -301,6 +301,7 @@ public class PatientDevice extends IdEntity {
    public PatientDevice() {
    }
    @Column(name = "apply_status")
    public Integer getApplyStatus() {
        return applyStatus;
    }
@ -309,6 +310,7 @@ public class PatientDevice extends IdEntity {
        this.applyStatus = applyStatus;
    }
    @Column(name = "apply_reason")
    public String getApplyReason() {
        return applyReason;
    }
@ -317,6 +319,7 @@ public class PatientDevice extends IdEntity {
        this.applyReason = applyReason;
    }
    @Column(name = "refuse_reason")
    public String getRefuseReason() {
        return refuseReason;
    }

+ 9 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/emergency/EmergencyOrderVO.java

@ -57,6 +57,7 @@ public class EmergencyOrderVO {
    private List<Map<String,Object>> securityDevices;//安防设备列表
    private String overTimeNotResponse;
    private Integer OrderType;//20紧急 22安防
    private Integer know;//知悉 1已知悉 0未知悉
    public String getId() {
        return id;
@ -306,4 +307,12 @@ public class EmergencyOrderVO {
    public void setOrderType(Integer orderType) {
        OrderType = orderType;
    }
    public Integer getKnow() {
        return know;
    }
    public void setKnow(Integer know) {
        this.know = know;
    }
}

+ 12 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseHomePageDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.base.dao.gw;
import com.yihu.jw.entity.base.gw.BaseHomePageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2022/2/21.
 */
public interface BaseHomePageDao extends PagingAndSortingRepository<BaseHomePageDO, String>, JpaSpecificationExecutor<BaseHomePageDO> {
}

+ 12 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseRulesDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.base.dao.gw;
import com.yihu.jw.entity.base.gw.BaseRulesDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2022/2/21.
 */
public interface BaseRulesDao extends PagingAndSortingRepository<BaseRulesDO, String>, JpaSpecificationExecutor<BaseRulesDO> {
}

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/gw/BaseWebInfoDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.dao.gw;
import com.yihu.jw.entity.base.gw.BaseWebInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2022/2/21.
 */
public interface BaseWebInfoDao extends PagingAndSortingRepository<BaseWebInfoDO, String>, JpaSpecificationExecutor<BaseWebInfoDO> {
    @Query("from BaseWebInfoDO")
    List<BaseWebInfoDO> findAll();
}

+ 18 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/FileUploadController.java

@ -11,9 +11,11 @@ import com.yihu.jw.file_upload.FileManageService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.restmodel.MutilFileInfo;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -94,6 +96,22 @@ public class FileUploadController extends EnvelopRestEndpoint {
        return success("上传成功", uploadVO);
    }
    @PostMapping(value = "upload_stream_attachmentLimit")
    @ApiOperation(value = "文件流上传附件", notes = "文件流上传附件限制格式")
    public ObjEnvelop<UploadVO> uploadAttachmentLimit(@ApiParam(value = "文件", required = true)
                                                 @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
        UploadVO uploadVO = new UploadVO();
        // 得到文件的完整名称  xxx.txt
        String originalFilename = file.getOriginalFilename();
        //得到文件类型
        String fileType = originalFilename.substring(originalFilename.lastIndexOf(".") + 1).toLowerCase();
        if(StringUtils.isBlank(fileType)||!"doc、docx、pdf、xls、xlsx、ppt、pptx".contains(fileType)){
            return ObjEnvelop.getError("文件格式不支持");
        }
        InputStream inputStream = file.getInputStream();
        uploadVO = fileUploadService.uploadStream(inputStream,originalFilename,fastdfs_file_url);
        return success("上传成功", uploadVO);
    }
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM_ATTACHMENT)
    @ApiOperation(value = "文件流上传附件", notes = "文件流上传附件")

+ 254 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/gw/ZjxlGwEndpoint.java

@ -0,0 +1,254 @@
package com.yihu.jw.base.endpoint.gw;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.article.KnowledgeArticleService;
import com.yihu.jw.base.service.gw.BaseHomePageService;
import com.yihu.jw.base.service.gw.BaseRulesService;
import com.yihu.jw.base.service.gw.BaseWebInfoService;
import com.yihu.jw.base.service.gw.ZjxlGwService;
import com.yihu.jw.entity.base.gw.BaseHomePageDO;
import com.yihu.jw.entity.base.gw.BaseRulesDO;
import com.yihu.jw.entity.base.gw.BaseWebInfoDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
 * Created by yeshijie on 2022/2/21.
 */
@RestController
@RequestMapping(value = "/zjxlGw")
@Api(value = "公司官网", tags = {"公司官网"})
public class ZjxlGwEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ZjxlGwService zjxlGwService;
    @Autowired
    private BaseHomePageService baseHomePageService;
    @Autowired
    private BaseWebInfoService baseWebInfoService;
    @Autowired
    private BaseRulesService baseRulesService;
    @Autowired
    private KnowledgeArticleService knowledgeArticleService;
    @GetMapping(value = "searchKnowledgePageList")
    @ApiOperation(value = "获取文章列表")
    public Envelop searchKnowledgePageList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
            @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
            @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            List<KnowledgeArticleDictDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
            List<KnowledgeArticleDictDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
            JSONObject result = new JSONObject();
            result.put("total",totals.size());
            result.put("detailModelList",list);
            return success(result);
        }catch (Exception e){
            return failedException(e);
        }
    }
    @PostMapping(value = "addOrUpdRules")
    @ApiOperation(value = "创建或修改制度")
    public Envelop addOrUpdRules(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData){
        try {
            BaseRulesDO baseRulesDO = toEntity(jsonData, BaseRulesDO.class);
            if(baseRulesDO.getCreateTime()==null){
                baseRulesDO.setCreateTime(new Date());
            }
            baseRulesService.save(baseRulesDO);
            return success("操作成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("操作失败");
        }
    }
    @PostMapping(value = "deleteRules")
    @ApiOperation(value = "删除制度")
    public Envelop deleteRules(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        try {
            baseRulesService.delete(ids.split(","));
            return success("删除成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("删除失败");
        }
    }
    @GetMapping(value = "rulesPage")
    @ApiOperation(value = "获取制度分页")
    public PageEnvelop<BaseRulesDO> rulesPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) {
        try {
            List<BaseRulesDO> baseOrgs = baseRulesService.search(fields, filters, sorts, page, size);
            int count = (int) baseRulesService.getCount(filters);
            return success(baseOrgs, count, page, size, BaseRulesDO.class);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findRulesById")
    @ApiOperation(value = "根据id查询制度")
    public ObjEnvelop findRulesById (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id){
        try {
            BaseRulesDO baseRulesDO = zjxlGwService.findRulesById(id);
            return ObjEnvelop.getSuccess("查询成功",baseRulesDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findWebInfo")
    @ApiOperation(value = "网页基本信息")
    public ObjEnvelop findWebInfo(){
        try {
            BaseWebInfoDO webInfoDO = zjxlGwService.findWebInfo();
            return ObjEnvelop.getSuccess("查询成功",webInfoDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @PostMapping(value = "addOrUpdWebInfo")
    @ApiOperation(value = "创建或修改网页基本信息")
    public Envelop addOrUpdWebInfo(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData){
        try {
            BaseWebInfoDO webInfoDO = toEntity(jsonData, BaseWebInfoDO.class);
            if(webInfoDO.getCreateTime()==null){
                webInfoDO.setCreateTime(new Date());
            }
            baseWebInfoService.save(webInfoDO);
            return success("操作成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("操作失败");
        }
    }
    @PostMapping(value = "addOrUpdHomePage")
    @ApiOperation(value = "创建或修改首页")
    public Envelop addOrUpdHomePage(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData){
        try {
            BaseHomePageDO baseHomePageDO = toEntity(jsonData, BaseHomePageDO.class);
            if(baseHomePageDO.getCreateTime()==null){
                baseHomePageDO.setCreateTime(new Date());
            }
            baseHomePageService.save(baseHomePageDO);
            return success("操作成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("操作失败");
        }
    }
    @PostMapping(value = "deleteHomePage")
    @ApiOperation(value = "删除首页")
    public Envelop deleteHomePage(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        try {
            baseHomePageService.delete(ids.split(","));
            return success("删除成功");
        }catch (Exception e){
            e.printStackTrace();
            return failed("删除失败");
        }
    }
    @GetMapping(value = "homePagePage")
    @ApiOperation(value = "获取制度分页")
    public PageEnvelop<BaseHomePageDO> homePagePage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) {
        try {
            List<BaseHomePageDO> homePageDOS = baseHomePageService.search(fields, filters, sorts, page, size);
            for (BaseHomePageDO homePageDO:homePageDOS){
                if(StringUtils.isNotBlank(homePageDO.getArticleId())){
                    KnowledgeArticleDictDO articleDictDO = knowledgeArticleService.findById(homePageDO.getArticleId());
                    if(articleDictDO!=null){
                        homePageDO.setArticleTitle(articleDictDO.getTitle());
                    }
                }
            }
            int count = (int) baseHomePageService.getCount(filters);
            return success(homePageDOS, count, page, size, BaseHomePageDO.class);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findHomePageById")
    @ApiOperation(value = "根据id查询首页")
    public ObjEnvelop findHomePageById (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id){
        try {
            BaseHomePageDO homePageDO = zjxlGwService.findHomePageById(id);
            if(StringUtils.isNotBlank(homePageDO.getArticleId())){
                KnowledgeArticleDictDO articleDictDO = knowledgeArticleService.findById(homePageDO.getArticleId());
                if(articleDictDO!=null){
                    homePageDO.setArticleTitle(articleDictDO.getTitle());
                }
            }
            return ObjEnvelop.getSuccess("查询成功",homePageDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
}

+ 155 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/gw/ZjxlGwOpenEndpoint.java

@ -0,0 +1,155 @@
package com.yihu.jw.base.endpoint.gw;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.service.article.KnowledgeArticleService;
import com.yihu.jw.base.service.gw.BaseHomePageService;
import com.yihu.jw.base.service.gw.BaseRulesService;
import com.yihu.jw.base.service.gw.BaseWebInfoService;
import com.yihu.jw.base.service.gw.ZjxlGwService;
import com.yihu.jw.entity.base.gw.BaseHomePageDO;
import com.yihu.jw.entity.base.gw.BaseRulesDO;
import com.yihu.jw.entity.base.gw.BaseWebInfoDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
 * Created by yeshijie on 2022/2/21.
 */
@RestController
@RequestMapping(value = "open/zjxlGw")
@Api(value = "公司官网-前端", tags = {"公司官网-前端"})
public class ZjxlGwOpenEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ZjxlGwService zjxlGwService;
    @Autowired
    private BaseHomePageService baseHomePageService;
    @Autowired
    private BaseRulesService baseRulesService;
    @Autowired
    private KnowledgeArticleService knowledgeArticleService;
    @GetMapping(value = "searchKnowledgePageList")
    @ApiOperation(value = "获取文章列表")
    public Envelop searchKnowledgePageList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
            @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
            @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            List<KnowledgeArticleDictDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
            List<KnowledgeArticleDictDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
            JSONObject result = new JSONObject();
            result.put("total",totals.size());
            result.put("detailModelList",list);
            return success(result);
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value = "rulesPage")
    @ApiOperation(value = "获取制度分页")
    public PageEnvelop<BaseRulesDO> rulesPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) {
        try {
            List<BaseRulesDO> baseOrgs = baseRulesService.search(fields, filters, sorts, page, size);
            int count = (int) baseRulesService.getCount(filters);
            return success(baseOrgs, count, page, size, BaseRulesDO.class);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findRulesById")
    @ApiOperation(value = "根据id查询制度")
    public ObjEnvelop findRulesById (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id){
        try {
            BaseRulesDO baseRulesDO = zjxlGwService.findRulesById(id);
            return ObjEnvelop.getSuccess("查询成功",baseRulesDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findWebInfo")
    @ApiOperation(value = "网页基本信息")
    public ObjEnvelop findWebInfo(){
        try {
            BaseWebInfoDO webInfoDO = zjxlGwService.findWebInfo();
            return ObjEnvelop.getSuccess("查询成功",webInfoDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "homePagePage")
    @ApiOperation(value = "获取制度分页")
    public PageEnvelop<BaseHomePageDO> homePagePage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) {
        try {
            List<BaseHomePageDO> homePageDOS = baseHomePageService.search(fields, filters, sorts, page, size);
            int count = (int) baseHomePageService.getCount(filters);
            return success(homePageDOS, count, page, size, BaseHomePageDO.class);
        }catch (Exception e){
            e.printStackTrace();
            return PageEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "findHomePageById")
    @ApiOperation(value = "根据id查询首页")
    public ObjEnvelop findHomePageById (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id){
        try {
            BaseHomePageDO baseHomePageDO = zjxlGwService.findHomePageById(id);
            return ObjEnvelop.getSuccess("查询成功",baseHomePageDO);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
}

+ 55 - 55
svr/svr-base/src/main/java/com/yihu/jw/base/filter/XssAndHttpServletRequestWrapper.java

@ -1,55 +1,55 @@
package com.yihu.jw.base.filter;
import com.yihu.jw.util.XssUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
/**
 * Created by yeshijie on 2020/8/27.
 */
public class XssAndHttpServletRequestWrapper extends HttpServletRequestWrapper {
    HttpServletRequest request;
    public XssAndHttpServletRequestWrapper(HttpServletRequest request) {
        super(request);
        this.request = request;
    }
    @Override
    public String getParameter(String name) {
        String value = super.getParameter(name);
        // System.out.println("name:" + name + "," + value);
        if (value != null) {
            // 转换Html
            value = XssUtil.cleanXss(value);
        }
        return value;
    }
    @Override
    public String getHeader(String name) {
        return XssUtil.cleanXss(super.getHeader(name));
    }
    @Override
    public String getQueryString() {
        return XssUtil.cleanXss(super.getQueryString());
    }
    @Override
    public String[] getParameterValues(String parameter) {
        String[] values = super.getParameterValues(parameter);
        if (values == null) {
            return null;
        }
        int count = values.length;
        String[] encodedValues = new String[count];
        for (int i = 0; i < count; i++) {
            encodedValues[i] = XssUtil.cleanXss(values[i]);
        }
        return encodedValues;
    }
}
//package com.yihu.jw.base.filter;
//
//
//import com.yihu.jw.util.XssUtil;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletRequestWrapper;
//
///**
// * Created by yeshijie on 2020/8/27.
// */
//public class XssAndHttpServletRequestWrapper extends HttpServletRequestWrapper {
//    HttpServletRequest request;
//
//    public XssAndHttpServletRequestWrapper(HttpServletRequest request) {
//        super(request);
//        this.request = request;
//    }
//
//    @Override
//    public String getParameter(String name) {
//        String value = super.getParameter(name);
//        // System.out.println("name:" + name + "," + value);
//        if (value != null) {
//            // 转换Html
//            value = XssUtil.cleanXss(value);
//        }
//        return value;
//    }
//
//    @Override
//    public String getHeader(String name) {
//        return XssUtil.cleanXss(super.getHeader(name));
//    }
//
//    @Override
//    public String getQueryString() {
//        return XssUtil.cleanXss(super.getQueryString());
//    }
//
//    @Override
//    public String[] getParameterValues(String parameter) {
//        String[] values = super.getParameterValues(parameter);
//        if (values == null) {
//            return null;
//        }
//        int count = values.length;
//        String[] encodedValues = new String[count];
//        for (int i = 0; i < count; i++) {
//            encodedValues[i] = XssUtil.cleanXss(values[i]);
//        }
//        return encodedValues;
//    }
//
//}

+ 25 - 25
svr/svr-base/src/main/java/com/yihu/jw/base/filter/XssFiter.java

@ -1,25 +1,25 @@
package com.yihu.jw.base.filter;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
 * Created by yeshijie on 2020/8/27.
 */
public class XssFiter implements Filter {
    public void init(FilterConfig filterConfig) throws ServletException {
    }
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException {
        HttpServletRequest req = (HttpServletRequest) request;
        XssAndHttpServletRequestWrapper xssRequestWrapper = new XssAndHttpServletRequestWrapper(req);
        chain.doFilter(xssRequestWrapper, response);
    }
    public void destroy() {
    }
}
//package com.yihu.jw.base.filter;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//
///**
// * Created by yeshijie on 2020/8/27.
// */
//public class XssFiter implements Filter {
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
//            throws IOException, ServletException {
//        HttpServletRequest req = (HttpServletRequest) request;
//        XssAndHttpServletRequestWrapper xssRequestWrapper = new XssAndHttpServletRequestWrapper(req);
//        chain.doFilter(xssRequestWrapper, response);
//    }
//
//    public void destroy() {
//
//    }
//}

+ 5 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/article/KnowledgeArticleService.java

@ -145,6 +145,11 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDict
		}
		return false;
	}
	public KnowledgeArticleDictDO findById(String id){
		return knowledgeArticleDictDao.findByIdAndDel(id);
	}
	/**
	 * 更新/保存健康文章
	 * @param jsonData

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseHomePageService.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.service.gw;
import com.yihu.jw.base.dao.gw.BaseHomePageDao;
import com.yihu.jw.entity.base.gw.BaseHomePageDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by yeshijie on 2022/2/21.
 */
@Service
public class BaseHomePageService extends BaseJpaService<BaseHomePageDO, BaseHomePageDao> {
    @Autowired
    private BaseHomePageDao baseHomePageDao;
}

+ 18 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseRulesService.java

@ -0,0 +1,18 @@
package com.yihu.jw.base.service.gw;
import com.yihu.jw.base.dao.gw.BaseRulesDao;
import com.yihu.jw.entity.base.gw.BaseRulesDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by yeshijie on 2022/2/21.
 */
@Service
public class BaseRulesService extends BaseJpaService<BaseRulesDO, BaseRulesDao> {
    @Autowired
    private BaseRulesDao baseRulesDao;
}

+ 20 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/BaseWebInfoService.java

@ -0,0 +1,20 @@
package com.yihu.jw.base.service.gw;
import com.yihu.jw.base.dao.gw.BaseWebInfoDao;
import com.yihu.jw.entity.base.gw.BaseWebInfoDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by yeshijie on 2022/2/21.
 */
@Service
public class BaseWebInfoService extends BaseJpaService<BaseWebInfoDO, BaseWebInfoDao> {
    @Autowired
    private BaseWebInfoDao baseWebInfoDao;
}

+ 44 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/gw/ZjxlGwService.java

@ -0,0 +1,44 @@
package com.yihu.jw.base.service.gw;
import com.yihu.jw.base.dao.gw.BaseHomePageDao;
import com.yihu.jw.base.dao.gw.BaseRulesDao;
import com.yihu.jw.base.dao.gw.BaseWebInfoDao;
import com.yihu.jw.entity.base.gw.BaseHomePageDO;
import com.yihu.jw.entity.base.gw.BaseRulesDO;
import com.yihu.jw.entity.base.gw.BaseWebInfoDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * 公司官网
 * Created by yeshijie on 2022/2/21.
 */
@Service
public class ZjxlGwService {
    @Autowired
    private BaseHomePageDao baseHomePageDao;
    @Autowired
    private BaseWebInfoDao baseWebInfoDao;
    @Autowired
    private BaseRulesDao baseRulesDao;
    public BaseRulesDO findRulesById(String id){
        return baseRulesDao.findOne(id);
    }
    public BaseHomePageDO findHomePageById(String id){
        return baseHomePageDao.findOne(id);
    }
    public BaseWebInfoDO findWebInfo(){
        List<BaseWebInfoDO> list = baseWebInfoDao.findAll();
        if(list.size()>0){
            return list.get(0);
        }
        return null;
    }
}

+ 6 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/NetworkCardConfig.java

@ -17,6 +17,7 @@ public class NetworkCardConfig {
    public static final String appid="571AIOT2021072910102922281";
    public static final String password="OnXE@QFlwt9R";
    public static final String redisKey="dianXinAssesToken";
    public static final String flowGroupId= "9911000019265335";//流量池群组
    //APPID+YYYYMMDDHHMISS+8位数字序列
    public static String getTransid() {
@ -31,4 +32,9 @@ public class NetworkCardConfig {
    public static final String setPatientContacts="https://api.iot.10086.cn/v5/ec/config/member-voice-whitelist";
    //查询语音卡 群组Id
    public static final String getGroupId="https://api.iot.10086.cn/v5/ec/query/group-by-member";
    //获取流量池使用量
    public static final String getGroupFlowUsage="https://api.iot.10086.cn/v5/ec/query/group-data-usage";
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/device/PatientDeviceDao.java

@ -55,7 +55,7 @@ public interface PatientDeviceDao extends PagingAndSortingRepository<DevicePatie
    @Query("select a from DevicePatientDevice a")
    List<DevicePatientDevice> findAll();
    @Query("select a from DevicePatientDevice a group by a.user")
    @Query("select a from DevicePatientDevice a where a.del=0  group by a.user")
    List<DevicePatientDevice> findAllGroupUser();
    @Query("select a from DevicePatientDevice a where a.categoryCode = ?1 and a.del=0 group by a.user")

+ 9 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/family/FamilyMemberEndpoint.java

@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -95,9 +96,9 @@ public class FamilyMemberEndpoint extends EnvelopRestEndpoint {
    public Envelop addOlderByRelatives(
            @ApiParam(name = "relatives",value = "家属code")
            @RequestParam("relatives") String relatives,
            @ApiParam(name = "name",value = "老人姓名")
            @ApiParam(name = "name",value = "老人/幼儿 姓名")
            @RequestParam("name") String name,
            @ApiParam(name = "idcard",value = "老人身份证")
            @ApiParam(name = "idcard",value = "老人/幼儿 身份证")
            @RequestParam("idcard") String idcard,
            @RequestParam(value = "relation",defaultValue = "0") Integer relation,
@ -107,14 +108,17 @@ public class FamilyMemberEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "relativesIdcard",value = "家属本人身份证")
            @RequestParam(value = "relativesIdcard",required = false) String relativesIdcard,
            @ApiParam(name = "relativesSex",value = "家属本人性别")
            @RequestParam(value = "relativesSex",required = false) String relativesSex
            /**********************/) {
            @RequestParam(value = "relativesSex",required = false) String relativesSex,
            /**********************/
            @ApiParam(name = "type",value = "类型  1老人   2幼儿")
            @RequestParam(value = "type",required = true) Integer type
            ) {
        try {
            if (StringUtils.isEmpty(relatives)) {
                return failed("当前用户信息错误",-1);
            }
            JSONObject result = familyMemberService.addOlderByRelatives(relatives,name,idcard,relation,relativesName,relativesIdcard,relativesSex);
            JSONObject result = familyMemberService.addOlderByRelatives(relatives,name,idcard,relation,relativesName,relativesIdcard,relativesSex,type);
            if (result.getInteger(ResponseContant.resultFlag)==ResponseContant.success){
                return success("添加成功");
            }else {

+ 31 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -349,13 +349,27 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
        }
    }
    @ApiOperation("获取行动轨迹")
    @RequestMapping(value = "getX1Locations",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public ObjEnvelop getX1Locations(@ApiParam(name = "patient",value = "patient")
                                     @RequestParam(value = "patient")String patient,
                                     @ApiParam(name = "date",value = "date")
                                     @RequestParam(value = "date")String date){
        try {
            return ObjEnvelop.getSuccess("查询成功",securityMonitoringOrderService.getX1Locations(patient,date));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
    @ApiOperation("助老员端获取日常监护居民")
    @GetMapping(value = "findMonitorPatientsByDoctor")
    @ResponseBody
    public ObjEnvelop findMonitorPatientsByDoctor(@ApiParam(name = "doctor",  required = true)@RequestParam(value = "doctor")String doctor,
                                                  @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典,actionTrack行动轨迹", required = true)
                                                  @RequestParam(value = "topicItem",required = true,defaultValue = "preventLost") String topicItem,
                                                  @ApiParam(name = "day", value = "day", required = false)
                                                      @ApiParam(name = "day", value = "day", required = false)
                                                  @RequestParam(value = "day",required = false) String day,
                                                  @ApiParam(name = "page")
                                                  @RequestParam(value = "page",required = false) Integer page,
@ -404,6 +418,22 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("know")
    @ApiOperation(value = "我已知悉")
    @ObserverRequired
    public Envelop know(
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "doctor", name = "doctor")
            @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            securityMonitoringOrderService.know(doctor, orderId);
            return ObjEnvelop.getSuccess("操作成功");
        } catch (Exception e) {
            return failedException2(e);
        }
    }
    @PostMapping(value = "updateDoctorLocation")
    @ApiOperation(value = "更新医生定位信息")
    @ObserverRequired

+ 56 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.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.endpoint.BaseController;
import com.yihu.jw.care.service.device.NetworkCardService;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.service.security.SecurityMonitoringOrderService;
import com.yihu.jw.care.service.statistics.DetectionPlatformService;
@ -40,6 +41,8 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    private PatientDeviceService patientDeviceService;
    @Autowired
    private SecurityMonitoringOrderService securityMonitoringOrderService;
    @Autowired
    private NetworkCardService networkCardService;
    @ApiOperation("环境信息")
@ -326,4 +329,57 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
        }
    }
    @ApiOperation("获取本月流量池使用信息")
    @ResponseBody
    @RequestMapping(value = "getFlowPoolInfo", method = RequestMethod.GET)
    public ObjEnvelop getPatientContacts() {
        try {
            return ObjEnvelop.getSuccess("查询成功", networkCardService.getFlowPoolInfo());
        } catch (Exception e) {
           return failedObjEnvelopException2(e);
        }
    }
    @ApiOperation("获取流量/语音使用趋势--折线")
    @ResponseBody
    @RequestMapping(value = "getFlowVoiceLineInfo", method = RequestMethod.GET)
    public ListEnvelop getFlowVoiceLineInfo(@ApiParam(name="type",value = "1月2日")
                                       @RequestParam(value ="type",required = true)String type,
                                       @ApiParam(name="data",value = "flow,voice")
                                       @RequestParam(value ="data",required = true)String data,
                                       @ApiParam(name="size",value = "返回大小")
                                       @RequestParam(value ="size",required = true)Integer size) {
        try {
            return ListEnvelop.getSuccess("查询成功",networkCardService.getFlowVoiceLineInfo(type,data,size));
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
    @ApiOperation("获取流量/语音使用总数据表格-从统计初至今")
    @ResponseBody
    @RequestMapping(value = "getSimFlowVoiceLineInfo", method = RequestMethod.GET)
    public ListEnvelop getSimFlowVoiceLineInfo(@ApiParam(name="type",value = "1月2日")
                                            @RequestParam(value ="type",required = true)String type,
                                            @ApiParam(name="data",value = "flow,voice")
                                            @RequestParam(value ="data",required = true)String data,
                                            @ApiParam(name="day",value = "")
                                            @RequestParam(value ="day",required = false)String day) {
        try {
            return ListEnvelop.getSuccess("查询成功",networkCardService.getSimFlowVoiceLineInfo(type,data,day));
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
    @ApiOperation("获取物联卡数量")
    @ResponseBody
    @RequestMapping(value = "getSimCounts", method = RequestMethod.GET)
    public ListEnvelop getSimCounts() {
        try {
            return ListEnvelop.getSuccess("查询成功",networkCardService.getSimCounts());
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
}

+ 4 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/admin/AdminDoorCoachOrderService.java

@ -771,7 +771,7 @@ public class AdminDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOrde
        // 派单时,把医生拉入会话,作为其中一个成员,医生拒单时,退出会话
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getType();
        imUtill.updateParticipantNew(sessionId,doctor,null);
        if (!dispatcher.equals("System")){
            messageUtil.updateDoorCoachMessage(doorServiceOrderDO,new String[]{"702","703","730","735"},"731",dispatcher,dispatcher);
@ -854,7 +854,7 @@ public class AdminDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOrde
        // 派单时,把医生拉入会话,作为其中一个成员,医生拒单时,退出会话
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getType();
        imUtill.updateParticipantNew(sessionId,doctor,null);
        messageUtil.updateDoorCoachMessage(doorServiceOrderDO,new String[]{"702","703","730","735"},"731",dispatcher,dispatcher);
@ -1123,7 +1123,7 @@ public class AdminDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOrde
            return result;
        }
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = orderDO.getPatient() + "_" + consult.getId() + "_"  + orderDO.getNumber() +  "_" +  consult.getType();
        String sessionId = orderDO.getPatient() +  "_" +  consult.getType();
        // 把调度员拉入会话,作为其中一个成员,第一个进入会话的调度员,系统发送欢迎语和居民的预约卡片信息
        if (org.apache.commons.lang3.StringUtils.isEmpty(orderDO.getDispatcher())) {
            orderDO.setDispatcher(dispatcher);
@ -1469,7 +1469,7 @@ public class AdminDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOrde
            //获取咨询
            ConsultDo consult = consultDao.queryByRelationCode(id);
            if (null != consult) {
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" + consult.getId() + "_"  + doorServiceOrder.getNumber() +  "_" +  consult.getType());
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" +  consult.getType());
            }
            object.put("sessionId",doorServiceOrder.getSessionId());

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

@ -382,10 +382,18 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        emergencyOrderVO.setSex(patientDO.getSex());
        emergencyOrderVO.setPhone(assistanceDO.getPatientPhone());
        emergencyOrderVO.setOrderType(20);
        emergencyOrderVO.setKnow(0);
        List<BaseEmergencyWarnLogDO> logDOS = logDao.findByOrderIdOrderByCreateTimeDesc(assistanceDO.getId());
        for (BaseEmergencyWarnLogDO tmp:logDOS){
            tmp.setTimeInfo(DateUtil.getDifferentTimeInfo(new Date(),tmp.getCreateTime(),0));
            //判断当前社工是否知悉
            if(tmp.getUserCode().equals(doctor)){
                BaseDoctorDO baseDoctorDO = doctorDao.findById(doctor);
                String tmpContent = "社工" + baseDoctorDO.getName() + "已知悉";
                if(tmpContent.equals(tmp.getContent())){
                    emergencyOrderVO.setKnow(1);
                }
            }
        }
        if (logDOS.size()==0&&1==emergencyOrderVO.getStatus()){//未响应
            emergencyOrderVO.setOverTimeNotResponse(DateUtil.getDifferentTimeInfo1(new Date(),assistanceDO.getCreateTime()));
@ -569,7 +577,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        //获取咨询
        ConsultDo consult = consultDao.queryByRelationCode(orderID);
        if (null != consult) {
            String sessionId = assistanceDO.getPatient() + "_" + consult.getId() + "_" + consult.getType();
            String sessionId = assistanceDO.getPatient() + "_" + consult.getType();
            jsonObject.put("sessionId",sessionId);
            if (1==assistanceDO.getStatus()&&StringUtils.isNotBlank(doctor)){//查询未读数量
                try {
@ -586,6 +594,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            jsonObject.put("sessionId",null);
            jsonObject.put("UnRead",0);
        }
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg,jsonObject);
        return result;

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

@ -497,7 +497,7 @@ public class ConsultTeamService {
        }
        ConsultDo consult = consultDao.findOne(consultTeam.getConsult());
        String sessionId = patient+ "_" + consultTeam.getConsult() + "_" + consultTeam.getType();
        String sessionId = patient + consultTeam.getType();
        String operatorId = endOperator;
        String operatorName=null;
        if (endType==1){

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/contacts/ContactsService.java

@ -248,8 +248,8 @@ public class ContactsService {
                    }
                }
                String[] numTmp = num.split("_");
                String sql = " select pd.device_sn,wd.sim from  wlyy_patient_device pd inner join wlyy_devices wd  " +
                        "on pd.device_sn = wd.device_code and pd.del=0 and wd.sim is not null and pd.category_code in('7','4')  " +
                String sql = " select pd.device_sn,wd.iccid from  wlyy_patient_device pd inner join wlyy_devices wd  " +
                        "on pd.device_sn = wd.device_code and pd.del=0 and wd.iccid is not null and pd.category_code in('7','4')  " +
                        "where pd.user='"+patient+"' ";
                List<Map<String,Object>> sims = jdbcTemplate.queryForList(sql);
                //修改

+ 59 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/NetworkCardService.java

@ -10,17 +10,21 @@ import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.bouncycastle.math.ec.custom.sec.SecT409R1Curve;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@ -33,6 +37,8 @@ public class NetworkCardService {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private HttpClientUtilCare httpClientUtil;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 获取电信物联网卡assesToken
@ -147,4 +153,57 @@ public class NetworkCardService {
        return null;
    }
    /**
     * 获取本月流量池使用信息(实时)
     * @return
     * @throws
     */
    public String getFlowPoolInfo() throws Exception {
        List<NameValuePair> params = new ArrayList<>();
        String useAmount = "";
        params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
        params.add(new BasicNameValuePair("token", getAccessToken()));
        params.add(new BasicNameValuePair("groupId", NetworkCardConfig.flowGroupId));
        String response = httpClientUtil.get("https://api.iot.10086.cn/v5/ec/query/group-data-usage",params,"UTF-8");
//        {"status":"0","message":"正确","result":[{"useAmount":"2507595.00"}]}  单位KB  1GB=1024MB 1MB=1024KB
        JSONObject responseBody = JSONObject.parseObject(response);
        if ("0".equals(responseBody.getString("status"))){
            useAmount= responseBody.getJSONArray("result").getJSONObject(0).getString("useAmount");
        }else{
            throw new Exception("流量池接口查询失败");
        }
        return useAmount;
    }
    public List<Map<String,Object>> getFlowVoiceLineInfo(String type,String data,Integer size){
        String sql = "";
        if ("flow".equals(data)){
            sql = " select  sum(`VALUE`) value,day,type from wlyy_sims_flow where type="+type+" GROUP BY day,type ORDER BY day desc limit "+size;
        }if ("voice".equals(data)){
            sql = " select  sum(`VALUE`) value,day,type from wlyy_sims_voices where type="+type+" GROUP BY day,type ORDER BY day desc limit "+size;
        }
        return jdbcTemplate.queryForList(sql);
    }
    public List<Map<String,Object>> getSimFlowVoiceLineInfo(String type,String data,String day){
        String sql = "";
        String sqlFilter = " ";
        if (StringUtils.isNotBlank(day)){
            sqlFilter += " and day='"+day+"' ";
        }
        if ("flow".equals(data)){
            sql = " select msisdn,sum(value) value,type from wlyy_sims_flow where type="+type+" ";
        }if ("voice".equals(data)){
            sql = " select msisdn,sum(value) value,type from wlyy_sims_voices where type="+type+" ";
        }
        sql += sqlFilter+" GROUP BY msisdn ";
        return jdbcTemplate.queryForList(" select * from ("+sql+")A order by value desc ");
    }
    public List<Map<String,Object>> getSimCounts(){
        String sql = " select dict_value,dict_code from wlyy_hospital_sys_dict where dict_name='WLYY_SIM' ";
        return jdbcTemplate.queryForList(sql);
    }
}

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

@ -160,7 +160,7 @@ public class DoctorDoorCoachOrderService {
        //获取咨询
        ConsultDo consult = consultDao.queryByRelationCode(id);
        if (null != consult) {
            doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" + consult.getId() + "_"  + doorServiceOrder.getNumber() +  "_" +  consult.getType());
            doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" +  consult.getType());
        }
        // 设置服务小结
@ -358,7 +358,7 @@ public class DoctorDoorCoachOrderService {
            //获取咨询
            ConsultDo consult = consultDao.queryByRelationCode(id);
            if (null != consult) {
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" + consult.getId() + "_"  + doorServiceOrder.getNumber() +  "_" +  consult.getType());
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" +  consult.getType());
            }
            object.put("sessionId",doorServiceOrder.getSessionId());
@ -433,7 +433,7 @@ public class DoctorDoorCoachOrderService {
            consultTeam.setDoctorName(doorServiceOrder.getDoctorName());
            consultTeamDao.save(consultTeam);
            String sessionId = doorServiceOrder.getPatient() + "_" + consultTeam.getConsult() + "_" + doorServiceOrder.getNumber() + "_" + consultTeam.getType();
            String sessionId = doorServiceOrder.getPatient() + "_" + consultTeam.getType();
            //成功创建服务工单后,居民所在机构调度员向居民发起一条通知服务消息
            // 发送IM消息通知患者医生已接单

+ 4 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java

@ -763,7 +763,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        // 派单时,把医生拉入会话,作为其中一个成员,医生拒单时,退出会话
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getType();
        imUtill.updateParticipantNew(sessionId,doctor,null);
        messageUtil.updateDoorCoachMessage(doorServiceOrderDO,new String[]{"702","703","730","735"},"731",dispatcher,dispatcher);
@ -842,7 +842,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        // 派单时,把医生拉入会话,作为其中一个成员,医生拒单时,退出会话
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getId() + "_" + doorServiceOrderDO.getNumber() + "_" + consult.getType();
        String sessionId = doorServiceOrderDO.getPatient() + "_" + consult.getType();
        imUtill.updateParticipantNew(sessionId,doctor,null);
        messageUtil.updateDoorCoachMessage(doorServiceOrderDO,new String[]{"702","703","730","735"},"731",dispatcher,dispatcher);
@ -1112,7 +1112,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            return result;
        }
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        String sessionId = orderDO.getPatient() + "_" + consult.getId() + "_"  + orderDO.getNumber() +  "_" +  consult.getType();
        String sessionId = orderDO.getPatient() + "_" +  consult.getType();
        // 把调度员拉入会话,作为其中一个成员,第一个进入会话的调度员,系统发送欢迎语和居民的预约卡片信息
        if (org.apache.commons.lang3.StringUtils.isEmpty(orderDO.getDispatcher())) {
            orderDO.setDispatcher(dispatcher);
@ -1458,7 +1458,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            //获取咨询
            ConsultDo consult = consultDao.queryByRelationCode(id);
            if (null != consult) {
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" + consult.getId() + "_"  + doorServiceOrder.getNumber() +  "_" +  consult.getType());
                doorServiceOrder.setSessionId(doorServiceOrder.getPatient() +  "_" +  consult.getType());
            }
            object.put("sessionId",doorServiceOrder.getSessionId());

+ 36 - 7
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/family/PatientFamilyMemberService.java

@ -221,7 +221,7 @@ public class PatientFamilyMemberService extends BaseJpaService<BasePatientFamily
        return 1;
    }
    public JSONObject addOlderByRelatives(String relatives,String name,String idcard,Integer relation,String relativesName,String relativesIdcard,String relativesSex) throws Exception {
    public JSONObject addOlderByRelatives(String relatives,String name,String idcard,Integer relation,String relativesName,String relativesIdcard,String relativesSex,Integer type) throws Exception {
        JSONObject result = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(relatives);
@ -255,13 +255,42 @@ public class PatientFamilyMemberService extends BaseJpaService<BasePatientFamily
            return result;
        }
        List<BasePatientDO> addPatients = patientDao.findByNameAndIdcard(name,idcard);
        if (addPatients.size()==0){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"添加成员不存在");
            return result;
        BasePatientDO addPatient = new BasePatientDO();
        if (2  == type){
            if (addPatients.size()==0){
                BasePatientDO basePatientDO = new BasePatientDO();
                String salt = UUID.randomUUID().toString().substring(0, 5);
                String pw = "";
                if(idcard.length()!=18){
                    pw = idcard.substring(idcard.length()-7,idcard.length()-1);
                }else{
                    pw = idcard.substring(idcard.length()-6);
                }
                basePatientDO.setIdcard(idcard);
                basePatientDO.setName(name);
                basePatientDO.setPassword(com.yihu.utils.security.MD5.md5Hex(pw + "{" + salt + "}"));
                basePatientDO.setSalt(salt);
                basePatientDO.setArchiveType(2);
                basePatientDO.setArchiveStatus(3);
                basePatientDO.setCreateUserName(relatives);
                basePatientDO.setCreateTime(new Date());
                basePatientDO.setDel("1");
                basePatientDO.setLocked(0);
                basePatientDO.setEnabled(1);
                patientDao.save(basePatientDO);
                addPatient = basePatientDO;
            }else {
                addPatient = addPatients.get(0);
            }
        }else {
            if (addPatients.size()==0){
                result.put(ResponseContant.resultFlag,ResponseContant.fail);
                result.put(ResponseContant.resultMsg,"添加成员不存在");
                return result;
            }
            addPatient = addPatients.get(0);
        }
        BasePatientDO addPatient = addPatients.get(0);
        // 添加自己与对方的关系
        BasePatientFamilyMemberDO fm = memberDao.findByPatientAndFamilyMember(patientDO.getId(), addPatient.getId());
        // 家庭关系已存在时,不重复添加

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

@ -112,7 +112,7 @@ public class PatientMessageService {
            patient +=",'"+agent+"'";
        }
        String sql = " select A.*,B.notRead from " +
                "(select  count(1) as 'all',type,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') create_time " +
                "(select  count(1) as 'all',type,DATE_FORMAT(MAX(create_time),'%Y-%m-%d %H:%i:%S') create_time " +
                "from base_system_message where receiver in("+patient+") and del=1  GROUP BY type ORDER BY create_time desc)A " +
                "LEFT JOIN (select count(1) notRead,type " +
                "from base_system_message where receiver in("+patient+") and (is_read=0 or is_read is null ) and del=1  GROUP BY type)B on A.type = B.type " +

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

@ -559,6 +559,14 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            re.put("helperTotal",findHelperTotal(name,filter));
        }
        if("5".equals(type)||StringUtils.isBlank(type)){//老人家属
            filter = "";
            String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_olderRelative' ";
            List<Map<String,Object>> listtmp =  jdbcTemplate.queryForList(sqltmp);
            if(listtmp.size()>0){
                String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
                orgCodes = orgCodes.replaceAll(",","','");
                filter = " and t2.id not in ('"+orgCodes+"')";
            }
            List<Map<String,Object>> list = findOlderFamily(name,limit,filter);
            re.put("oldFamily",list);
            re.put("oldFamilyCount",findOlderFamilyTotal(name,filter));
@ -738,11 +746,11 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        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 ";
                "where t2.archive_type=3 and t2.del=1 and t3.archive_type=1 and t3.del=1 ";
        if (StringUtils.isNotBlank(name)){
            sql += " and t3.name like '%"+name+"%'";
            sql += " and t3.name like '%"+name+"%' ";
        }
        sql += fileter + "GROUP BY t2.id,t1.patient ";
        sql += fileter + " GROUP BY t2.id,t1.patient ORDER BY online desc ";
        sql += limit;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object>tmp:list){
@ -755,9 +763,9 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        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 ";
                "where t2.archive_type=3 and t2.del=1 and t3.archive_type=1 and t3.del=1 ";
        if (StringUtils.isNotBlank(name)){
            sql += " and t3.name like '%"+name+"%'";
            sql += " and t3.name like '%"+name+"%' ";
        }
        sql += fileter +" group by t2.id,t1.patient ";
        String sqlCount = "SELECT count(*) from ( "+sql+")A";

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/safeArea/SafeAreaService.java

@ -47,7 +47,7 @@ public class SafeAreaService {
        String sql = " select p.id,p.name,p.sex,p.photo,TIMESTAMPDIFF(year,p.birthday,now()) as age,ac.manage_status manageStatus " +
                " from wlyy_patient_safe_area_confirm ac INNER JOIN base_patient p on ac.patient = p.id where ac.doctor_code='"+doctor+"' ";
        if (null != manageStatus){
            sql += " and ac.manage_status ";
            sql += " and ac.manage_status = '"+manageStatus+"' ";
        }
        sql += "GROUP BY p.id ";
        return jdbcTemplate.queryForList(sql);

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

@ -11,6 +11,7 @@ import com.yihu.jw.care.dao.team.BaseTeamMemberDao;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.consult.ConsultTeamService;
import com.yihu.jw.care.service.contacts.ContactsService;
import com.yihu.jw.care.service.device.DeviceService;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.service.device.YsDeviceService;
import com.yihu.jw.care.service.doctor.DoctorServicePermissionsService;
@ -46,6 +47,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.entity.EntityUtils;
import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import com.yihu.mysql.query.BaseJpaService;
import jdk.nashorn.internal.runtime.FindProperty;
import org.apache.commons.lang3.StringUtils;
@ -139,6 +141,10 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    private BaseOrgDao orgDao;
    @Autowired
    private DeviceDetailDao deviceDetailDao;
    @Autowired
    private HealthIndexUtil healthIndexUtil;
    @Autowired
    private DeviceService deviceService;
    private Logger logger = LoggerFactory.getLogger(SecurityMonitoringOrderService.class);
@ -583,7 +589,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        //获取咨询
        ConsultDo consult = consultDao.queryByRelationCode(orderID);
        if (null != consult) {
            String sessionId = orderDO.getPatient() + "_" + consult.getId() + "_" + consult.getType();
            String sessionId = orderDO.getPatient() + "_" + consult.getType();
            jsonObject.put("sessionId", sessionId);
            if (1 == orderDO.getStatus() && StringUtils.isNotBlank(doctor)) {//查询未读数量
                try {
@ -709,10 +715,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    break;
            }
            if (StringUtils.isNotBlank(doctor)) {//日常监护医生必传
                fliter += " and EXISTS( SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " +
                        " p.openid,p.sex,p.pad_imei padImei " +
                        " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                        " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                fliter += " and EXISTS( SELECT 1 " +
                        " from  base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                        " WHERE ord.patient = CONVERT(sr.patient USING utf8) and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                        " and m.doctor_code = '" + doctor + "' and m.del = '1' ) ";
                fliter += " and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
@ -861,10 +866,9 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                    break;
            }
            if (StringUtils.isNotBlank(doctor)) {//日常监护医生必传
                fliter += " and EXISTS( SELECT DISTINCT p.id,p.name,p.residential_area residentialArea,p.photo,p.idcard,p.mobile, " +
                        " p.openid,p.sex,p.pad_imei padImei " +
                        " from base_patient p , base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                        " WHERE p.id = sr.patient and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                fliter += " and EXISTS( SELECT 1" +
                        " from base_service_package_sign_record sr,base_service_package_record r,base_team_member m  " +
                        " WHERE ord.patient = CONVERT(sr.patient USING utf8) and sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id  " +
                        " and m.doctor_code = '" + doctor + "' and m.del = '1' ) ";
                fliter += " and EXISTS (select 1 from wlyy_patient_device pd INNER JOIN dm_device dd on pd.device_id = dd.id  " +
@ -978,7 +982,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
//            consultTeam.setDoctorName(doorServiceOrder.getDoctorName());
//            consultTeamDao.save(consultTeam);
//
//            String sessionId = doorServiceOrder.getPatient() + "_" + consultTeam.getConsult() + "_" + doorServiceOrder.getNumber() + "_" + consultTeam.getType();
//            String sessionId = doorServiceOrder.getPatient() + "_" + consultTeam.getType();
//            //成功创建服务工单后,居民所在机构调度员向居民发起一条通知服务消息
//
//            // 发送IM消息通知患者医生已接单
@ -1575,6 +1579,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    /**
     * 老人家属首页实时监护信息
     * 居家状态取手表 无手表缺省
     * 最近 血糖  血压记录
     * 监控
     */
    public JSONObject patientMonitoringInfo2(String patient) {
@ -1642,14 +1647,82 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            result.put("emeAssistance", true);
        }
        List<DevicePatientDevice> devices4 = patientDeviceDao.findByUserAndCategoryCode(patient, "4");//手表
        //手表佩戴
        result.put("wear_flag","");
        result.put("wear_flagName","");
        if (devices4.size() > 0) {
            result = patientSignTopicInfo(result, patient, "preventLost", devices4.get(0).getDeviceSn(), true);
            JSONObject response = patientDeviceService.getAqgDeviceInfo2(devices4.get(0).getDeviceSn());
            //手表佩戴状态
            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")?"未佩戴":"已佩戴");
            }
        }
        patientSignTopicInfo(result, patient, "preventFall", null, true);
        String healthXYSql ="SELECT value1,value2,value3 FROM wlyy_patient_health_index WHERE `user` = '"+patient+"' AND type = 2  ORDER BY record_date DESC LIMIT 1";
        List<Map<String, Object>> XY = jdbcTemplate.queryForList(healthXYSql);
        String healthXTSql ="SELECT value1,value2,value3,value4 FROM wlyy_patient_health_index WHERE `user` = '"+patient+"' AND type = 1  ORDER BY record_date DESC LIMIT 1";
        List<Map<String, Object>> XT = jdbcTemplate.queryForList(healthXTSql);
        if (XY.size()!= 0) {
            for (Map<String, Object> map : XY) {
                //HealthIndexUtil.verifyHealthIndex
                JSONArray jsonArray = healthIndexUtil.verifyHealthIndex(2, null==map.get("value1")?"":map.get("value1").toString(), null==map.get("value2")?"":map.get("value2").toString(), null==map.get("value3")?"":map.get("value3").toString());
                if(jsonArray.size()==0){
                    map.put("value1Index","");
                    map.put("value2Index","");
                    //map.put("value3Index","");
                }else {
                    //收缩压
                    map.put("value1Index",jsonArray.getJSONObject(0).get("error"));
                    //舒张压
                    map.put("value2Index",jsonArray.getJSONObject(1).get("error"));
                    //脉搏
                    //map.put("value3Index",jsonArray.getJSONObject(2).get("error"));
                }
                result.put("xy",map);
            }
        }else {
            result.put("xy",null);
        }
        if (XT.size()!= 0) {
            for (Map<String, Object> map : XT) {
                JSONArray jsonArray = healthIndexUtil.verifyHealthIndex(1, null==map.get("value1")?"":map.get("value1").toString(), null==map.get("value2")?"":map.get("value2").toString());
                if(jsonArray.size()==0){
                    map.put("value1Index","");
                }else {
                    //血糖
                    map.put("value1Index",jsonArray.getJSONObject(0).get("error"));
                }
                result.put("xt",map);
            }
        }else {
            result.put("xt",null);
        }
        String patientDeviceCategoryCode = deviceService.getPatientDeviceCategoryCode(patient);
        result.put("deviceShowInfo",patientDeviceCategoryCode);
        return result;
    }
    //行动轨迹
    public JSONArray getX1Locations(String patient, String date){
        List<DevicePatientDevice> byUserAndCategoryCode = patientDeviceDao.findByUserAndCategoryCode(patient, "4");//手表
        if (byUserAndCategoryCode.size()==0){
            return null;
        }
        JSONArray x1Locations = JSON.parseArray(JSON.toJSONString(patientDeviceService.getX1Locations(byUserAndCategoryCode.get(0).getDeviceSn(), date), SerializerFeature.WriteMapNullValue));
        return x1Locations;
    }
    public void preventLost(JSONObject result, String patient, String deviceSn) {
        //手表与拐杖同时绑定时优先手表,围栏状态其中一个超出围栏即为超出围栏
        try {
@ -2086,6 +2159,23 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        return result;
    }
    /**
     * 我已知悉
     */
    public void know(String doctor,String orderId){
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        if (null != doctorDO) {
            BaseEmergencyWarnLogDO logDO = new BaseEmergencyWarnLogDO();
            logDO.setUserCode(doctor);
            logDO.setUserName(doctorDO.getName());
            logDO.setOrderId(orderId);
            logDO.setUserType(2);
            logDO.setCreateTime(new Date());
            logDO.setContent("社工" + doctorDO.getName() + "已知悉");
            logDao.save(logDO);
        }
    }
    /**
     * 获取居民睡眠计划
     */

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

@ -259,6 +259,9 @@ public class DetectionPlatformService  {
                JSONArray array = new JSONArray();
                JSONObject userObj = new JSONObject();
                userObj.put("patient",patientDevices.get(i).getUser());
                if (null==byId.get(patientDevices.get(i).getUser())){
                    continue;
                }
                userObj.put("patientName",byId.get(patientDevices.get(i).getUser()).get(0).getName());
                userObj.put("patientType",byId.get(patientDevices.get(i).getUser()).get(0).getArchiveType());
                userObj.put("latLon",byId.get(patientDevices.get(i).getUser()).get(0).getLatLon());

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

@ -737,7 +737,15 @@ public class StatisticsService {
        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; ";
        String olderRelativeFilter = "";
        String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_olderRelative' ";
        listtmp =  jdbcTemplate.queryForList(sqltmp);
        if(listtmp.size()>0) {
            String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
            orgCodes = orgCodes.replaceAll(",", "','");
            olderRelativeFilter = " and t2.id not in ('" + orgCodes + "') ";
        }
        sql2 = " select count(id) count,if(openid is null,0,1) online from base_patient t2 where  archive_type=3 and del=1 "+olderRelativeFilter+" 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());
@ -751,7 +759,11 @@ public class StatisticsService {
        }
        olderFamilyTotal = olderFamilyOff+olderFamilyOn;
        //家属绑定老人数量
        olderFamilyBinding = carePatientService.findOlderFamilyTotal(null,"");
        sql2 = " select count(distinct t3.id) total from base_patient t2 left JOIN base_patient_family_member t1 on t1.family_member = t2.id " +
                " Inner join base_patient t3 on t3.id = t1.patient " +
                " where t2.archive_type=3 and t2.del=1 and t3.archive_type=1 and t3.del=1 ";
        olderFamilyBinding = jdbcTemplate.queryForObject(sql2,Integer.class);
        //helper 助老员,teacher 教师,child 幼儿,olderWx 老人公众号,olderPad 老人平板
        result.put("olderTotal", olderTotal);
@ -798,9 +810,16 @@ public class StatisticsService {
            if (StringUtils.isNotBlank(type)) {
                //周/月 增量
                String start = statisticsUtilService.calStart(endDate, type);
                SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL, areaLevel);
                res.put("index_" + ind + "_add", saveModelAdd.getResult2().longValue());
                long addNum = 0;
                if("55".equals(ind)){
                    //已关联家属老人数 增量用2个时间相减
                    SaveModel saveModelstart = elasticsearchUtil.findOneDateQuotaLevel0(start, start, area, level, ind, SaveModel.timeLevel_DDL, areaLevel);
                    addNum = saveModel.getResult2().longValue() - saveModelstart.getResult2().longValue();
                }else{
                    SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL, areaLevel);
                    addNum = saveModelAdd.getResult2().longValue();
                }
                res.put("index_" + ind + "_add", addNum);
            }
        }
@ -1270,7 +1289,7 @@ public class StatisticsService {
    }
    /**
     * 管理端首页老人接入情况
     * 管理端首页老人接入情况,关联家属
     *
     * @return
     */
@ -1289,9 +1308,32 @@ public class StatisticsService {
        sql = " select count(DISTINCT p.id) from base_patient p INNER JOIN wlyy_patient_device pd on p.id = pd.user and p.archive_type=1 and pd.del=0 where p.del=1 and p.id " + filter;
        Integer bindingCount = jdbcTemplate.queryForObject(sql, Integer.class);
        //老人接入情况
        result.put("olderCount", olderCount);
        result.put("bindingCount", bindingCount);
        result.put("range", commonUtil.getRange(bindingCount, olderCount));
        //关联家属
        String sqlfamily = "SELECT COUNT(DISTINCT p.id)  FROM " +
                "base_patient p INNER JOIN base_service_package_sign_record sr " +
                "on p.id = sr.patient and sr.`status`=1 and  p.id not in " +
                "(SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older') " +
                ",(SELECT DISTINCT fm.family_member from base_patient_family_member fm,base_patient p1 " +
                "WHERE p1.id = fm.patient and p1.archive_type = '3') f1 " +
                "WHERE p.del = 1 and p.archive_type =1 and p.id = f1.family_member ";
        String sqlSign = "SELECT COUNT(DISTINCT p.id) FROM " +
                "base_patient p INNER JOIN base_service_package_sign_record sr " +
                "on p.id = sr.patient and sr.`status`=1 and  p.id not in " +
                "(SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older') " +
                "WHERE p.del = 1 and p.archive_type =1 ";
        Integer familyOlderCount = jdbcTemplate.queryForObject(sqlfamily, Integer.class);
        Integer familySignCount = jdbcTemplate.queryForObject(sqlSign, Integer.class);
        result.put("familyOlderCount", familyOlderCount);
        result.put("familySignCount", familySignCount);
        result.put("famulyRange", commonUtil.getRange(familyOlderCount, familySignCount));
        return result;
    }

+ 14 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/config/NetworkCardConfig.java

@ -32,4 +32,18 @@ public class NetworkCardConfig {
    //查询语音卡 群组Id
    public static final String getGroupId="https://api.iot.10086.cn/v5/ec/query/group-by-member";
    //查询集团所有群组信息
    public static final String getMyGroups="https://api.iot.10086.cn/v5/ec/query/group-info";
    //获取群组卡号信息 返回SIM卡的 msisdn
    public static final String getGroupMember="https://api.iot.10086.cn/v5/ec/query/group-member";
    //物联网卡单卡批量某一天流量使用 返回KB
    public static final String getFlowUsageDaily="https://api.iot.10086.cn/v5/ec/query/sim-data-usage-daily/batch";
    //物联网卡单卡批量获取某月流量使用  KB
    public static final String getFlowUsageMonthly="https://api.iot.10086.cn/v5/ec/query/sim-data-usage-monthly/batch";
    //物联网卡单卡语音单日批量使用情况 分钟
    public static final String getVoiceUsageDaily="https://api.iot.10086.cn/v5/ec/query/sim-voice-usage-daily/batch";
    //物联网卡单卡语音某月批量使用情况 分钟
    public static final String getVoiceUsageMonthly="https://api.iot.10086.cn/v5/ec/query/sim-voice-usage-monthly/batch";
}

+ 11 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.care.dao.sim;
import com.yihu.jw.entity.care.sim.WlyySimDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Bing on 2022/2/11.
 */
public interface WlyySimDao extends PagingAndSortingRepository<WlyySimDo,String>, JpaSpecificationExecutor<WlyySimDo> {
}

+ 20 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimFlowDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.dao.sim;
import com.yihu.jw.entity.care.sim.WlyySimFlowDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created by Bing on 2022/2/14.
 */
public interface WlyySimFlowDao extends PagingAndSortingRepository<WlyySimFlowDo,String>,
        JpaSpecificationExecutor<WlyySimFlowDo> {
    @Modifying
    @Transactional
    @Query("delete WlyySimFlowDo sv where sv.day=?1 and sv.type=?2 ")
    void deleteByDayAndType(String day,Integer type);
}

+ 20 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/sim/WlyySimVoiceDao.java

@ -0,0 +1,20 @@
package com.yihu.jw.care.dao.sim;
import com.yihu.jw.entity.care.sim.WlyySimVoicesDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;
/**
 * Created by Bing on 2022/2/14.
 */
public interface WlyySimVoiceDao extends PagingAndSortingRepository<WlyySimVoicesDo,String>,
        JpaSpecificationExecutor<WlyySimVoicesDo> {
    @Modifying
    @Transactional
    @Query("delete WlyySimVoicesDo sv where sv.day=?1 and sv.type=?2 ")
    void deleteByDayAndType(String day,Integer type);
}

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

@ -11,6 +11,9 @@ import com.yihu.jw.care.job.message.PatientSendUnreadJob;
import com.yihu.jw.care.job.order.CancelPayOrderJob;
import com.yihu.jw.care.job.order.EmeWarnOrderDayJob;
import com.yihu.jw.care.job.order.EmeWarnOrderJob;
import com.yihu.jw.care.job.sim.GetSimsVoiceFlowDayJob;
import com.yihu.jw.care.job.sim.GetSimsVoiceFlowMonthJob;
import com.yihu.jw.care.job.sim.UpdateSimsJob;
import com.yihu.jw.care.job.visit.OverTimeVistJob;
import com.yihu.jw.care.util.SystemConf;
import org.slf4j.Logger;
@ -133,6 +136,33 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                logger.info("SAVE_DATA_PUSH_JOB success");
            }
            //定时查询移动平台物联卡信息
            if (!quartzHelper.isExistJob("UPDATE_SIMS_JOB")){
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("UPDATE_SIMS_JOB");
                quartzHelper.addJob(UpdateSimsJob.class, trigger, "UPDATE_SIMS_JOB", new HashMap<String, Object>());
                logger.info("UPDATE_SIMS_JOB success");
            }else {
                logger.info("UPDATE_SIMS_JOB success");
            }
            //定时查询移动平台物联卡信息--日
            if (!quartzHelper.isExistJob("GET_SIMS_VOICE_FLOW_DAY_JOB")){
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("GET_SIMS_VOICE_FLOW_DAY_JOB");
                quartzHelper.addJob(GetSimsVoiceFlowDayJob.class, trigger, "GET_SIMS_VOICE_FLOW_DAY_JOB", new HashMap<String, Object>());
                logger.info("GET_SIMS_VOICE_FLOW_DAY_JOB success");
            }else {
                logger.info("GET_SIMS_VOICE_FLOW_DAY_JOB success");
            }
            //定时查询移动平台物联卡信息--月
            if (!quartzHelper.isExistJob("GET_SIMS_VOICE_FLOW_MONTH_JOB")){
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("GET_SIMS_VOICE_FLOW_MONTH_JOB");
                quartzHelper.addJob(GetSimsVoiceFlowMonthJob.class, trigger, "GET_SIMS_VOICE_FLOW_MONTH_JOB", new HashMap<String, Object>());
                logger.info("GET_SIMS_VOICE_FLOW_MONTH_JOB success");
            }else {
                logger.info("GET_SIMS_VOICE_FLOW_MONTH_JOB success");
            }
        } catch (Exception e) {
            logger.info(" job start failed");
        }

+ 5 - 6
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/data/SaveDataPushJob.java

@ -46,6 +46,9 @@ public class SaveDataPushJob implements Job {
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // id  日期  字段(保存的) 表名(从哪里取到的)
        String date = DateUtil.dateToStrShort(new Date());
        //System.out.println(date);
        date = DateUtil.getNextDay(date, -1);
        //System.out.println(date);
        saveSecurityMonitoringOrder(date);
        saveEmergencyAssistanceOrder(date);
        saveDoorCoachOrder(date);
@ -61,14 +64,14 @@ public class SaveDataPushJob 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+"'";
        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.save(query);
    }
    //紧急救助工单
    public void saveEmergencyAssistanceOrder(String date){
        String emergencyAssistanceOrderSql ="SELECT id,patient_name,patient_phone,patient_idcard,org_name,serve_address,doctor_name,doctor_address,complete_time,team_code,proxy_patient_name,proxy_patient_phone,type,order_source FROM base_emergency_assistance_order WHERE create_time > '"+date+"'";
        String emergencyAssistanceOrderSql ="SELECT id,patient_name,patient_phone,patient_idcard,org_name,serve_address,doctor_name,doctor_address,complete_time,team_code,proxy_patient_name,proxy_patient_phone,type,order_source FROM base_emergency_assistance_order WHERE create_time >= '"+date+"'";
        List<ZhEmergencyAssistanceDO> query = jdbcTemplate.query(emergencyAssistanceOrderSql, new BeanPropertyRowMapper<>(ZhEmergencyAssistanceDO.class));
        zhEmergencyAssistanceDao.save(query);
    }
@ -129,8 +132,4 @@ public class SaveDataPushJob implements Job {
        List<ZhDeviceDetail> query = jdbcTemplate.query(deviceSql, new BeanPropertyRowMapper<>(ZhDeviceDetail.class));
        zhDeviceDetailDao.save(query);
    }
}

+ 127 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/GetSimsVoiceFlowDayJob.java

@ -0,0 +1,127 @@
package com.yihu.jw.care.job.sim;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.config.NetworkCardConfig;
import com.yihu.jw.care.dao.sim.WlyySimFlowDao;
import com.yihu.jw.care.dao.sim.WlyySimVoiceDao;
import com.yihu.jw.care.service.device.NetworkCardService;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.entity.care.sim.WlyySimFlowDo;
import com.yihu.jw.entity.care.sim.WlyySimVoicesDo;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * Created by Bing on 2022/2/14.
 * 获取物联网卡流量语音使用情况 每日
 */
@DisallowConcurrentExecution
public class GetSimsVoiceFlowDayJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(GetSimsVoiceFlowDayJob.class);
    @Autowired
    private NetworkCardService networkCardService;
    @Autowired
    private WlyySimVoiceDao wlyySimVoiceDao;
    @Autowired
    private WlyySimFlowDao wlyySimFlowDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("GET_SIMS_VOICE_FLOW_DAY_JOB start");
        Date yesDay = DateUtil.getPreDays(new Date(),-1);
        String dateTime = DateUtil.dateToStr(yesDay,DateUtil.YYYYMMDD);
        try {
            String sql = " select msisdn from wlyy_sims";
            List<String> msisdns = jdbcTemplate.queryForList(sql,String.class);
            List<WlyySimFlowDo> wlyySimFlowDos = new ArrayList<>();
            List<WlyySimVoicesDo> wlyySimVoicesDos = new ArrayList<>();
            Integer pageTotal = msisdns.size()%100==0?(msisdns.size()/100):(msisdns.size()/100)+1;
            for (int pageTmp = 1;pageTmp<=pageTotal;pageTmp++){
                try {
                    Integer startSize = (pageTmp-1)*100;
                    Integer endSize = pageTmp*100>msisdns.size()?msisdns.size():pageTmp*100;
                    String msisdn = msisdns.subList(startSize,endSize).stream().map(String::valueOf).collect(Collectors.joining("_"));
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开100张
                    String response = httpClientUtil.get(NetworkCardConfig.getVoiceUsageDaily, params, "UTF-8");//物联网卡单卡语音单日批量使用情况 分钟
                    JSONObject responseObj = JSONObject.parseObject(response);
                    String status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("voiceAmount");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String voces = StringUtils.isBlank(tmp.getString("voice"))?"0":tmp.getString("voice");
                            WlyySimVoicesDo wlyySimVoicesDo = new WlyySimVoicesDo();
                            wlyySimVoicesDo.setDay(dateTime);
                            wlyySimVoicesDo.setMsisdn(msisdnTmp);
                            wlyySimVoicesDo.setValue(voces);
                            wlyySimVoicesDo.setType(2);
                            wlyySimVoicesDos.add(wlyySimVoicesDo);
                        }
                    }
                    params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开
                    response = httpClientUtil.get(NetworkCardConfig.getFlowUsageDaily, params, "UTF-8");//物联网卡单卡批量某一天流量使用 KB
                    responseObj = JSONObject.parseObject(response);
                    status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("dataAmountList");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String dataAmount = StringUtils.isBlank(tmp.getString("dataAmount"))?"0":tmp.getString("dataAmount");
                            WlyySimFlowDo wlyySimFlowDo = new WlyySimFlowDo();
                            wlyySimFlowDo.setDay(dateTime);
                            wlyySimFlowDo.setMsisdn(msisdnTmp);
                            wlyySimFlowDo.setValue(dataAmount);
                            wlyySimFlowDo.setType(2);
                            wlyySimFlowDos.add(wlyySimFlowDo);
                        }
                    }
                    wlyySimVoiceDao.save(wlyySimVoicesDos);
                    wlyySimFlowDao.save(wlyySimFlowDos);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            logger.info("GET_SIMS_VOICE_FLOW_DAY_JOB end");
        }catch (Exception e){
            e.printStackTrace();
            logger.info("GET_SIMS_VOICE_FLOW_DAY_JOB end===ERROE===,message:"+e.getMessage());
        }
    }
}

+ 134 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/GetSimsVoiceFlowMonthJob.java

@ -0,0 +1,134 @@
package com.yihu.jw.care.job.sim;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.config.NetworkCardConfig;
import com.yihu.jw.care.dao.sim.WlyySimFlowDao;
import com.yihu.jw.care.dao.sim.WlyySimVoiceDao;
import com.yihu.jw.care.service.device.NetworkCardService;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.entity.care.sim.WlyySimFlowDo;
import com.yihu.jw.entity.care.sim.WlyySimVoicesDo;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * Created by Bing on 2022/2/14.
 * 获取物联网卡流量语音使用情况 每月
 */
@DisallowConcurrentExecution
public class GetSimsVoiceFlowMonthJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(GetSimsVoiceFlowMonthJob.class);
    @Autowired
    private NetworkCardService networkCardService;
    @Autowired
    private WlyySimVoiceDao wlyySimVoiceDao;
    @Autowired
    private WlyySimFlowDao wlyySimFlowDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("GET_SIMS_VOICE_FLOW_MONTH_JOB start");
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date());
        cal.set(Calendar.DAY_OF_MONTH,1);
//        cal.add(Calendar.MONTH,-1);
        cal.getTime();
        String dateTime = DateUtil.dateToStr(cal.getTime(),DateUtil.YYYYMM);
        try {
            String sql = " select msisdn from wlyy_sims";
            List<String> msisdns = jdbcTemplate.queryForList(sql,String.class);
            List<WlyySimFlowDo> wlyySimFlowDos = new ArrayList<>();
            List<WlyySimVoicesDo> wlyySimVoicesDos = new ArrayList<>();
            Integer pageTotal = msisdns.size()%100==0?(msisdns.size()/100):(msisdns.size()/100)+1;
            for (int pageTmp = 1;pageTmp<=pageTotal;pageTmp++){
                try {
                    Integer startSize = (pageTmp-1)*100;
                    Integer endSize = pageTmp*100>msisdns.size()?msisdns.size():pageTmp*100;
                    String msisdn = msisdns.subList(startSize,endSize).stream().map(String::valueOf).collect(Collectors.joining("_"));
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开100张
                    String response = httpClientUtil.get(NetworkCardConfig.getVoiceUsageMonthly, params, "UTF-8");//物联网卡单卡语音单日批量使用情况 分钟
                    JSONObject responseObj = JSONObject.parseObject(response);
                    String status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("voiceAmount");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String voces = StringUtils.isBlank(tmp.getString("voice"))?"0":tmp.getString("voice");
                            WlyySimVoicesDo wlyySimVoicesDo = new WlyySimVoicesDo();
                            wlyySimVoicesDo.setDay(dateTime);
                            wlyySimVoicesDo.setMsisdn(msisdnTmp);
                            wlyySimVoicesDo.setValue(voces);
                            wlyySimVoicesDo.setType(1);
                            wlyySimVoicesDos.add(wlyySimVoicesDo);
                        }
                    }
                    params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开
                    response = httpClientUtil.get(NetworkCardConfig.getFlowUsageMonthly, params, "UTF-8");//物联网卡单卡批量某一天流量使用 KB
                    responseObj = JSONObject.parseObject(response);
                    status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("dataAmountList");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String dataAmount = StringUtils.isBlank(tmp.getString("dataAmount"))?"0":tmp.getString("dataAmount");
                            WlyySimFlowDo wlyySimFlowDo = new WlyySimFlowDo();
                            wlyySimFlowDo.setDay(dateTime);
                            wlyySimFlowDo.setMsisdn(msisdnTmp);
                            wlyySimFlowDo.setValue(dataAmount);
                            wlyySimFlowDo.setType(1);
                            wlyySimFlowDos.add(wlyySimFlowDo);
                        }
                    }
                    wlyySimVoiceDao.deleteByDayAndType(dateTime,1);
                    wlyySimFlowDao.deleteByDayAndType(dateTime,1);
                    wlyySimVoiceDao.save(wlyySimVoicesDos);
                    wlyySimFlowDao.save(wlyySimFlowDos);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
            logger.info("GET_SIMS_VOICE_FLOW_MONTH_JOB end");
        }catch (Exception e){
            e.printStackTrace();
            logger.info("GET_SIMS_VOICE_FLOW_MONTH_JOB end===ERROE===,message:"+e.getMessage());
        }
    }
}

+ 116 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/sim/UpdateSimsJob.java

@ -0,0 +1,116 @@
package com.yihu.jw.care.job.sim;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.config.NetworkCardConfig;
import com.yihu.jw.care.dao.sim.WlyySimDao;
import com.yihu.jw.care.service.device.NetworkCardService;
import com.yihu.jw.entity.care.sim.WlyySimDo;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * Created by Bing on 2022/2/11.
 * 定时更新获取移动物联网群组卡号信息;
 */
@DisallowConcurrentExecution
public class UpdateSimsJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(UpdateSimsJob.class);
    @Autowired
    private NetworkCardService networkCardService;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private WlyySimDao wlyySimDao;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info(" UPDATE_SIMS_JOB start");
        try {
            List<NameValuePair> params = new ArrayList<>();
            params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
            try {
                params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
            } catch (Exception e) {
                e.printStackTrace();
            }
            params.add(new BasicNameValuePair("groupId", "9911000019333024"));
            params.add(new BasicNameValuePair("pageSize", "50"));
            params.add(new BasicNameValuePair("startNum", "1"));
            String response = httpClientUtil.get(NetworkCardConfig.getMyGroups,params,"UTF-8");
            JSONObject responseObj = JSONObject.parseObject(response);
            String status = responseObj.getString("status");
            if ("0".equals(status)){
                JSONArray resultArray =responseObj.getJSONArray("result");
                JSONObject result =resultArray.getJSONObject(0);
                if (0<Integer.parseInt(result.getString("totalCount"))){
                    JSONArray groupArr = result.getJSONArray("groupList");
                    List<String> groups = groupArr.stream().map(item->((JSONObject)item).getString("groupId")).collect(Collectors.toList());
                    List<WlyySimDo> simDos = new ArrayList<>();
                    List<String> msisdn = new ArrayList<>();
                    for (String groupId:groups) {
                        Integer page = 1;
                        Integer forFlag = 1;
                        try {
                            for (;forFlag>0;page++){
                                params = new ArrayList<>();
                                params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                                params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                                params.add(new BasicNameValuePair("groupId", groupId));
                                params.add(new BasicNameValuePair("pageSize", "50"));//size
                                params.add(new BasicNameValuePair("startNum", page+""));//页码
                                response = httpClientUtil.get(NetworkCardConfig.getGroupMember, params, "UTF-8");
                                responseObj = JSONObject.parseObject(response);
                                status = responseObj.getString("status");
                                if ("0".equals(status)) {
                                    resultArray =responseObj.getJSONArray("result");
                                    result =resultArray.getJSONObject(0);
                                    String lastFlag = result.getString("flag");
                                    JSONArray members = result.getJSONArray("memberinfoList");
                                    Integer memberSize = members.size();
                                    for (int i=0;i<memberSize;i++){
                                        JSONObject memberInfo = members.getJSONObject(i);
                                        String memberNum = memberInfo.getString("memberNum");
                                        if (msisdn.contains(memberNum)){
                                            continue;
                                        }else {
                                            msisdn.add(memberNum);
                                            WlyySimDo wlyySimDo = new WlyySimDo();
                                            wlyySimDo.setMsisdn(memberNum);
                                            simDos.add(wlyySimDo);
                                        }
                                    }
                                    if ("Y".equals(lastFlag)){
                                        forFlag = -1;
                                    }
                                }
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                    wlyySimDao.deleteAll();
                    wlyySimDao.save(simDos);
                }
            }
            logger.info(" UPDATE_SIMS_JOB end");
        }catch (Exception e){
            e.printStackTrace();
            logger.info("UPDATE_SIMS_JOB end===ERROE===,message:"+e.getMessage());
        }
    }
}

+ 210 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/WlyysimFlowVoiceService.java

@ -0,0 +1,210 @@
package com.yihu.jw.care.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.config.NetworkCardConfig;
import com.yihu.jw.care.dao.sim.WlyySimFlowDao;
import com.yihu.jw.care.dao.sim.WlyySimVoiceDao;
import com.yihu.jw.care.service.device.NetworkCardService;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.entity.care.sim.WlyySimFlowDo;
import com.yihu.jw.entity.care.sim.WlyySimVoicesDo;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
 * Created by Bing on 2022/2/14.
 */
@Service
public class WlyysimFlowVoiceService{
    @Autowired
    private NetworkCardService networkCardService;
    @Autowired
    private WlyySimVoiceDao wlyySimVoiceDao;
    @Autowired
    private WlyySimFlowDao wlyySimFlowDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HttpClientUtil httpClientUtil;
    public String initData() throws InterruptedException {
        Date date = new Date();
        Date month = new Date();
        for (int i=1;i<=7;i++){
            date = DateUtil.getPreDays(date,-1);
            String dateTime = DateUtil.dateToStr(date,DateUtil.YYYYMMDD);
            System.out.println("day"+dateTime);
            initDay(dateTime);
            TimeUnit.SECONDS.sleep(10);
            Calendar cal = Calendar.getInstance();
            cal.setTime(month);
            cal.set(Calendar.DAY_OF_MONTH,1);
            cal.add(Calendar.MONTH,-1*(i-1));
            dateTime = DateUtil.dateToStr(cal.getTime(),DateUtil.YYYYMM);
            System.out.println("mon"+dateTime);
            initMonth(dateTime);
            TimeUnit.SECONDS.sleep(10);
        }
        return "success";
    }
    public void initDay(String dateTime){
        try {
            String sql = " select msisdn from wlyy_sims";
            List<String> msisdns = jdbcTemplate.queryForList(sql,String.class);
            List<WlyySimFlowDo> wlyySimFlowDos = new ArrayList<>();
            List<WlyySimVoicesDo> wlyySimVoicesDos = new ArrayList<>();
            Integer pageTotal = msisdns.size()%100==0?(msisdns.size()/100):(msisdns.size()/100)+1;
            for (int pageTmp = 1;pageTmp<=pageTotal;pageTmp++){
                try {
                    Integer startSize = (pageTmp-1)*100;
                    Integer endSize = pageTmp*100>msisdns.size()?msisdns.size():pageTmp*100;
                    String msisdn = msisdns.subList(startSize,endSize).stream().map(String::valueOf).collect(Collectors.joining("_"));
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开100张
                    String response = httpClientUtil.get(NetworkCardConfig.getVoiceUsageDaily, params, "UTF-8");//物联网卡单卡语音单日批量使用情况 分钟
                    JSONObject responseObj = JSONObject.parseObject(response);
                    String status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("voiceAmount");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String voces = StringUtils.isBlank(tmp.getString("voice"))?"0":tmp.getString("voice");
                            WlyySimVoicesDo wlyySimVoicesDo = new WlyySimVoicesDo();
                            wlyySimVoicesDo.setDay(dateTime);
                            wlyySimVoicesDo.setMsisdn(msisdnTmp);
                            wlyySimVoicesDo.setValue(voces);
                            wlyySimVoicesDo.setType(2);
                            wlyySimVoicesDos.add(wlyySimVoicesDo);
                        }
                    }
                    params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开
                    response = httpClientUtil.get(NetworkCardConfig.getFlowUsageDaily, params, "UTF-8");//物联网卡单卡批量某一天流量使用 KB
                    responseObj = JSONObject.parseObject(response);
                    status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("dataAmountList");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String dataAmount = StringUtils.isBlank(tmp.getString("dataAmount"))?"0":tmp.getString("dataAmount");
                            WlyySimFlowDo wlyySimFlowDo = new WlyySimFlowDo();
                            wlyySimFlowDo.setDay(dateTime);
                            wlyySimFlowDo.setMsisdn(msisdnTmp);
                            wlyySimFlowDo.setValue(dataAmount);
                            wlyySimFlowDo.setType(2);
                            wlyySimFlowDos.add(wlyySimFlowDo);
                        }
                    }
                    wlyySimVoiceDao.save(wlyySimVoicesDos);
                    wlyySimFlowDao.save(wlyySimFlowDos);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    public void initMonth(String dateTime){
        try {
            String sql = " select msisdn from wlyy_sims";
            List<String> msisdns = jdbcTemplate.queryForList(sql,String.class);
            List<WlyySimFlowDo> wlyySimFlowDos = new ArrayList<>();
            List<WlyySimVoicesDo> wlyySimVoicesDos = new ArrayList<>();
            Integer pageTotal = msisdns.size()%100==0?(msisdns.size()/100):(msisdns.size()/100)+1;
            for (int pageTmp = 1;pageTmp<=pageTotal;pageTmp++){
                try {
                    Integer startSize = (pageTmp-1)*100;
                    Integer endSize = pageTmp*100>msisdns.size()?msisdns.size():pageTmp*100;
                    String msisdn = msisdns.subList(startSize,endSize).stream().map(String::valueOf).collect(Collectors.joining("_"));
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开100张
                    String response = httpClientUtil.get(NetworkCardConfig.getVoiceUsageMonthly, params, "UTF-8");//物联网卡单卡语音单日批量使用情况 分钟
                    JSONObject responseObj = JSONObject.parseObject(response);
                    String status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("voiceAmount");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String voces = StringUtils.isBlank(tmp.getString("voice"))?"0":tmp.getString("voice");
                            WlyySimVoicesDo wlyySimVoicesDo = new WlyySimVoicesDo();
                            wlyySimVoicesDo.setDay(dateTime);
                            wlyySimVoicesDo.setMsisdn(msisdnTmp);
                            wlyySimVoicesDo.setValue(voces);
                            wlyySimVoicesDo.setType(1);
                            wlyySimVoicesDos.add(wlyySimVoicesDo);
                        }
                    }
                    params = new ArrayList<>();
                    params.add(new BasicNameValuePair("transid", NetworkCardConfig.getTransid()));
                    params.add(new BasicNameValuePair("token", networkCardService.getAccessToken()));
                    params.add(new BasicNameValuePair("queryDate", dateTime));
                    params.add(new BasicNameValuePair("msisdns", msisdn));//多个下换线隔开
                    response = httpClientUtil.get(NetworkCardConfig.getFlowUsageMonthly, params, "UTF-8");//物联网卡单卡批量某一天流量使用 KB
                    responseObj = JSONObject.parseObject(response);
                    status = responseObj.getString("status");
                    if ("0".equals(status)){
                        JSONArray resultArray =responseObj.getJSONArray("result");
                        JSONObject result =resultArray.getJSONObject(0);
                        JSONArray voiceAmounts = result.getJSONArray("dataAmountList");
                        for (int i=0;i<voiceAmounts.size();i++){
                            JSONObject tmp = voiceAmounts.getJSONObject(i);
                            String msisdnTmp = tmp.getString("msisdn");
                            String dataAmount = StringUtils.isBlank(tmp.getString("dataAmount"))?"0":tmp.getString("dataAmount");
                            WlyySimFlowDo wlyySimFlowDo = new WlyySimFlowDo();
                            wlyySimFlowDo.setDay(dateTime);
                            wlyySimFlowDo.setMsisdn(msisdnTmp);
                            wlyySimFlowDo.setValue(dataAmount);
                            wlyySimFlowDo.setType(1);
                            wlyySimFlowDos.add(wlyySimFlowDo);
                        }
                    }
                    wlyySimVoiceDao.save(wlyySimVoicesDos);
                    wlyySimFlowDao.save(wlyySimFlowDos);
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

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

@ -8,6 +8,7 @@ import com.yihu.jw.care.job.message.DoctorSendUnreadJob;
import com.yihu.jw.care.job.message.PatientSendUnreadJob;
import com.yihu.jw.care.service.BirthdayReminderService;
import com.yihu.jw.care.service.JobService;
import com.yihu.jw.care.service.WlyysimFlowVoiceService;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.care.util.SystemConf;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -40,6 +41,8 @@ public class JobController extends BaseController {
    private final QuartzHelper quartzHelper;
    @Autowired
    private BirthdayReminderService birthdayReminderService;
    @Autowired
    private WlyysimFlowVoiceService wlyysimFlowVoiceService;
    @RequestMapping(value = "/deviceLostAssociationJob", method = RequestMethod.POST)
    @ApiOperation("医养物联网检测大屏失联率")
@ -315,7 +318,16 @@ public class JobController extends BaseController {
    }
    @RequestMapping(value = "/wlyySimFlowVoice", method = RequestMethod.POST)
    @ApiOperation("物联网卡流量语音初始化查询")
    public String wlyySimFlowVoice() {
        try {
            return write(200, wlyysimFlowVoiceService.initData());
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }

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

@ -186,7 +186,7 @@ spring:
      username: wlyy
      password: '0XxS3W*!cRj'
    zhylyjkglxt:
      url: jdbc:mysql://10.71.83.98:3306/gsq_zhjd_zhylyjkglxt?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
      jdbcUrl: jdbc:mysql://10.71.83.98:3306/gsq_zhjd_zhylyjkglxt?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
      username: gsq_zhjd_zhylyjkglxt
      password: 'GSQ_YTHPT@2021'
  activemq:

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

@ -30,4 +30,13 @@ 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 * * ?
SAVE_DATA_PUSH_JOB= 0 0 2 * * ? *
#\u5B9A\u65F6\u67E5\u8BE2\u79FB\u52A8\u5E73\u53F0\u7269\u8054\u5361\u4FE1\u606F
UPDATE_SIMS_JOB= 0 30 0 * * ?
#\u5B9A\u65F6\u67E5\u8BE2\u79FB\u52A8\u7269\u8054\u5361\u8BED\u97F3\uFF0C\u6D41\u91CF\u4F7F\u7528\u4FE1\u606F--\u65E5
GET_SIMS_VOICE_FLOW_DAY_JOB= 0 50 1 * * ?
#\u5B9A\u65F6\u67E5\u8BE2\u79FB\u52A8\u7269\u8054\u5361\u8BED\u97F3\uFF0C\u6D41\u91CF\u4F7F\u7528\u4FE1\u606F--\u6708
GET_SIMS_VOICE_FLOW_MONTH_JOB= 0 15 2 * * ?