Browse Source

天数期限开通,语音功能优化

hurixing 7 months ago
parent
commit
5a7ba0e180
23 changed files with 234 additions and 19 deletions
  1. 5 3
      hcp-app/src/main/java/com/yingyangfly/app/controller/VoiceController.java
  2. 4 0
      hcp-app/src/test/java/com/yingyangfly/app/controller/VoiceControllerTest.java
  3. 27 0
      hcp-core/src/main/java/com/yingyangfly/core/domain/AppTimeFluctuationRecord.java
  4. 2 0
      hcp-core/src/main/java/com/yingyangfly/core/domain/SysOrg.java
  5. 11 0
      hcp-core/src/main/java/com/yingyangfly/core/dto/SpeechSynthesis.java
  6. 4 2
      hcp-core/src/main/java/com/yingyangfly/core/enums/MsgTemplateEnums.java
  7. 9 0
      hcp-core/src/main/java/com/yingyangfly/core/mapper/AppTimeFluctuationRecordMapper.java
  8. 10 0
      hcp-core/src/main/java/com/yingyangfly/core/service/AppTimeFluctuationRecordService.java
  9. 2 0
      hcp-core/src/main/java/com/yingyangfly/core/service/EaDetectInfoService.java
  10. 24 0
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/AppTimeFluctuationRecordServiceImpl.java
  11. 43 0
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/AppUserService.java
  12. 2 0
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/EaDetectDetailServiceImpl.java
  13. 22 2
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/EaDetectInfoServiceImpl.java
  14. 1 1
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/LearnPackageServiceImpl.java
  15. 6 0
      hcp-core/src/main/java/com/yingyangfly/core/service/impl/WxApplicationBlankServiceImpl.java
  16. 25 0
      hcp-core/src/main/java/com/yingyangfly/core/util/SmgUtil.java
  17. 2 0
      hcp-core/src/main/java/com/yingyangfly/core/vo/SysOrgVo.java
  18. 6 4
      hcp-large-screen/src/main/java/com/yingyangfly/large/screen/controller/VoiceController.java
  19. 3 3
      hcp-large-screen/src/main/java/com/yingyangfly/large/screen/util/BaiduVoiceUtil.java
  20. 9 4
      hcp-platform/src/main/java/com/yingyangfly/platform/controller/EaDetectInfoController.java
  21. 15 0
      hcp-platform/src/main/java/com/yingyangfly/platform/controller/PatientController.java
  22. 1 0
      hcp-platform/src/main/resources/application-dev.yml
  23. 1 0
      hcp-platform/src/main/resources/application-prod.yml

+ 5 - 3
hcp-app/src/main/java/com/yingyangfly/app/controller/VoiceController.java

@@ -5,12 +5,14 @@ import com.yingyangfly.common.dto.ResultResponse;
 import com.yingyangfly.common.log.annotation.TraceLog;
 import com.yingyangfly.common.utils.MD5Util;
 import com.yingyangfly.core.annotation.Log;
+import com.yingyangfly.core.dto.SpeechSynthesis;
 import com.yingyangfly.core.enums.OperatorType;
 import com.yingyangfly.redis.client.RedisClient;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -34,12 +36,12 @@ public class VoiceController {
     @ApiOperation("声音语音合成")
     @RequestMapping("/getVoiceUrl")
     @TraceLog
-    public ResultResponse getVoiceUrl(String voiceMsg){
-        String voiceUrl = redisClient.get("hcp:voice:"+MD5Util.md5(voiceMsg),"");
+    public ResultResponse getVoiceUrl(@RequestBody SpeechSynthesis speechSynthesis){
+        String voiceUrl = redisClient.get("hcp:voice:"+MD5Util.md5(speechSynthesis.getVoiceMsg()),"");
         if(!StringUtils.isEmpty(voiceUrl)){
              return ResultResponse.success(voiceUrl);
         }else{
-            return baiduVoiceUtil.getVoiceUrl(voiceMsg,"5");
+            return baiduVoiceUtil.getVoiceUrl(speechSynthesis.getVoiceMsg(),speechSynthesis.getSed());
         }
     }
 

+ 4 - 0
hcp-app/src/test/java/com/yingyangfly/app/controller/VoiceControllerTest.java

@@ -3,6 +3,7 @@ package com.yingyangfly.app.controller;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson2.JSON;
 import com.yingyangfly.HcpAppApplication;
+import com.yingyangfly.app.util.BaiduVoiceUtil;
 import com.yingyangfly.common.utils.DateUtils;
 import com.yingyangfly.common.utils.ids.IdUtils;
 import com.yingyangfly.core.api.impl.ImApiImpl;
@@ -47,6 +48,9 @@ class VoiceControllerTest {
     @Resource
     private MongoTemplate mongoTemplate;
 
+    @Autowired
+    private BaiduVoiceUtil baiduVoiceUtil;
+
     @Test
     void getVoiceUrl() {
 

+ 27 - 0
hcp-core/src/main/java/com/yingyangfly/core/domain/AppTimeFluctuationRecord.java

@@ -0,0 +1,27 @@
+package com.yingyangfly.core.domain;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class AppTimeFluctuationRecord {
+
+    private Long id;
+
+    private Long userId;
+
+    private String startTime;
+
+    private String endTime;
+
+    private int numberDays;
+
+    private String createBy;
+
+    private String updateBy;
+
+    private Date createTime;
+
+    private Date updateTime;
+}

+ 2 - 0
hcp-core/src/main/java/com/yingyangfly/core/domain/SysOrg.java

@@ -68,6 +68,8 @@ public class SysOrg extends BaseEntity {
     //  开通(新增)套餐权限  0 开通 1 关闭
     private String dealPackageStatus;
 
+    private String numberDaysStatus;
+
     private String wxUrl;
 
     private String workTime;

+ 11 - 0
hcp-core/src/main/java/com/yingyangfly/core/dto/SpeechSynthesis.java

@@ -0,0 +1,11 @@
+package com.yingyangfly.core.dto;
+
+import lombok.Data;
+
+@Data
+public class SpeechSynthesis {
+    private String sed;
+    private String voiceMsg;
+
+
+}

+ 4 - 2
hcp-core/src/main/java/com/yingyangfly/core/enums/MsgTemplateEnums.java

@@ -9,8 +9,10 @@ public enum MsgTemplateEnums {
     /**
      * 登录验证码
      */
-    GET_CHECK_CODE("CHECK_CODE", "SMS_470580061"),
-    CHANGE_PASSWORD_CODE("CHANGE_PASSWORD_CODE","SMS_483175131");
+    GET_CHECK_CODE("CHECK_CODE", "SMS_470580061"),  // app登录
+    CHANGE_PASSWORD_CODE("CHANGE_PASSWORD_CODE","SMS_483175131"),
+    ANALYSIS_REGISTER_CODE("ANALYSIS_REGISTER_CODE","SMS_497405048"), // 早筛注册验证码
+    ORDER_PAY_SUCCEED("ORDER_PAY_SUCCEED","SMS_497250056");  //线上订单支付成功
     private final String name;
     private final String tempalteCode;
 

+ 9 - 0
hcp-core/src/main/java/com/yingyangfly/core/mapper/AppTimeFluctuationRecordMapper.java

@@ -0,0 +1,9 @@
+package com.yingyangfly.core.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yingyangfly.core.domain.AppTimeFluctuationRecord;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface AppTimeFluctuationRecordMapper extends BaseMapper<AppTimeFluctuationRecord> {
+}

+ 10 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/AppTimeFluctuationRecordService.java

@@ -0,0 +1,10 @@
+package com.yingyangfly.core.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yingyangfly.core.domain.AppTimeFluctuationRecord;
+
+public interface AppTimeFluctuationRecordService extends IService<AppTimeFluctuationRecord> {
+
+
+    Boolean saveAppTimeFluctuationRecord(AppTimeFluctuationRecord appTimeFluctuationRecord);
+}

+ 2 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/EaDetectInfoService.java

@@ -9,4 +9,6 @@ import org.springframework.stereotype.Service;
 public interface EaDetectInfoService extends IService<EaDetectInfo> {
 
     IPage<EaDetectInfo> selectByPage(EaDetectInfo eaDetectInfo);
+
+    Boolean getCheckCode(String mobile,String random);
 }

+ 24 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/impl/AppTimeFluctuationRecordServiceImpl.java

@@ -0,0 +1,24 @@
+package com.yingyangfly.core.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yingyangfly.core.domain.AppTimeFluctuationRecord;
+import com.yingyangfly.core.mapper.AppTimeFluctuationRecordMapper;
+import com.yingyangfly.core.service.AppTimeFluctuationRecordService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+public class AppTimeFluctuationRecordServiceImpl extends ServiceImpl<AppTimeFluctuationRecordMapper, AppTimeFluctuationRecord> implements AppTimeFluctuationRecordService {
+
+
+    /**
+     * 新增记录
+     * @param appTimeFluctuationRecord
+     * @return
+     */
+    @Override
+    public Boolean saveAppTimeFluctuationRecord(AppTimeFluctuationRecord appTimeFluctuationRecord) {
+        return baseMapper.insert(appTimeFluctuationRecord) > 0;
+    }
+}

+ 43 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/impl/AppUserService.java

@@ -31,6 +31,7 @@ import com.yingyangfly.core.vo.WxPayJsApiPreVO;
 import com.yingyangfly.redis.client.RedisClient;
 import lombok.extern.slf4j.Slf4j;
 import org.assertj.core.util.Sets;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -110,6 +111,9 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
     @Resource
     private ReviewTaskService reviewTaskService;
 
+    @Resource
+    private AppTimeFluctuationRecordService appTimeFluctuationRecordService;
+
     @Resource
     private PayService payService;
 
@@ -987,6 +991,45 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
         return appUserMapper.updateById(upAppUser) > 0;
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    public void openPhysiotherapyTime(AppTimeFluctuationRecord appTimeFluctuationRecord)throws ParseException{
+        // 获取患者信息
+        AppUser appUser = appUserMapper.selectById(appTimeFluctuationRecord.getUserId());
+        AppUser appUserUpdate = new AppUser();
+        if(StringUtils.isEmpty(appUser.getOrderStartTime())){
+            appUserUpdate.setOrderStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date()));
+        }
+        Date endDate = null;
+        if (StringUtils.isEmpty(appUser.getOrderEndTime())){
+            endDate = DateUtils.addDays(new Date(),appTimeFluctuationRecord.getNumberDays());
+            appTimeFluctuationRecord.setStartTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,new Date()));
+        }else {
+            appTimeFluctuationRecord.setStartTime(appUser.getOrderEndTime());
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            if (new Date().compareTo(dateFormat.parse(appUser.getOrderEndTime())) <= 0){
+                //套餐有效内
+                endDate = DateUtils.addDays(DateUtils.parseDate(appUser.getOrderEndTime()),appTimeFluctuationRecord.getNumberDays());
+            }else {
+                //套餐有效期外
+                endDate = DateUtils.addDays(new Date(),appTimeFluctuationRecord.getNumberDays());
+            }
+        }
+
+        appUserUpdate.setId(appUser.getId());
+        appUserUpdate.setOrderEndTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,endDate));
+        log.info("<<<<<<<<<<<<<<<<套餐结束时间:{}>>>>>>>>>>>>>",appUserUpdate.getOrderEndTime());
+        log.info("<<<<<<<<<<<<<<记录开通>>>>>>>>>>>>>>>");
+        CurrentLoginUser currentUser = tokenUtil.getCurrentUser();
+        appTimeFluctuationRecord.setEndTime(appUserUpdate.getOrderEndTime());
+        appTimeFluctuationRecord.setCreateBy(currentUser.getUsername());
+        appTimeFluctuationRecord.setCreateTime(new Date());
+        appUserMapper.updateById(appUserUpdate);
+        appTimeFluctuationRecordService.save(appTimeFluctuationRecord);
+        log.info("<<<<<<<<<<<<<<im续费>>用户信息:{}>>>>>>>>>>>>>>>>>",JSON.toJSONString(appUser));
+        String msgDesn = String.format("尊敬的%s,您好,您购买了%s天训练时间,已经生效,截止日期为%s",appUser.getName(),appTimeFluctuationRecord.getNumberDays(),appUserUpdate.getOrderEndTime());
+        msgWarnService.save(buildMsgWarn(appUser.getId(),"A","缴费通知",msgDesn,appUser.getOrgCode(),appUser.getOrgName()));
+    }
+
     /**
      * 按钮开通  患者套餐
      */

+ 2 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/impl/EaDetectDetailServiceImpl.java

@@ -4,11 +4,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yingyangfly.core.domain.EaDetectDetail;
 import com.yingyangfly.core.mapper.EaDetectDetailMapper;
 import com.yingyangfly.core.service.EaDetectDetailService;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.util.Collections;
 import java.util.List;
 
+@Slf4j
 @Service
 public class EaDetectDetailServiceImpl extends ServiceImpl<EaDetectDetailMapper, EaDetectDetail> implements EaDetectDetailService {
 

+ 22 - 2
hcp-core/src/main/java/com/yingyangfly/core/service/impl/EaDetectInfoServiceImpl.java

@@ -1,24 +1,32 @@
 package com.yingyangfly.core.service.impl;
 
+import com.alibaba.excel.util.StringUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yingyangfly.common.dto.ResultResponse;
+import com.yingyangfly.core.domain.AppUser;
 import com.yingyangfly.core.domain.EaDetectInfo;
 import com.yingyangfly.core.domain.SysOrg;
 import com.yingyangfly.core.dto.CurrentLoginUser;
+import com.yingyangfly.core.enums.MsgTemplateEnums;
 import com.yingyangfly.core.mapper.EaDetectInfoMapper;
 import com.yingyangfly.core.security.util.TokenUtil;
 import com.yingyangfly.core.service.EaDetectInfoService;
 import com.yingyangfly.core.util.Sm4Util;
+import com.yingyangfly.core.util.SmgUtil;
+import com.yingyangfly.redis.client.RedisClient;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.nio.charset.StandardCharsets;
 import java.util.Base64;
 import java.util.Iterator;
+import java.util.Random;
 
 @Slf4j
 @Service
@@ -31,6 +39,12 @@ public class EaDetectInfoServiceImpl extends ServiceImpl<EaDetectInfoMapper, EaD
     @Resource
     private SysOrgService sysOrgService;
 
+    @Resource
+    private RedisClient redisClient;
+
+    @Value("${spring.profiles.active}")
+    private String active;
+
     @Override
     public IPage<EaDetectInfo> selectByPage(EaDetectInfo eaDetectInfo) {
         LambdaQueryWrapper<EaDetectInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -49,8 +63,14 @@ public class EaDetectInfoServiceImpl extends ServiceImpl<EaDetectInfoMapper, EaD
         return baseMapper.selectPage(eaDetectInfoPage,lambdaQueryWrapper);
     }
 
-
-
+    @Override
+    public Boolean getCheckCode(String mobile,String random) {
+        String phone = new String(
+                Base64.getDecoder().decode(mobile),
+                StandardCharsets.UTF_8
+        );;
+        return SmgUtil.sendCheckCode(phone, MsgTemplateEnums.ANALYSIS_REGISTER_CODE.getTempalteCode(), random);
+    }
 
 
     public boolean hasPermission() {

+ 1 - 1
hcp-core/src/main/java/com/yingyangfly/core/service/impl/LearnPackageServiceImpl.java

@@ -100,7 +100,7 @@ public class LearnPackageServiceImpl implements LearnPackageService {
                 }
             }
         }else {
-            if (!learningPackage.getOrgCode().equals("system")) {
+            if (!currentUser.getOrgCode().equals("system")) {
                 SysOrg oryCodeSysOrg = sysOrgService.getOryCodeSysOrg(learningPackage.getOrgCode());
                 if ("1".equals(oryCodeSysOrg.getDealPackageStatus())) {
                     throw new RuntimeException("权限不足,请联系管理员");

+ 6 - 0
hcp-core/src/main/java/com/yingyangfly/core/service/impl/WxApplicationBlankServiceImpl.java

@@ -9,6 +9,7 @@ import com.yingyangfly.core.domain.AppUser;
 import com.yingyangfly.core.domain.PayOrder;
 import com.yingyangfly.core.domain.SysUser;
 import com.yingyangfly.core.domain.WxApplicationBlank;
+import com.yingyangfly.core.enums.MsgTemplateEnums;
 import com.yingyangfly.core.mapper.AppUserMapper;
 import com.yingyangfly.core.mapper.PayOrderMapper;
 import com.yingyangfly.core.mapper.WxApplicationBlankMapper;
@@ -16,6 +17,7 @@ import com.yingyangfly.core.security.util.TokenUtil;
 import com.yingyangfly.core.service.WxApplicationBlankService;
 import com.yingyangfly.core.util.AmountUtils;
 import com.yingyangfly.core.util.Sm4Util;
+import com.yingyangfly.core.util.SmgUtil;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.jacoco.agent.rt.internal_035b120.core.internal.flow.IFrame;
@@ -61,6 +63,10 @@ public class WxApplicationBlankServiceImpl extends ServiceImpl<WxApplicationBlan
     public Integer payUpdateApplicationBlank(WxApplicationBlank wxApplicationBlank,String orderNumber) {
         LambdaQueryWrapper<WxApplicationBlank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(WxApplicationBlank::getPayOrderId,orderNumber);
+
+//        WxApplicationBlank wxApplicationBlank1 = baseMapper.selectOne(lambdaQueryWrapper);
+        //发送成功验证码
+//        SmgUtil.sendNotificationCheckCode(Sm4Util.decrypt(wxApplicationBlank1.getMobile()),MsgTemplateEnums.ORDER_PAY_SUCCEED.getTempalteCode());
         return baseMapper.update(wxApplicationBlank,lambdaQueryWrapper);
     }
 

+ 25 - 0
hcp-core/src/main/java/com/yingyangfly/core/util/SmgUtil.java

@@ -60,4 +60,29 @@ public class SmgUtil {
             return false;
         }
     }
+
+    public static Boolean sendNotificationCheckCode(String mobile,String templateCode) {
+        try {
+            log.info("<<<<<<<<<<<<<<调用阿里云参数手机:{},模板:{}>>>>>>>>>>>>", mobile, templateCode);
+            Client client = createClient(accessKeyId, accessKeySecret);
+            SendSmsRequest sendSmsRequest = new SendSmsRequest();
+            sendSmsRequest.setSignName("耀荣医疗科技");
+            sendSmsRequest.setPhoneNumbers(mobile);
+            sendSmsRequest.setTemplateCode(templateCode);
+//            Map<String, Object> map = new HashMap<>();
+//            map.put("code", random);
+//            sendSmsRequest.setTemplateParam(JSON.toJSONString(map));
+            RuntimeOptions runtime = new RuntimeOptions();
+            SendSmsResponse resp = client.sendSmsWithOptions(sendSmsRequest, runtime);
+            log.info("<<<<<<<<<<<<<<<<调用阿里云短信响应:{}>>>>>>>>>>>>>>>>", JSON.toJSONString(resp));
+            if (resp.getStatusCode() == 200 && "OK".equals(resp.getBody().getCode())) {
+                return true;
+            } else {
+                return false;
+            }
+        } catch (Exception e) {
+            log.error("<<<<<<<<<<<<<<<<调用阿里云短信失败:{}>>>>>>>>>>>>", e);
+            return false;
+        }
+    }
 }

+ 2 - 0
hcp-core/src/main/java/com/yingyangfly/core/vo/SysOrgVo.java

@@ -61,6 +61,8 @@ public class SysOrgVo {
     //  开通(新增)套餐权限  0 开通 1 关闭
     private String dealPackageStatus;
 
+    private String numberDaysStatus;
+
     private String wxUrl;
 
     private String workTime;

+ 6 - 4
hcp-large-screen/src/main/java/com/yingyangfly/large/screen/controller/VoiceController.java

@@ -4,11 +4,13 @@ import com.yingyangfly.common.dto.ResultResponse;
 import com.yingyangfly.common.log.annotation.TraceLog;
 import com.yingyangfly.common.utils.MD5Util;
 import com.yingyangfly.core.annotation.Log;
+import com.yingyangfly.core.dto.SpeechSynthesis;
 import com.yingyangfly.core.enums.OperatorType;
 import com.yingyangfly.large.screen.util.BaiduVoiceUtil;
 import com.yingyangfly.redis.client.RedisClient;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -30,12 +32,12 @@ public class VoiceController {
     @Log(title = "声音语音合成",operatorType = OperatorType.OTHER)
     @RequestMapping("/getVoiceUrl")
     @TraceLog
-    public ResultResponse getVoiceUrl(String voiceMsg){
-        String voiceUrl = redisClient.get("hcp:voice:"+MD5Util.md5(voiceMsg),"");
+    public ResultResponse getVoiceUrl(@RequestBody SpeechSynthesis speechSynthesis){
+        String voiceUrl = redisClient.get("hcp:voice:"+MD5Util.md5(speechSynthesis.getVoiceMsg()),"");
         if(!StringUtils.isEmpty(voiceUrl)){
-             return ResultResponse.success(voiceUrl);
+            return ResultResponse.success(voiceUrl);
         }else{
-            return baiduVoiceUtil.getVoiceUrl(voiceMsg);
+            return baiduVoiceUtil.getVoiceUrl(speechSynthesis.getVoiceMsg(),speechSynthesis.getSed());
         }
     }
 }

+ 3 - 3
hcp-large-screen/src/main/java/com/yingyangfly/large/screen/util/BaiduVoiceUtil.java

@@ -48,7 +48,7 @@ public class BaiduVoiceUtil {
     private RedisClient redisClient;
 
 
-    public ResultResponse getVoiceUrl(String voiceMsg){
+    public ResultResponse getVoiceUrl(String voiceMsg,String spd){
         if(client == null){
             // 初始化一个AipSpeech
             client = new AipSpeech(APP_ID, API_KEY, SECRET_KEY);
@@ -58,9 +58,9 @@ public class BaiduVoiceUtil {
         client.setSocketTimeoutInMillis(60000);
         // 调用接口
         HashMap<String, Object> options = new HashMap<String, Object>();
-        options.put("spd", "5");
+        options.put("spd", spd);
         options.put("pit", "5");
-        options.put("per", "4");
+        options.put("per", "0");
         TtsResponse res = client.synthesis(voiceMsg, "zh", 1, options);
         byte[] data = res.getData();
         if(data == null){

+ 9 - 4
hcp-platform/src/main/java/com/yingyangfly/platform/controller/EaDetectInfoController.java

@@ -4,11 +4,9 @@ import com.yingyangfly.common.dto.ResultResponse;
 import com.yingyangfly.common.log.annotation.TraceLog;
 import com.yingyangfly.core.domain.EaDetectInfo;
 import com.yingyangfly.core.service.EaDetectInfoService;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -26,4 +24,11 @@ public class EaDetectInfoController {
         return ResultResponse.success(eaDetectInfoService.selectByPage(eaDetectInfo));
     }
 
+    @ApiOperation("手机短信换取登录")
+    @PostMapping("/getCheckCode")
+    @TraceLog
+    public ResultResponse getCheckCode(String mobile,String random){
+        return ResultResponse.success(eaDetectInfoService.getCheckCode(mobile,random));
+    }
+
 }

+ 15 - 0
hcp-platform/src/main/java/com/yingyangfly/platform/controller/PatientController.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.yingyangfly.common.dto.ResultResponse;
 import com.yingyangfly.common.log.annotation.TraceLog;
 import com.yingyangfly.core.annotation.Log;
+import com.yingyangfly.core.domain.AppTimeFluctuationRecord;
 import com.yingyangfly.core.domain.AppUser;
 import com.yingyangfly.core.domain.Equipment;
 import com.yingyangfly.core.domain.SysOrg;
@@ -195,6 +196,20 @@ public class PatientController {
         return ResultResponse.success();
     }
 
+    @Log(title = "不付费开通天数理疗功能")
+    @PostMapping("/open/physiotherapyTime")
+    public ResultResponse openPhysiotherapyTime(@RequestBody AppTimeFluctuationRecord appTimeFluctuationRecord) throws ParseException {
+        CurrentLoginUser currentUser = tokenUtil.getCurrentUser();
+        if (!currentUser.getOrgCode().equals("system")) {
+            SysOrg oryCodeSysOrg = sysOrgService.getOryCodeSysOrg(currentUser.getOrgCode());
+            if ("1".equals(oryCodeSysOrg.getNumberDaysStatus())) {
+                return ResultResponse.fail("权限不足,请联系管理员");
+            }
+        }
+        appUserService.openPhysiotherapyTime(appTimeFluctuationRecord);
+        return ResultResponse.success();
+    }
+
     @PostMapping("/reset/password")
     @TraceLog
     public ResultResponse resetPasswordSys(@RequestBody AppUser appUser) {

+ 1 - 0
hcp-platform/src/main/resources/application-dev.yml

@@ -122,6 +122,7 @@ security:
       - /learn/package/tencent/learnPackage
       - /wx/tencent/**
       - /ws-notification/*
+      - /ea/detectInfo/getCheckCode
 
 query-daily-trai: http://60.205.122.15/h5-training-daily/index.html
 

+ 1 - 0
hcp-platform/src/main/resources/application-prod.yml

@@ -117,6 +117,7 @@ security:
       - /system/dict/data/selectByDictType
       - /learn/package/tencent/learnPackage
       - /wx/tencent/**
+      - /ea/detectInfo/getCheckCode
 
 query-daily-trai: https://yaorong.yaorongmedical.com/h5-training-daily/index.html