Kaynağa Gözat

支付界面获取量表名称接口调整

zsf 5 ay önce
ebeveyn
işleme
683acd00a8

+ 0 - 1
src/main/java/com/rf/psychological/scale/dao/model/MBTIResultDetail.java

@@ -20,7 +20,6 @@ import javax.persistence.Table;
 @EqualsAndHashCode(callSuper=false)
 @Table(name = "t_mbti_result_detail")
 @org.hibernate.annotations.Table(appliesTo = "t_mbti_result_detail", comment = "MBTI结果详情")
-@DynamicUpdate(value = true)
 public class MBTIResultDetail extends BaseEntity {
 
     @Column(name = "flag",columnDefinition = "varchar(20)  comment '标识'")

+ 5 - 2
src/main/java/com/rf/psychological/scale/service/impl/MBTIResultDetailServiceImpl.java

@@ -1,5 +1,6 @@
 package com.rf.psychological.scale.service.impl;
 
+import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.RandomUtil;
 import com.rf.psychological.scale.dao.model.MBTIResultDetail;
 import com.rf.psychological.scale.dao.repository.MBTIResultDetailRepository;
@@ -23,7 +24,9 @@ public class MBTIResultDetailServiceImpl implements MBTIResultDetailService {
 
     @Override
     public MBTIResultDetail findByFlag(String flag) {
-        MBTIResultDetail detail = detailRepository.findByFlag(flag);
+        MBTIResultDetail detail1 = detailRepository.findByFlag(flag);
+        MBTIResultDetail detail = new MBTIResultDetail();
+        BeanUtil.copyProperties(detail1,detail);
         if (detail != null){
             detail.setConclusion(this.getRandomResult(detail.getConclusion()));
             detail.setCharacteristic(this.getRandomResultByNum(detail.getCharacteristic(),3));
@@ -36,7 +39,7 @@ public class MBTIResultDetailServiceImpl implements MBTIResultDetailService {
             detail.setRevered(this.getRandomResult(detail.getRevered()));
             detail.setRepresentative(this.getRandomResultByNum(detail.getRepresentative(),4));
         }
-        return detailRepository.findByFlag(flag);
+        return detail;
     }
 
     private String getRandomResult(String str) {

+ 3 - 2
src/main/java/com/rf/psychological/wxpay/controller/PromotionInfoController.java

@@ -60,9 +60,10 @@ public class PromotionInfoController extends BaseController {
     public Result queryPromotionBySubjectId(@PathVariable String subjectId){
         try {
             PromotionInfo info = infoService.findInfoByFlag(subjectId);
-            ScaleDetailsEntity entity = scaleDetailsService.getSubjectDetailsByFlag(info.getFlag());
+            SubjectEntity entity = subjectService.getSubjectEntityByFlag(info.getFlag());
+            //ScaleDetailsEntity entity = scaleDetailsService.getSubjectDetailsByFlag(info.getFlag());
             if (entity != null){
-                info.setName(entity.getScaleName());
+                info.setName(entity.getName());
             }
             return success(info);
         }catch (Exception e ){