Parcourir la source

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

trick9191 il y a 7 ans
Parent
commit
593d1ae349

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/health/bank/CreditsDetailDO.java

@ -51,6 +51,9 @@ public class CreditsDetailDO extends IdEntityWithOperation implements Serializab
    @Transient
    private String flag ; // 标识是什么任务
    @Transient
    private Integer total;  //总积分
    public String getSaasId() {
        return saasId;
    }
@ -146,4 +149,12 @@ public class CreditsDetailDO extends IdEntityWithOperation implements Serializab
    public void setFlag(String flag) {
        this.flag = flag;
    }
    public Integer getTotal() {
        return total;
    }
    public void setTotal(Integer total) {
        this.total = total;
    }
}

+ 55 - 38
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

@ -191,47 +191,64 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
     * @param creditsDetailDO
     * @return
     */
    public Envelop<CreditsDetailDO> insert(CreditsDetailDO creditsDetailDO){
        TaskDO taskDO = new TaskDO();
        taskDO.setTaskCode(creditsDetailDO.getFlag());
        taskDO.setPatientId(creditsDetailDO.getPatientId());
        String sql = ISqlUtils.getSql(taskDO,1,1,"*");
        List<TaskDO> taskDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(TaskDO.class));
        if (taskDOList != null && taskDOList.size() != 0){
            creditsDetailDO.setTransactionId(taskDOList.get(0).getId());
        }
        String sqlAccount = "select * from wlyy_health_bank_account ba where ba.patient_id = '"+creditsDetailDO.getPatientId() +"'";
        List<AccountDO> accountDOList = jdbcTemplate.query(sqlAccount,new BeanPropertyRowMapper(AccountDO.class));
        if (accountDOList != null && accountDOList.size() != 0){
            creditsDetailDO.setAccountId(accountDOList.get(0).getId());
        }
        if (creditsDetailDO.getTradeDirection() == 1){
            if (creditsDetailDO.getTradeType().equals("HEALTH_TASK")){
                TaskDetailDO taskDetailDO = new TaskDetailDO();
                taskDetailDO.setIntegrate(creditsDetailDO.getIntegrate());
                taskDetailDO.setTaskId(creditsDetailDO.getTransactionId());
                taskDetailDO.setSaasId(creditsDetailDO.getSaasId());
                taskDetailDO.setPatientId(creditsDetailDO.getPatientId());
                taskDetailDO.setTradeDirection(creditsDetailDO.getTradeDirection());
                taskDetailDO.setStatus("1");
                taskDetailDao.save(taskDetailDO);
    public Envelop<CreditsDetailDO> insert(CreditsDetailDO creditsDetailDO){
        try {
            synchronized (creditsDetailDO.getPatientId()){
                TaskDO taskDO = new TaskDO();
                taskDO.setTaskCode(creditsDetailDO.getFlag());
                taskDO.setPatientId(creditsDetailDO.getPatientId());
                String sql = ISqlUtils.getSql(taskDO,1,1,"*");
                List<TaskDO> taskDOList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(TaskDO.class));
                if (taskDOList != null && taskDOList.size() != 0){
                    creditsDetailDO.setTransactionId(taskDOList.get(0).getId());
                }
                String sqlAccount = "select * from wlyy_health_bank_account ba where ba.patient_id = '"+creditsDetailDO.getPatientId() +"'";
                List<AccountDO> accountDOList = jdbcTemplate.query(sqlAccount,new BeanPropertyRowMapper(AccountDO.class));
                if (accountDOList != null && accountDOList.size() != 0){
                    creditsDetailDO.setAccountId(accountDOList.get(0).getId());
                }
                if (creditsDetailDO.getTradeDirection() == 1){
                    if (creditsDetailDO.getTradeType().equals("HEALTH_TASK")){
                        TaskDetailDO taskDetailDO = new TaskDetailDO();
                        taskDetailDO.setIntegrate(creditsDetailDO.getIntegrate());
                        taskDetailDO.setTaskId(creditsDetailDO.getTransactionId());
                        taskDetailDO.setSaasId(creditsDetailDO.getSaasId());
                        taskDetailDO.setPatientId(creditsDetailDO.getPatientId());
                        taskDetailDO.setTradeDirection(creditsDetailDO.getTradeDirection());
                        taskDetailDO.setStatus("1");
                        taskDetailDO.setCreateTime(new Date());
                        taskDetailDO.setUpdateTime(new Date());
                        taskDetailDao.save(taskDetailDO);
                    }
                }
                creditsDetailDO.setCreateTime(new Date());
                creditsDetailDO.setUpdateTime(new Date());
                CreditsDetailDO creditsDetailDO1 =credittsLogDetailDao.save(creditsDetailDO);
                creditsDetailDO1.setFlag(creditsDetailDO.getFlag());
                List<CreditsDetailDO> creditsDetailDOList = new ArrayList<>();
                creditsDetailDOList.add(creditsDetailDO1);
                AccountDO accountDO = accountDao.findOne(creditsDetailDO1.getAccountId());
                if (creditsDetailDO1.getTradeDirection() == 1){
                    accountDO.setTotal(accountDO.getTotal()+creditsDetailDO1.getIntegrate());
                }else if (creditsDetailDO.getTradeDirection() == -1){
                    accountDO.setTotal(accountDO.getTotal()-creditsDetailDO1.getIntegrate());
                }
                AccountDO accountDO1 = accountDao.save(accountDO);
                List<CreditsDetailDO> creditsDetailDOS = new ArrayList<>();
                for (CreditsDetailDO creditsDetailDO2:creditsDetailDOList){
                    creditsDetailDO2.setTotal(accountDO1.getTotal());
                    creditsDetailDOS.add(creditsDetailDO2);
                }
                Envelop<CreditsDetailDO> envelop = new Envelop<>();
                envelop.setDetailModelList(creditsDetailDOS);
                return envelop;
            }
        }catch (Exception e){
            e.printStackTrace();
            Envelop<CreditsDetailDO> envelop = new Envelop<>();
            return envelop;
        }
        CreditsDetailDO creditsDetailDO1 =credittsLogDetailDao.save(creditsDetailDO);
        creditsDetailDO1.setFlag(creditsDetailDO.getFlag());
        List<CreditsDetailDO> creditsDetailDOList = new ArrayList<>();
        creditsDetailDOList.add(creditsDetailDO1);
        AccountDO accountDO = accountDao.findOne(creditsDetailDO1.getAccountId());
        if (creditsDetailDO1.getTradeDirection() == 1){
            accountDO.setTotal(accountDO.getTotal()+creditsDetailDO1.getIntegrate());
        }else if (creditsDetailDO.getTradeDirection() == -1){
            accountDO.setTotal(accountDO.getTotal()-creditsDetailDO1.getIntegrate());
        }
        accountDao.save(accountDO);
        Envelop<CreditsDetailDO> envelop = new Envelop<>();
        envelop.setDetailModelList(creditsDetailDOList);
        return envelop;
    }
}

+ 54 - 19
svr/svr-wlyy-health-bank/src/main/resources/application.yml

@ -24,25 +24,6 @@ spring:
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
#  data:
#    elasticsearch: #ElasticsearchProperties
#      cluster-name: jkzl #默认即为elasticsearch  集群名
#      cluster-nodes: 172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
#      local: false #是否本地连接
#      properties: # Additional properties used to configure the client.
#        enable: true
#  # JEST (Elasticsearch HTTP client) (JestProperties)
#  elasticsearch:
#    jest:
#      uris: http://172.19.103.68:9200
##      uris: http://172.19.103.68:9200
#      connection-timeout: 60000 # Connection timeout in milliseconds.
#      multi-threaded: true # Enable connection requests from multiple execution threads.
#      username: # Login user.
#      password: # Login password.
#      proxy.port:  # Proxy port the HTTP client should use.
#      proxy.host:  # Proxy host the HTTP client should use.
#hibernate 配置
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
@ -72,6 +53,24 @@ spring:
    url: jdbc:mysql://172.19.103.77:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: root
    password: 123456
  data:
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
        enable: true
    # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
    jest:
      uris: http://172.19.103.68:9200
#     uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
      username: # Login user.
      password: # Login password.
      proxy.port:  # Proxy port the HTTP client should use.
      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
@ -82,6 +81,24 @@ spring:
    url: jdbc:mysql://172.19.103.77:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: root
    password: 123456
  data:
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
        enable: true
  # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
    jest:
      uris: http://172.19.103.68:9200
#      uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
      username: # Login user.
      password: # Login password.
      proxy.port:  # Proxy port the HTTP client should use.
      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
@ -93,5 +110,23 @@ spring:
    url: jdbc:mysql://59.61.92.90:9069/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
  data:
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 59.61.92.90:9066,59.61.92.90:9068 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
        enable: true
    # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
    jest:
      uris: http://59.61.92.90:9065,http://59.61.92.90:9067
  #     uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  #      username: # Login user.
  #      password: # Login password.
  #      proxy.port:  # Proxy port the HTTP client should use.
  #      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/