From 28b988ca5dc4b51de34c6ebf996579723b2db414 Mon Sep 17 00:00:00 2001 From: lisy <java@lishouyideAir.lan> Date: 星期五, 16 六月 2023 09:13:09 +0800 Subject: [PATCH] other模块——门店实体的添加;account模块——查询附近门店接口 --- cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 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 dd46b96..bd7438f 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 @@ -1,10 +1,15 @@ package com.dsh.account.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dsh.account.entity.TStudent; import com.dsh.account.mapper.TStudentMapper; +import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; import com.dsh.account.service.TStudentService; -import com.baomidou.mybatisplus.service.impl.ServiceImpl; + import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.Date; /** * <p> @@ -17,4 +22,24 @@ @Service public class TStudentServiceImpl extends ServiceImpl<TStudentMapper, TStudent> implements TStudentService { + @Override + public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) { + TStudent student = new TStudent(); + student.setAppUserId(appUserId); + student.setName(stu.getName()); + student.setHeadImg(stu.getHeadImg()); + student.setPhone(stu.getPhone()); + student.setSex(stu.getSex()); + student.setIdCard(stu.getIdCard()); + student.setBirthday(new Date(stu.getBirthday())); + 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()); + student.setInsertTime(new Date()); + student.setState(1); + this.baseMapper.insert(student); + } } -- Gitblit v1.7.1