From 062fb1ed6efcaac5d75bbe184524c4929dff7fcd Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期三, 18 十月 2023 15:25:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java | 39 +++++++++++++++++++++++++++------------ 1 files changed, 27 insertions(+), 12 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java index a4d184e..4933f96 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java @@ -3,14 +3,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.dsh.account.dto.CreateHistoryDto; -import com.dsh.account.dto.GetHistoryDto; -import com.dsh.account.dto.StudentSearch; -import com.dsh.account.dto.TStudentDto; -import com.dsh.account.entity.Coach; -import com.dsh.account.entity.TAppUser; -import com.dsh.account.entity.TCourseInfoRecord; -import com.dsh.account.entity.TStudent; +import com.dsh.account.dto.*; +import com.dsh.account.entity.*; import com.dsh.account.feignclient.activity.IntroduceRewardsClient; import com.dsh.account.feignclient.activity.UserConponClient; import com.dsh.account.feignclient.activity.model.IntrduceOfUserRequest; @@ -50,6 +44,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -141,11 +136,21 @@ student.setHeight(stu.getHeight()); student.setWeight(stu.getWeight()); BigDecimal bigDecimal = BigDecimal.valueOf(stu.getWeight()); - BigDecimal multiply = bigDecimal.subtract(BigDecimal.valueOf(stu.getHeight())).multiply(bigDecimal.subtract(BigDecimal.valueOf(stu.getHeight()))); - multiply.setScale(2); - student.setBmi(multiply.doubleValue()); + double v = stu.getHeight() / 100; + double v1 = v * v; + BigDecimal bigDecimal1 = new BigDecimal(v1).setScale(2, RoundingMode.HALF_UP); + double v2 = bigDecimal.doubleValue() / bigDecimal1.doubleValue(); + BigDecimal bigDecimal2 = new BigDecimal(v2).setScale(2, RoundingMode.HALF_UP); + student.setBmi(bigDecimal2.doubleValue()); student.setInsertTime(new Date()); student.setState(1); + + List<TStudent> tStudents = this.baseMapper.selectList(new LambdaQueryWrapper<TStudent>().eq(TStudent::getAppUserId, appUserId)); + if(tStudents.size()>0){ + student.setIsDefault(2); + }else { + student.setIsDefault(1); + } this.baseMapper.insert(student); //同步信息到参赛人员信息中 @@ -782,7 +787,7 @@ detailsVo.setLon(store.getLon()); detailsVo.setLat(store.getLat()); detailsVo.setPhone(store.getPhone()); - detailsVo.setVenueList(steClient.getAppUserSiteList()); + detailsVo.setVenueList(steClient.getAppUserSiteList(storeId)); List<StoreOfCourseVo> storeOfCourseList = culisClient.getStoreOfCourseList(storeId); System.out.println(storeOfCourseList); detailsVo.setCourseVoList(storeOfCourseList); @@ -834,5 +839,15 @@ return this.baseMapper.getHistory(); } + @Override + public Integer getGiftSelect(GiftSearchDto giftSearchDto) { + return this.baseMapper.getGiftSelect(giftSearchDto); + } + + @Override + public List<Map<String, Object>> queryCom(Integer id) { + return this.baseMapper.queryCom(id); + } + } -- Gitblit v1.7.1