Forráskód Böngészése

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

wangzhinan 5 éve
szülő
commit
aa051727ec
22 módosított fájl, 302 hozzáadás és 16 törlés
  1. 32 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/SurveyScreenResultVo.java
  2. 13 1
      gateway/ag-basic/src/main/resources/application.yml
  3. 7 0
      gateway/ag-basic/src/main/resources/bootstrap.yml
  4. 25 0
      server/svr-authentication/src/main/resources/application.yml
  5. 8 0
      server/svr-authentication/src/main/resources/bootstrap.yml
  6. 14 0
      server/svr-configuration/src/main/resources/bootstrap.yml
  7. 45 0
      svr/svr-base/src/main/resources/application.yml
  8. 8 0
      svr/svr-base/src/main/resources/bootstrap.yml
  9. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/DeviceQualityPlanJob.java
  10. 32 0
      svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/InventoryWarningJob.java
  11. 1 2
      svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/SimBalanceJob.java
  12. 1 2
      svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/SimSetMealJob.java
  13. 11 0
      svr/svr-iot-job/src/main/java/com/yihu/jw/repository/product/ProductBaseInfoDao.java
  14. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/DeviceQualityPlanService.java
  15. 44 0
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/InventoryWarningService.java
  16. 1 1
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/SimBalanceService.java
  17. 1 3
      svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/SimSetMealService.java
  18. 3 3
      svr/svr-iot-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  19. 15 1
      svr/svr-iot-job/src/main/resources/application.yml
  20. 8 0
      svr/svr-iot-job/src/main/resources/bootstrap.yml
  21. 20 1
      svr/svr-iot/src/main/resources/application.yml
  22. 11 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java

+ 32 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/specialist/SurveyScreenResultVo.java

@ -120,6 +120,14 @@ public class SurveyScreenResultVo{
    @ApiModelProperty("第三方返回的筛查建议")
    private String thirdAdvice;
    //转诊信息
    @ApiModelProperty("预约医生")
    private String doctorNameReservation;
    @ApiModelProperty("挂号时间")
    private String czrqReservation;
    @ApiModelProperty("就诊时间")
    private String startTimeReservation;
    public SurveyScreenResultVo() {
    }
@ -410,4 +418,28 @@ public class SurveyScreenResultVo{
    public void setIsThird(String isThird) {
        this.isThird = isThird;
    }
    public String getDoctorNameReservation() {
        return doctorNameReservation;
    }
    public void setDoctorNameReservation(String doctorNameReservation) {
        this.doctorNameReservation = doctorNameReservation;
    }
    public String getCzrqReservation() {
        return czrqReservation;
    }
    public void setCzrqReservation(String czrqReservation) {
        this.czrqReservation = czrqReservation;
    }
    public String getStartTimeReservation() {
        return startTimeReservation;
    }
    public void setStartTimeReservation(String startTimeReservation) {
        this.startTimeReservation = startTimeReservation;
    }
}

+ 13 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -176,4 +176,16 @@ spring:
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
    password: jkzlehr
---
spring:
  profiles: iotprod
  datasource:
     url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
     username: wlyy
     password: jkzlehr@123
  redis:
     host: 59.61.92.90 # Redis server host.
     port: 9054  # Redis server port.
     password: jkzlehr

+ 7 - 0
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -89,4 +89,11 @@ spring:
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      label: ${wlyy.spring.config.label:master}

+ 25 - 0
server/svr-authentication/src/main/resources/application.yml

@ -234,4 +234,29 @@ wlyy:
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 1
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
---
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: jkzlehr@123
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
  ##发现服务
## i健康用户信息接口,开放出来给互联网医院登录同步用户信息用
iHealth:
  user-info-uri: http://ehr.yihu.com/wlyy/iHealth/userInfo
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyy/
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream

+ 8 - 0
server/svr-authentication/src/main/resources/bootstrap.yml

@ -91,3 +91,11 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      label: ${wlyy.spring.config.label:master}

+ 14 - 0
server/svr-configuration/src/main/resources/bootstrap.yml

@ -125,4 +125,18 @@ spring:
        git:
          uri: ${wlyy.spring.config.git.uri:http://192.168.120.210:3000/jkzl/config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:master}
---
## 物联网
spring:
  profiles: iotprod
##git配置
  cloud:
    config:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: ${wlyy.spring.config.git.uri:http://192.168.120.216:10010/jkzl/config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:master}

+ 45 - 0
svr/svr-base/src/main/resources/application.yml

@ -284,6 +284,51 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
---
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: wlyy
    password: jkzlehr@123
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
#    username: root
#    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 59.61.92.90:20010,59.61.92.90:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://59.61.92.90:20009,http://59.61.92.90:20011
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
demo:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream

+ 8 - 0
svr/svr-base/src/main/resources/bootstrap.yml

@ -57,3 +57,11 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://10.95.22.193:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.109:1221}
      label: ${wlyy.spring.config.label:master}

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/DeviceQualityPlanJob.java

@ -1,6 +1,6 @@
package com.yihu.jw.job.wlw;
import com.yihu.jw.service.channel.DeviceQualityPlanService;
import com.yihu.jw.service.device.DeviceQualityPlanService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

+ 32 - 0
svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/InventoryWarningJob.java

@ -0,0 +1,32 @@
package com.yihu.jw.job.wlw;
import com.yihu.jw.service.device.InventoryWarningService;
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;
/**
 * 库存预警提醒
 * create by hmf on 2020/5/13
 */
public class InventoryWarningJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(InventoryWarningJob.class);
    @Autowired
    private InventoryWarningService inventoryWarningService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========InventoryWarningJob========");
        try {
            inventoryWarningService.remind();
            logger.info("END========InventoryWarningJob========");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===InventoryWarningJob,message:"+e.getMessage());
        }
    }
}

+ 1 - 2
svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/SimBalanceJob.java

@ -1,7 +1,6 @@
package com.yihu.jw.job.wlw;
import com.yihu.jw.service.channel.DeviceQualityPlanService;
import com.yihu.jw.service.channel.SimBalanceService;
import com.yihu.jw.service.device.SimBalanceService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

+ 1 - 2
svr/svr-iot-job/src/main/java/com/yihu/jw/job/wlw/SimSetMealJob.java

@ -1,7 +1,6 @@
package com.yihu.jw.job.wlw;
import com.yihu.jw.service.channel.DeviceQualityPlanService;
import com.yihu.jw.service.channel.SimSetMealService;
import com.yihu.jw.service.device.SimSetMealService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

+ 11 - 0
svr/svr-iot-job/src/main/java/com/yihu/jw/repository/product/ProductBaseInfoDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.repository.product;
import com.yihu.jw.entity.iot.product.IotProductBaseInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface ProductBaseInfoDao extends PagingAndSortingRepository<IotProductBaseInfoDO,String>,
        JpaSpecificationExecutor<IotProductBaseInfoDO> {
}

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/DeviceQualityPlanService.java

@ -1,4 +1,4 @@
package com.yihu.jw.service.channel;
package com.yihu.jw.service.device;
import com.yihu.iot.dao.dict.IotSystemDictDao;
import com.yihu.iot.dao.message.IotMessageDao;

+ 44 - 0
svr/svr-iot-job/src/main/java/com/yihu/jw/service/device/InventoryWarningService.java

@ -0,0 +1,44 @@
package com.yihu.jw.service.device;
import com.yihu.iot.dao.message.IotMessageDao;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/*
 * 库存预警提醒相关逻辑
 * create by hmf on 2020/5/13
 */
@Service
public class InventoryWarningService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private IotMessageDao iotMessageDao;
    public void remind() {
        String sql = "select d.product_id,d.`name`,d.category_code,d.category_name,d.manufacturer_id,d.manufacturer_name,d.hospital,d.hospital_name,count(d.id) inventoryCount ,p.inventory_floor,p.inventory_upper " +
                "FROM `iot_device` d LEFT JOIN iot_product_base_info p on d.product_id = p.id and p.del = 1 where p.del=1 and is_grant=0 GROUP BY d.product_id, d.manufacturer_id, d.hospital, d.category_code ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> map : list){
            Integer inventoryCount = map.get("inventoryCount") == null ? 0: Integer.parseInt(map.get("inventoryCount") + "");
            Integer inventoryFloor = map.get("inventory_floor") == null ? 0: Integer.parseInt(map.get("inventory_floor") + "");
            Integer inventoryUpper = map.get("inventory_upper") == null ? 0: Integer.parseInt(map.get("inventory_upper") + "");
            if(inventoryCount < inventoryFloor || inventoryCount > inventoryUpper){
                IotMessageDO iotMessageDO = new IotMessageDO();
                iotMessageDO.setTitle("库存预警提醒");
                iotMessageDO.setContent("您的库存" + map.get("name") + "设备已达到预警数量,当前数量为:" + inventoryCount + "台,请及时维护库存。");
                iotMessageDO.setReadMsg("0");
                iotMessageDO.setDel("0");
                iotMessageDO.setType("2");
                iotMessageDao.save(iotMessageDO);
            }
        }
    }
}

+ 1 - 1
svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/SimBalanceService.java

@ -1,4 +1,4 @@
package com.yihu.jw.service.channel;
package com.yihu.jw.service.device;
import com.yihu.iot.dao.device.IotDeviceSimDao;
import com.yihu.iot.dao.dict.IotSystemDictDao;

+ 1 - 3
svr/svr-iot-job/src/main/java/com/yihu/jw/service/channel/SimSetMealService.java

@ -1,9 +1,7 @@
package com.yihu.jw.service.channel;
package com.yihu.jw.service.device;
import com.yihu.iot.dao.device.IotDeviceSimDao;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.message.IotMessageDO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 3
svr/svr-iot-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -9,9 +9,9 @@ import com.yihu.jw.job.wlw.DeviceQualityPlanJob;
import com.yihu.jw.job.wlw.SimBalanceJob;
import com.yihu.jw.job.wlw.SimSetMealJob;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.channel.DeviceQualityPlanService;
import com.yihu.jw.service.channel.SimBalanceService;
import com.yihu.jw.service.channel.SimSetMealService;
import com.yihu.jw.service.device.DeviceQualityPlanService;
import com.yihu.jw.service.device.SimBalanceService;
import com.yihu.jw.service.device.SimSetMealService;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.web.BaseController;

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

@ -93,7 +93,7 @@ wechat:
---
spring:
  profiles: jwtest
  profiles: iottest
  datasource:
    url: jdbc:mysql://172.26.0.104/xmiot?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
@ -285,3 +285,17 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/xmiot?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
wlyy:
  url: http://www.xmtyw.cn/wlyy/

+ 8 - 0
svr/svr-iot-job/src/main/resources/bootstrap.yml

@ -59,3 +59,11 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://172.16.100.63:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      label: ${wlyy.spring.config.label:master}

+ 20 - 1
svr/svr-iot/src/main/resources/application.yml

@ -171,4 +171,23 @@ spring:
fast-dfs:
  tracker-server: 10.95.22.139:22122 #服务器地址
fastDFS:
  fastdfs_file_url: http://www.xmtyw.cn/
  fastdfs_file_url: http://www.xmtyw.cn/
---
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/xmiot?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 59.61.92.90:20010,59.61.92.90:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://59.61.92.90:20009,http://59.61.92.90:20011
  wlyy:
    url: http://ehr.yihu.com/wlyy/
fast-dfs:
  tracker-server: 172.19.103.54:22122 #服务器地址
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

+ 11 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java

@ -134,6 +134,17 @@ public class SpecialistScreenResultService {
        String templateSql = "select t.is_third from "+basedb+".wlyy_survey_templates t where t.code = '" + templateCode + "' and t.del = 1 ";
        String thirdId = jdbcTemplate.queryForObject(templateSql, String.class);
        surveyScreenResultVo.setIsThird(thirdId);
        //获取转诊信息
        String reservationSql = "SELECT * FROM " + basedb + ".`wlyy_patient_reservation` r where r.relation_code = '" + code + "' and r.`status` = 1 ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(reservationSql);
        if (list.size() > 0) {
            Map<String, Object> m = list.get(0);
            surveyScreenResultVo.setDoctorNameReservation(m.get("doctor_name").toString());
            String czrq = m.get("czrq").toString();
            String startTime = m.get("start_time").toString();
            surveyScreenResultVo.setCzrqReservation(czrq.substring(0, czrq.length() - 2));
            surveyScreenResultVo.setStartTimeReservation(startTime.substring(0, startTime.length() - 2));
        }
        map.put("info",surveyScreenResultVo);
        //json.put("info",surveyScreenResultVo);