Browse Source

代码修改

LAPTOP-KB9HII50\70708 4 months ago
parent
commit
012021825f

+ 11 - 0
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/dao/CreditsUniqueDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.dao;
import com.yihu.jw.entity.health.bank.CreditsUniqueDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by yeshijie on 2024/11/26.
 */
public interface CreditsUniqueDao extends PagingAndSortingRepository<CreditsUniqueDO,Long>, JpaSpecificationExecutor<CreditsUniqueDO> {
}

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

@ -17,7 +17,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -58,7 +58,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    @Autowired
    private TaskRuleDao taskRuleDao;
    @Autowired
    private StringRedisTemplate redisTemplate;
    private CreditsUniqueDao creditsUniqueDao;
    @Autowired
    private ActiveRecordService activeRecordService;
    @Autowired
@ -830,8 +830,6 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    public MixEnvelop<CreditsDetailDO, CreditsDetailDO> stepAddIntegrate(CreditsDetailDO creditsDetailDO){
        try {
            synchronized (creditsDetailDO.getPatientId()){
//                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));
                List<AccountDO> accountDOList = accountDao.findByPatientId(creditsDetailDO.getPatientId());
                if (accountDOList != null && accountDOList.size() != 0){
                    creditsDetailDO.setAccountId(accountDOList.get(0).getId());
@ -855,7 +853,6 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                    accountDO1.setUpdateTime(new Date());
                    accountDao.save(accountDO1);
                    List<AccountDO> accountDOS = accountDao.findByPatientId(creditsDetailDO.getPatientId());
//                    List<AccountDO> accountDOS = jdbcTemplate.query(sqlAccount,new BeanPropertyRowMapper(AccountDO.class));
                    creditsDetailDO.setAccountId(accountDOS.get(0).getId());
                }
                String sql1 = "select *  from wlyy_health_bank_task_patient_detail where "+
@ -895,6 +892,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                                creditsDetailDO.setUpdateTime(new Date());
                                creditsDetailDO.setCreateTime(new Date());
                                creditsDetailDO.setTradeType("ACTIVITY_TASK");
                                addCreditsUnique(creditsDetailDO);//新增唯一标识 防止重复领取积分
                                CreditsDetailDO creditsDetailDO2 = credittsLogDetailDao.save(creditsDetailDO);
                                AccountDO accountDO = accountDao.findOne(creditsDetailDO2.getAccountId());
                                accountDO.setTotal(accountDO.getTotal()+creditsDetailDO2.getIntegrate());
@ -910,6 +908,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                            CreditsDetailDO creditsDetailDO1 = new CreditsDetailDO();
                            if (creditsDetailDO.getStepNumber()>0 && creditsDetailDO.getStepNumber()<=step){
                                creditsDetailDO1.setIntegrate(creditsDetailDO.getIntegrate());
                                creditsDetailDO1.setStepNumber(creditsDetailDO.getStepNumber());
                                creditsDetailDO1.setTradeDirection(1);
                                creditsDetailDO1.setSaasId("dev");
                                creditsDetailDO1.setTradeType("ACTIVITY_TASK");
@ -920,6 +919,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                                creditsDetailDO1.setStatus(1);
                                creditsDetailDO1.setCreateTime(new Date());
                                creditsDetailDO1.setUpdateTime(new Date());
                                addCreditsUnique(creditsDetailDO1);//新增唯一标识 防止重复领取积分
                                creditsDetailDO1.setTransactionId(taskPatientDetailDO.getTaskId());
                                CreditsDetailDO creditsDetailDO2 = credittsLogDetailDao.save(creditsDetailDO1);
                                AccountDO accountDO = accountDao.findOne(creditsDetailDO2.getAccountId());
@ -944,6 +944,11 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                envelop.setDetailModelList(creditsDetailDOS);
                return envelop;
            }
        }catch (DataIntegrityViolationException ce){
            MixEnvelop<CreditsDetailDO, CreditsDetailDO> envelop = new MixEnvelop<>();
            envelop.setStatus(-1);
            envelop.setMessage("请勿重复领取积分");
            return envelop;
        }catch (Exception e){
            e.printStackTrace();
            MixEnvelop<CreditsDetailDO, CreditsDetailDO> envelop = new MixEnvelop<>();
@ -952,6 +957,28 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    }
    /**
     * 获取现在时间
     *
     * @return 返回短时间字符串格式yyyy-MM-dd
     */
    public static String getStringDateShort() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(currentTime);
    }
    public void addCreditsUnique(CreditsDetailDO creditsDetailDO){
        CreditsUniqueDO creditsUniqueDO = new CreditsUniqueDO();
        creditsUniqueDO.setDate(getStringDateShort());
        creditsUniqueDO.setCreateTime(new Date());
        creditsUniqueDO.setStepNumber(creditsDetailDO.getStepNumber()+"");
        creditsUniqueDO.setPatient(creditsDetailDO.getPatientId());
        creditsUniqueDO.setIntegrate(creditsDetailDO.getIntegrate()+"");
        creditsUniqueDO.setTaskId(creditsDetailDO.getTransactionId());
        creditsUniqueDao.save(creditsUniqueDO);
    }
    public MixEnvelop doctorDescreaseIntegrate(String ruleId,String patientId,String doctorId,String hospital,String hospitalName,Integer integrate,String reason,String type,String name,String idcard) throws Exception {
        MixEnvelop envelop = new MixEnvelop<>();
        envelop.setObj(true);

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/TaskPatientDtailService.java

@ -186,7 +186,7 @@ public class TaskPatientDtailService extends BaseJpaService<TaskPatientDetailDO,
     */
    public List<TaskPatientDetailDO> select(Integer page,Integer size){
        String sql ="SELECT * FROM `wlyy_health_bank_task_patient_detail` btpd " +
                "GROUP BY btpd.activity_id, btpd.patient_id ORDER BY btpd.create_time limit "+(page-1)*size+","+size;
                " ORDER BY btpd.create_time limit "+(page-1)*size+","+size;
        sql = TransforSqlUtl.wlyyHealthBankTaskPatientDetailAll(sql);
        List<TaskPatientDetailDO> taskPatientDetailDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(TaskPatientDetailDO.class));
        for (TaskPatientDetailDO taskPatientDetailDO : taskPatientDetailDOS){

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

@ -153,24 +153,24 @@ spring:
  profiles: prod
  datasource:
    url: jdbc:mysql://59.61.92.90:9069/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.3:20002/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy_new
    password: J4&y9sk#1G
    password: '@TaVAj%LEK@vB2J4&y9sk@TaVAj%LEK'
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    password: jkzlehr
    host: 10.90.32.3 # Redis server host.
    port: 222142  # Redis server port.
    password: o!a1#B74&m
  data:
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 59.61.92.90:9066,59.61.92.90:9068 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      cluster-nodes: 10.90.32.3:22287,10.90.32.3:22289 #配置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://10.90.32.3:22286,http://10.90.32.3:22288
  #     uris: [图片]http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
@ -180,3 +180,36 @@ spring:
  #      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
---
spring:
  profiles: hzprod
  datasource:
    url: jdbc:mysql://10.18.43.40:3306/wlyy_health_bank?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: '0XxS3W*!cRj'
  redis:
    host: 10.18.43.40 # Redis server host.
    port: 6379  # Redis server port.
    password: Kb6wKDQP1W4
  data:
    elasticsearch: #ElasticsearchProperties
      cluster-name: jkzl #默认即为elasticsearch  集群名
      cluster-nodes: 10.18.43.40:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
      local: false #是否本地连接
      properties: # Additional properties used to configure the client.
        enable: true
    # JEST (Elasticsearch HTTP client) (JestProperties)
  elasticsearch:
    jest:
      uris: http://10.18.43.40: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: zjxl
      password: 6Dbq&fHg
  #      proxy.port:  # Proxy port the HTTP client should use.
  #      proxy.host:  # Proxy host the HTTP client should use.
fastDFS:
  fastdfs_file_url: https://zhyzh.gongshu.gov.cn/fastdfs/

+ 1 - 1
svr/svr-wlyy-health-bank/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-wlyy-health-bank
    name: svr-wlyy-health-bank---
  cloud:
    config:
      failFast: true