Explorar el Código

[CMT]修改专科

wangzhinan hace 6 años
padre
commit
e6893bbf24

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/health/bank/HealthBankMapping.java

@ -73,5 +73,6 @@ public class HealthBankMapping {
        public static final String selectByPatientAndDate = "/selectByPatientAndDate";
        public static final String selectByPatientAndDate = "/selectByPatientAndDate";
        public static final String selectTaskAndPatients = "/selectTaskAndPatients";
        public static final String selectTaskAndPatients = "/selectTaskAndPatients";
        public static final String shareIntegrate = "/shareIntegrate";
        public static final String shareIntegrate = "/shareIntegrate";
        public static final String payIntegrate = "/payIntegrate";
    }
    }
}
}

+ 32 - 0
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/CreditsDetailController.java

@ -346,5 +346,37 @@ public class CreditsDetailController extends EnvelopRestEndpoint {
        }
        }
    }
    }
    /**
     * 商城积分支付
     *
     * @param patient 居民code
     * @param total 订单总积分
     * @param hospital 社区code
     * @param hospitalName 社区名称
     * @param orders 订单集合[{orders:,integrate}]
     * @return
     */
    @PostMapping(value = HealthBankMapping.healthBank.payIntegrate)
    @ApiOperation(value = "商城积分支付")
    public MixEnvelop<CreditsDetailDO, CreditsDetailDO> payIntegrate(@ApiParam(name = "patient",value = "居民code")
                                                                       @RequestParam(value = "patient",required = false)String patient,
                                                                     @ApiParam(name = "total",value = "需要支付的总积分")
                                                                     @RequestParam(value = "total",required = false)Double total,
                                                                     @ApiParam(name = "hospital",value = "社区code")
                                                                     @RequestParam(value = "hospital",required = false)String hospital,
                                                                     @ApiParam(name = "hospitalName",value = "社区名称")
                                                                     @RequestParam(value = "hospitalName",required = false)String hospitalName,
                                                                     @ApiParam(name = "orders",value = "订单集合")
                                                                     @RequestParam(value = "orders",required = false)String orders){
        try {
            JSONArray array = JSONArray.parseArray(orders);
            return service.payIntegrate(patient,total,hospital,hospitalName,array);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}
}

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

@ -1342,4 +1342,52 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
        }
        }
    }
    }
    /**
     * 商城积分支付
     * @param patient
     * @param total
     * @param hospital
     * @param hospitalName
     * @param array
     * @return
     * @throws Exception
     */
    public MixEnvelop<CreditsDetailDO,CreditsDetailDO> payIntegrate(String patient,Double total,String hospital,String hospitalName,JSONArray array) throws Exception {
        MixEnvelop<CreditsDetailDO,CreditsDetailDO> envelop = new MixEnvelop<>();
        AccountDO accountDO = accountDao.selectByPatientId(patient);
        Integer total1 = total.intValue();
        if (accountDO == null){
            envelop.setMessage("银行账户不存在!");
            throw new Exception("银行账户不存在!");
        }else {
            if (total1>accountDO.getTotal()){
                envelop.setMessage("积分余额不足!");
                throw new Exception("积分余额不足!");
            }else{
                for (int i=0;i<array.size();i++){
                    JSONObject object = array.getJSONObject(i);
                    CreditsDetailDO creditsDetailDO = new CreditsDetailDO();
                    creditsDetailDO.setPatientId(patient);
                    creditsDetailDO.setAccountId(accountDO.getId());
                    creditsDetailDO.setHospital(hospital);
                    creditsDetailDO.setTradeType("SHOPPING_PAY");
                    creditsDetailDO.setTradeDirection(-1);
                    creditsDetailDO.setTransactionId(object.getString("orderId"));
                    creditsDetailDO.setIntegrate(object.getDouble("integrate").intValue());
                    creditsDetailDO.setCreateTime(new Date());
                    creditsDetailDO.setUpdateTime(new Date());
                    creditsDetailDO.setSaasId("dev");
                    creditsDetailDO.setId(getCode());
                    creditsDetailDO.setCoupon(0);
                    creditsDetailDO.setStatus(1);
                    credittsLogDetailDao.save(creditsDetailDO);
                }
                accountDO.setTotal(accountDO.getTotal()-total1);
                accountDao.save(accountDO);
            }
        }
        return envelop;
    }
}
}

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

@ -52,24 +52,24 @@ fast-dfs:
spring:
spring:
  profiles: jwdev
  profiles: jwdev
  datasource:
  datasource:
    url: jdbc:mysql://172.19.103.77:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://172.26.0.114:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: root
    username: root
    password: 123456
    password: jkzlehr
  redis:
  redis:
    host: 192.168.131.172 # Redis server host.
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
    port: 6379 # Redis server port.
    #    password: jkzl_ehr
    #    password: jkzl_ehr
  data:
  data:
    elasticsearch: #ElasticsearchProperties
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      cluster-nodes: 172.26.0.112:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
      properties: # Additional properties used to configure the client.
        enable: true
        enable: true
    # JEST (Elasticsearch HTTP client) (JestProperties)
    # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
  elasticsearch:
    jest:
    jest:
      uris: http://172.19.103.68:9200
      uris: http://172.26.0.112:9200
#     uris: [图片]http://172.19.103.68:9200
#     uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
      multi-threaded: true # Enable connection requests from multiple execution threads.
@ -79,30 +79,30 @@ spring:
      proxy.host:  # Proxy host the HTTP client should use.
      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
  fastdfs_file_url: http://172.26.0.110:80/
---
---
spring:
spring:
  profiles: jwtest
  profiles: jwtest
  datasource:
  datasource:
    url: jdbc:mysql://172.17.110.160:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://172.26.0.104:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    username: ssgg
    password: ssgg
    password: ssgg@jkzl2019
  redis:
  redis:
    host: 192.168.131.172 # Redis server host.
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
#    password: jkzl_ehr
  data:
  data:
    elasticsearch: #ElasticsearchProperties
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      cluster-nodes: 172.26.0.112:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
      properties: # Additional properties used to configure the client.
        enable: true
        enable: true
  # JEST (Elasticsearch HTTP client) (JestProperties)
  # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
  elasticsearch:
    jest:
    jest:
      uris: http://172.19.103.68:9200
      uris: http://172.26.0.112:9200
#      uris: [图片]http://172.19.103.68:9200
#      uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
      multi-threaded: true # Enable connection requests from multiple execution threads.
@ -111,7 +111,7 @@ spring:
      proxy.port:  # Proxy port the HTTP client should use.
      proxy.port:  # Proxy port the HTTP client should use.
      proxy.host:  # Proxy host the HTTP client should use.
      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
  fastdfs_file_url: http://172.26.0.110:80/
---
---
spring:
spring:

+ 8 - 8
svr/svr-wlyy-specialist/src/main/resources/application.yml

@ -73,8 +73,8 @@ spring:
  datasource:
  datasource:
    url: jdbc:mysql://172.19.103.77:3306/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://172.19.103.77:3306/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: root
    password: 123456
    username: ceshi
    password: ssgg@jkzl2019
  redis:
  redis:
    host: 172.19.103.88 # Redis server host.
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    port: 6379 # Redis server port.
@ -109,11 +109,11 @@ spring:
  profiles: jwtest
  profiles: jwtest
  datasource:
  datasource:
    url: jdbc:mysql://172.17.110.160/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    password: ssgg
    url: jdbc:mysql://172.26.0.104/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ceshi
    password: ssgg@jkzl2019
  redis:
  redis:
    host: 172.19.103.88 # Redis server host.
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
    port: 6379 # Redis server port.
fastDFS:
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
  fastdfs_file_url: http://172.19.103.54:80/
@ -145,11 +145,11 @@ spring:
  profiles: jwdevtest
  profiles: jwdevtest
  datasource:
  datasource:
    url: jdbc:mysql://172.19.103.85/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://172.26.0.104/wlyy_specialist?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: linzhou
    username: linzhou
    password: linzhou
    password: linzhou
  redis:
  redis:
    host: 192.168.131.172 # Redis server host.
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
    port: 6379 # Redis server port.
fastDFS:
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
  fastdfs_file_url: http://172.19.103.54:80/