Переглянути джерело

Merge branch 'dev' of yeshijie/wlyy2.0 into dev

叶仕杰 4 роки тому
батько
коміт
6bef512083

+ 1 - 5
common/common-entity/pom.xml

@ -23,10 +23,6 @@
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>6.0.13.Final</version>
        </dependency>
    </dependencies>
</project>

+ 3 - 28
svr/svr-iot-job/pom.xml

@ -32,10 +32,6 @@
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
@ -82,17 +78,15 @@
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
            <version>${parent.version}</version>
            <artifactId>common-exception</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>im-service</artifactId>
            <version>2.0.0</version>
            <artifactId>common-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
            <artifactId>common-web</artifactId>
        </dependency>
        <!-- Jzkl Starter -->
        <dependency>
@ -106,18 +100,6 @@
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
@ -151,13 +133,6 @@
            <version>2.4.4</version>
        </dependency>
        <!--oracle驱动-->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>
    </dependencies>
    <build>

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

@ -1,17 +1,11 @@
package com.yihu.jw.service.device;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.iot.device.IotDeviceDO;
import com.yihu.jw.entity.iot.device.IotDeviceSimDO;
import com.yihu.jw.entity.iot.device.IotPatientDeviceDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.repository.device.IotDeviceDao;
import com.yihu.jw.repository.device.IotDeviceSimDao;
import com.yihu.jw.repository.device.IotPatientDeviceDao;
import com.yihu.jw.repository.dict.IotSystemDictDao;
import com.yihu.jw.restmodel.iot.device.IotOrderVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
@ -23,7 +17,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @author HZY
@ -72,96 +65,7 @@ public class IotDeviceSimService extends BaseJpaService<IotDeviceSimDO, IotDevic
        iotDeviceSimDao.save(simDO);
    }
    /**
     *新增SIM卡
     * @param json
     */
    public MixEnvelop<IotOrderVO, IotOrderVO> addSIM(String json) {
        IotDeviceSimDO sim = JSONObject.parseObject(json, IotDeviceSimDO.class);
        IotDeviceSimDO deviceSimDaoBySim = iotDeviceSimDao.findBySim(sim.getSim());
        if(deviceSimDaoBySim!=null){
            return MixEnvelop.getError("SIM已存在");
        }
        IotPatientDeviceDO patientSim = iotPatientDeviceDao.findBySim(sim.getSim());
        if (patientSim!=null){
            sim.setDeviceName(patientSim.getDeviceName());
            sim.setDeviceSn(patientSim.getDeviceSn());
            sim.setContactsName(patientSim.getPatientName());
            sim.setContactsMobile(patientSim.getMobile());
        } else {
            IotDeviceDO deviceSim = iotDeviceDao.findBySimNo(sim.getSim());
            if (deviceSim!=null){
                sim.setDeviceName(deviceSim.getName());
                sim.setDeviceSn(deviceSim.getDeviceSn());
            }
        }
        sim.setRemainingBalance(sim.getAdvancePayment()-sim.getPayment());
        sim.setStatus(1);
        sim.setDel("0");
        iotDeviceSimDao.save(sim);
        return MixEnvelop.getSuccess(IotRequestMapping.DeviceSim.message_success_add);
    }
    /**
     * 条件分页查找
     * @param page
     * @param size
     * @param status
     * @param sim
     * @param sn
     * @return
     */
    public MixEnvelop<IotDeviceSimDO, IotDeviceSimDO> conditionQueryPage(Integer page, Integer size, String status, String sim, String sn){
        StringBuffer sql = new StringBuffer("SELECT c.* from iot_device_sim c WHERE 1=1 ");
        StringBuffer sqlCount = new StringBuffer("SELECT COUNT(c.id) count from iot_device_sim c  WHERE 1=1 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(status)){
            sql.append(" and c.status=? ");
            sqlCount.append("and c.status='").append(status).append("' ");
            args.add(status);
        }
        if(StringUtils.isNotBlank(sim)){
            sql.append(" and (c.sim like '%").append(sim).append("%')");
            sqlCount.append(" and (c.sim like '%").append(sim).append("%')");
        }
        if(StringUtils.isNotBlank(sn)){
            sql.append(" and (c.device_sn like '%").append(sn).append("%')");
            sqlCount.append(" and (c.device_sn like '%").append(sn).append("%')");
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceSimDO> list = jdbcTemplate.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotDeviceSimDO.class));
        List<Map<String,Object>> countList = jdbcTemplate.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.DeviceSim.message_success_find,list, page, size,count);
    }
    /**
     * 分页查找所有应用SIM卡信息
     * @param page
     * @param size
     * @return
     */
    public MixEnvelop<IotDeviceSimDO, IotDeviceSimDO> findAllSim(Integer page, Integer size) {
        StringBuffer sql= new StringBuffer("SELECT DISTINCT * FROM iot_device_sim ");
        sql.append(" limit ").append((page-1)*size).append(",").append(size);
        List<IotDeviceSimDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotDeviceSimDO.class));
        //获取总数
        long count = list.size();
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.DeviceSim.message_success_find,list,page, size,count);
    }
    /**

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

@ -1,10 +1,6 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.job.wlw.DeviceQualityPlanJob;
import com.yihu.jw.job.wlw.InventoryWarningJob;
import com.yihu.jw.job.wlw.SimBalanceJob;
@ -26,7 +22,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
@ -43,15 +38,6 @@ public class JobController extends BaseController {
    private final JobService jobService;
    private final QuartzHelper quartzHelper;
    @Autowired
    private ImService imService;
    @Autowired
    private DataGeneratorService dataGeneratorService;
    @Autowired
    private YkyyInternetService ykyyInternetService;
    @Autowired
    private SimBalanceService simBalanceService;
@ -302,31 +288,6 @@ public class JobController extends BaseController {
    }
    @RequestMapping(value = "/delData", method = RequestMethod.POST)
    @ApiOperation("删除数据")
    public String delData(String doctor,String date) {
        try {
            List<WlyyOutpatientDO> list = dataGeneratorService.delData(doctor,date);
            imService.deleteJobData(list,date);
            return write(200, "数据已经删除");
        } catch (Exception e) {
            error(e);
            return error(-1, "数据已经删除");
        }
    }
    @RequestMapping(value = "/testImg", method = RequestMethod.GET)
    @ApiOperation("测试图片")
    public String testImg(String path) {
      return write(200, ykyyInternetService.testImg(path));
    }
    @RequestMapping(value = "/deviceInventoryWarning", method = RequestMethod.GET)
    @ApiOperation("设备库存预警提醒")
    public String deviceInventoryWarning() {

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

@ -120,81 +120,6 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwOracleTest
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@172.26.0.141:1521:helowin
    username: normal
    password: normal
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
hlwyyEntrance:
  url: http://172.16.1.42:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwOracleProd
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@10.10.10.16:1521/rac
    username: HLWYY
    password: Xmykzxhlwyy963
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
hlwyyEntrance:
  url: http://172.16.1.42:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.26.0.105:3000/
  data_base_name: im_internet_hospital
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
spring:
  profiles: jwprod
@ -224,78 +149,13 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: xzprod
  datasource:
    url: jdbc:mysql://172.16.100.240:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: jkzl
    password: jkzl@2020
hlwyyEntrance:
  url: http://172.16.100.63:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.16.100.241:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://172.16.100.240:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: xzprod_in
  datasource:
    url: jdbc:mysql://192.168.103.155:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: jkzl
    password: jkzl@2020
hlwyyEntrance:
  url: http://172.16.100.63:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://192.168.103.150:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://192.168.103.159:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
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
    url: jdbc:mysql://10.90.32.2: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/

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

@ -74,5 +74,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}

+ 10 - 0
svr/svr-wlyy-health-bank/pom.xml

@ -25,6 +25,10 @@
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
@ -111,6 +115,12 @@
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>