作者 mdx

小程序修改 基本信息,个人信息

后台 班级管理,年级管理
正在显示 25 个修改的文件 包含 481 行增加34 行删除
... ... @@ -4,6 +4,7 @@ import java.util.List;
import java.util.Arrays;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import javax.validation.constraints.*;
... ... @@ -69,9 +70,9 @@ public class CGradeController extends BaseController {
}
/**
* 获取学校年级详细信息
* 获取需要修改的年级信息
*/
@ApiOperation("获取学校年级详细信息")
@ApiOperation("获取需要修改的年级信息")
@PreAuthorize("@ss.hasPermi('demo:grade:query')")
@GetMapping("/{id}")
public AjaxResult<CGradeVo> getInfo(@NotNull(message = "主键不能为空")
... ... @@ -92,9 +93,9 @@ public class CGradeController extends BaseController {
}
/**
* 修改学校年级
* 修改学校年级和班级
*/
@ApiOperation("修改学校年级")
@ApiOperation("修改学校年级和班级")
@PreAuthorize("@ss.hasPermi('demo:grade:edit')")
@Log(title = "学校年级", businessType = BusinessType.UPDATE)
@RepeatSubmit
... ... @@ -104,26 +105,27 @@ public class CGradeController extends BaseController {
}
/**
* 删除学校
* 删除学校
*/
@ApiOperation("删除学校级")
@ApiOperation("删除学校级")
@PreAuthorize("@ss.hasPermi('demo:grade:remove')")
@Log(title = "学校级" , businessType = BusinessType.DELETE)
@Log(title = "学校级" , businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(iCGradeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
}
/**
* 查询此学校下所有的年级
*/
*//*
@ApiOperation("查询此年级下的所有年级")
@GetMapping("/getAllGrades")
public AjaxResult myAllGrades(@RequestBody CGradeBo bo){
return iCGradeService.getAllGrades(bo);
}
}*/
/**
* 添加年级
... ... @@ -161,7 +163,7 @@ public class CGradeController extends BaseController {
/**
* 查询此学校下所有班级
*/
*//*
@ApiOperation("查询此学校下所有班级")
@PostMapping("/getAllClasses")
public AjaxResult myAllClasses(@RequestBody CGradeBo bo){
... ... @@ -169,7 +171,7 @@ public class CGradeController extends BaseController {
log.info("<<<接收的参数<<<::"+bo);
return iCGradeService.getAllClasses(bo);
}
}*/
/**
* 查询此学校下正常状态的班级
... ... @@ -181,4 +183,70 @@ public class CGradeController extends BaseController {
return iCGradeService.getClasses(gradeParentId);
}
/**
* 查看年级的详细信息
*/
@ApiImplicitParam(name = "gradeId",value ="年级ID",dataType = "Long",required = true,paramType = "query")
@ApiOperation("查看年级的详细信息")
@PostMapping("/getGradeInfo")
public AjaxResult myGradeInfo(Long gradeId){
log.info("<<<接收的参数<<<::"+gradeId);
return iCGradeService.getGradeInfo(gradeId);
}
/**
* 查看班级的详细信息
*/
@ApiImplicitParam(name = "gradeId",value = "班级ID",dataType = "Long",required = true,paramType = "query")
@ApiOperation("查看班级的详细信息")
@PostMapping("/getClassInfo")
public AjaxResult myClassInfo(Long gradeId){
log.info("<<<接收的参数<<<::"+gradeId);
return iCGradeService.getClassInfo(gradeId);
}
/**
* 获取需要修改的班级信息
*/
@ApiImplicitParam(name = "gradeId",value = "班级ID",dataType = "Long",required = true,paramType = "query")
@ApiOperation("获取需要修改的班级信息")
@GetMapping("/getClassInfo")
public AjaxResult myClassEdit(Long gradeId){
log.info("<<<接收的参数<<<::"+gradeId);
return iCGradeService.getUpdateClassInfo(gradeId);
}
/**
* 删除学校年级
*/
@ApiOperation("删除学校年级")
@DeleteMapping("/deleteGrade/{ids}")
public AjaxResult myDeleteGrade(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
List<@NotEmpty(message = "主键不能为空") Long> gradeIds = Arrays.asList(ids);
return iCGradeService.deleteGrade(gradeIds);
}
/**
* 删除学校班级(备选)
*/
@ApiOperation("删除学校班级(备选)")
@DeleteMapping("/deleteClasses/{ids}")
public AjaxResult myDeleteClasses(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
List<@NotEmpty(message = "主键不能为空") Long> gradeIds = Arrays.asList(ids);
return iCGradeService.deleteClasses(gradeIds);
}
}
... ...
package cn.bronet.admin.demo.domain.bo;
import cn.bronet.admin.common.core.domain.BaseEntity;
import cn.bronet.admin.common.core.validate.AddGroup;
import cn.bronet.admin.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
/**
... ... @@ -42,6 +45,7 @@ public class CGradeBo extends BaseEntity {
* 学校班级类型 1-年级 2-班级 3-其他
*/
@ApiModelProperty("学校班级类型 1-年级 2-班级 3-其他")
@NotNull(message = "学校班级类型不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer gradeType;
/**
... ...
... ... @@ -152,5 +152,4 @@ public class CBasicInformationStudentVo {
@ApiModelProperty("可见(1 仅自己可见 2-品台可见 3全部可见)")
private String secret;
}
... ...
package cn.bronet.admin.demo.domain.vo;
import cn.bronet.admin.common.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 学校年级视图对象 c_grade
... ... @@ -22,6 +26,7 @@ public class CGradeVo {
* 编号
*/
@ApiModelProperty("编号")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
... ... @@ -51,8 +56,19 @@ public class CGradeVo {
@Excel(name = "父类id")
@ApiModelProperty("父类id")
private Long parentId;
/**
* 状态
*/
@Excel(name = "状态")
@ApiModelProperty("状态 0-正常 1-不正常")
private Integer state;
/**
* 创建时间
*/
@Excel(name = "创建时间")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
}
... ...
... ... @@ -118,5 +118,12 @@ public class CPersonalInformationVo {
@ApiModelProperty("粉丝数")
private Long beanVermicelli;
/**
* 头像照片
*/
@Excel(name = "头像照片")
@ApiModelProperty("头像照片")
private String headPortrait;
}
... ...
package cn.bronet.admin.demo.domain.vo;
import cn.bronet.admin.common.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.PathVariable;
import java.time.LocalDateTime;
@Data
public class ClassInfoVo {
/**
* 编号
*/
@ApiModelProperty("编号")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 类型名字
*/
@Excel(name = "类型名字")
@ApiModelProperty("类型名字")
private String gradeName;
/**
* 学校id
*/
@Excel(name = "学校id")
@ApiModelProperty("学校id")
private Long schoolId;
/**
* 学校班级类型 1-年级 2-班级 3-其他
*/
@Excel(name = "学校班级类型 1-年级 2-班级 3-其他")
@ApiModelProperty("学校班级类型 1-年级 2-班级 3-其他")
private Integer gradeType;
/**
* 父类id
*/
@Excel(name = "父类id")
@ApiModelProperty("父类id")
private Long parentId;
/**
* 状态
*/
@Excel(name = "状态")
@ApiModelProperty("状态 0-正常 1-不正常")
private Integer state;
/**
* 创建时间
*/
@Excel(name = "创建时间")
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
/**
* 年级信息
*/
private CGradeVo gradeVo;
}
... ...
package cn.bronet.admin.demo.domain.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Data
public class GradeInfoVo {
/**
* 年级ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
* 年级名称
*/
private String gradeName;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 班级集合
*/
private List<CGradeVo> classesList;
}
... ...
... ... @@ -20,7 +20,9 @@ import java.util.List;
public interface CGradeMapper extends BaseMapperPlus<CGrade> {
List<CGrade> selectBySchoolId(@Param("sid") Long sid, @Param("gtid") Integer gtid);
List<CGrade> selectBySchoolId(@Param("sid") Long sid, @Param("gtid") Long gtid);
Page<CGradeVo> customPageList(@Param("page") Page<CGrade> page, @Param("ew") Wrapper<CGrade> wrapper);
List<CGrade> selectByGradeParentId(Long gtid);
}
... ...
... ... @@ -2,6 +2,9 @@ package cn.bronet.admin.demo.mapper;
import cn.bronet.admin.demo.domain.CRegisterSchool;
import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus;
import cn.bronet.admin.demo.domain.CRelationshipStudentSgc;
import java.util.List;
/**
* 学校身份信息Mapper接口
... ... @@ -13,4 +16,5 @@ public interface CRegisterSchoolMapper extends BaseMapperPlus<CRegisterSchool> {
Long selectByUserId(Long uid);
}
... ...
... ... @@ -3,6 +3,8 @@ package cn.bronet.admin.demo.mapper;
import cn.bronet.admin.demo.domain.CRelationshipStudentSgc;
import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus;
import java.util.List;
/**
* 学生学校绑定表Mapper接口
*
... ... @@ -12,5 +14,5 @@ import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus;
public interface CRelationshipStudentSgcMapper extends BaseMapperPlus<CRelationshipStudentSgc> {
List<CRelationshipStudentSgc> selectByGradeId(Long gid);
}
... ...
... ... @@ -14,4 +14,6 @@ import java.util.List;
public interface CTeacherMapper extends BaseMapperPlus<CTeacher> {
List<Long> getTeachers(Long gid);
List<CTeacher> selectByGradeId(Long gid);
}
... ...
... ... @@ -19,7 +19,7 @@ import java.util.List;
public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> {
/**
* 查询单个
* 获取需要修改的学校年级或班级信息
* @return
*/
CGradeVo queryById(Long id);
... ... @@ -97,4 +97,38 @@ public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> {
*/
AjaxResult getClasses(Long gradeParentId);
/**
* 查询年级的详细信息
* @param gradeId
* @return
*/
AjaxResult getGradeInfo(Long gradeId);
/**
* 查询班级的详细信息
* @param gradeId
* @return
*/
AjaxResult getClassInfo(Long gradeId);
/**
* 获取需要修改的班级信息
* @param gradeId
* @return
*/
AjaxResult getUpdateClassInfo(Long gradeId);
/**
* 删除学校的年级
* @param gradeIds
* @return
*/
AjaxResult deleteGrade(List<Long> gradeIds);
/**
*删除学校班级(备选)
* @param gradeIds
* @return
*/
AjaxResult deleteClasses(List<Long> gradeIds);
}
... ...
package cn.bronet.admin.demo.service.impl;
import cn.bronet.admin.common.core.domain.AjaxResult;
import cn.bronet.admin.common.utils.ServletUtils;
import cn.bronet.admin.demo.domain.CRelationshipStudentSgc;
import cn.bronet.admin.demo.domain.CTeacher;
import cn.bronet.admin.demo.domain.CUser;
import cn.bronet.admin.demo.domain.vo.TestDemoVo;
import cn.bronet.admin.demo.mapper.CRegisterSchoolMapper;
import cn.bronet.admin.demo.mapper.CUserMapper;
import cn.bronet.admin.demo.domain.vo.ClassInfoVo;
import cn.bronet.admin.demo.domain.vo.GradeInfoVo;
import cn.bronet.admin.demo.mapper.*;
import cn.hutool.core.bean.BeanUtil;
import cn.bronet.admin.common.utils.PageUtils;
import cn.bronet.admin.common.core.page.PagePlus;
import cn.bronet.admin.common.core.page.TableDataInfo;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javassist.runtime.Desc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -23,8 +23,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import cn.bronet.admin.demo.domain.bo.CGradeBo;
import cn.bronet.admin.demo.domain.vo.CGradeVo;
import cn.bronet.admin.demo.domain.CGrade;
import cn.bronet.admin.demo.mapper.CGradeMapper;
import cn.bronet.admin.demo.service.ICGradeService;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.ArrayList;
... ... @@ -51,6 +52,12 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
@Autowired
private CRegisterSchoolMapper cRegisterSchoolMapper;
@Autowired
private CTeacherMapper cTeacherMapper;
@Autowired
private CRelationshipStudentSgcMapper cRelationshipStudentSgcMapper;
@Override
public CGradeVo queryById(Long id){
... ... @@ -60,7 +67,10 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
@Override
public TableDataInfo<CGradeVo> queryPageList(CGradeBo bo) {
// TODO: 2021/9/24 获取当前登录人Id
Long uId=119911L;
Long schoolId = cRegisterSchoolMapper.selectByUserId(uId);
bo.setSchoolId(schoolId);
PagePlus<CGrade, CGradeVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
return PageUtils.buildDataInfo(result);
... ... @@ -91,6 +101,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
@Override
public Boolean updateByBo(CGradeBo bo) {
CGrade update = BeanUtil.toBean(bo, CGrade.class);
validEntityBeforeSave(update);
return updateById(update);
... ... @@ -144,7 +155,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
public AjaxResult saveGrade(CGradeBo bo) {
//获取登录用户的Id
Long uId=111111L;
Long uId=119911L;
Long schoolId = cRegisterSchoolMapper.selectByUserId(uId);
//创建需要添加到数据库的参数
... ... @@ -171,7 +182,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
//获取登录人的Id
Long uId =119911L;
CUser cUser = cUserMapper.selectById(uId);
Long schoolId = cRegisterSchoolMapper.selectByUserId(uId);
//创建数据库查询条件
... ... @@ -214,7 +224,8 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
//创建存储信息
CGrade grade = new CGrade();
BeanUtils.copyProperties(bo,grade);
grade.setSchoolId(schoolId);
grade.setSchoolId(schoolId)
.setCreateTime(LocalDateTime.now());
cGradeMapper.insert(grade);
... ... @@ -251,7 +262,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
//获取登录人用户
Long uId=119911L;
CUser cUser = cUserMapper.selectById(uId);
Long schoolId = cRegisterSchoolMapper.selectByUserId(uId);
LambdaQueryWrapper<CGrade> wrapper = new LambdaQueryWrapper<>();
... ... @@ -275,4 +285,146 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr
return AjaxResult.success(vos);
}
/**
* 查询年级的信息信息
* @param gradeId
* @return
*/
@Override
public AjaxResult getGradeInfo(Long gradeId) {
GradeInfoVo vo = new GradeInfoVo();
CGrade grade = cGradeMapper.selectById(gradeId);
List<CGrade> classes = cGradeMapper.selectByGradeParentId( grade.getId());
List<CGradeVo> classesList = new ArrayList<>();
//判断 classes不为null
if (!classes.isEmpty()){
for (CGrade aClass : classes) {
CGradeVo classVo = new CGradeVo();
BeanUtils.copyProperties(aClass,classVo);
classesList.add(classVo);
}
vo.setClassesList(classesList);
}
//填数据到返回值中
vo.setGradeName(grade.getGradeName());
vo.setId(grade.getId());
vo.setCreateTime(grade.getCreateTime());
return AjaxResult.success(vo);
}
/**
* 查询班级的详细系信息
* @param gradeId
* @return
*/
@Override
public AjaxResult getClassInfo(Long gradeId) {
CGrade classVo = cGradeMapper.selectById(gradeId);
CGradeVo vo = new CGradeVo();
BeanUtils.copyProperties(classVo,vo);
return AjaxResult.success(vo);
}
/**
* 获取需要修改的班级Id
* @param gradeId
* @return
*/
@Override
public AjaxResult getUpdateClassInfo(Long gradeId) {
ClassInfoVo vo = new ClassInfoVo();
CGrade cClass = cGradeMapper.selectById(gradeId);
CGrade cGrade = cGradeMapper.selectById(cClass.getParentId());
if (cClass != null){
BeanUtils.copyProperties(cClass,vo);
}
if (cGrade != null){
CGradeVo cGradeVo = new CGradeVo();
BeanUtils.copyProperties(cGrade,cGradeVo);
vo.setGradeVo(cGradeVo);
}
return AjaxResult.success(vo);
}
/**
* 删除学校年级
* @param gradeIds
* @return
*/
@Transactional
@Override
public AjaxResult deleteGrade(List<Long> gradeIds) {
//想要删除的总数
int count = gradeIds.size();
//成功删除数量
int success = 0;
for (int i = 0; i < gradeIds.size(); i++) {
List<CGrade> cGrades = cGradeMapper.selectByGradeParentId(gradeIds.get(i));
if (cGrades.isEmpty()){
cGradeMapper.deleteById(gradeIds.get(i));
success++;
}
}
//失败数量
int fail = count-success;
return AjaxResult.success("总共删除:["+count+"],成功删除:["+success+"],失败:["+fail+"]"+"条件:年级下存在班级");
}
/**
* 删除学校班级(备选)
* @param gradeIds
* @return
*/
@Transactional
@Override
public AjaxResult deleteClasses(List<Long> gradeIds) {
//想要删除的总数
int count = gradeIds.size();
//成功删除数量
int success = 0;
for (int i = 0; i < gradeIds.size(); i++) {
List<CTeacher> cTeachers = cTeacherMapper.selectByGradeId(gradeIds.get(i));
List<CRelationshipStudentSgc> cStudent = cRelationshipStudentSgcMapper.selectByGradeId(gradeIds.get(i));
if (cTeachers.isEmpty() && cStudent.isEmpty()){
cGradeMapper.deleteById(gradeIds.get(i));
success++;
}
}
//失败数量
int fail = count-success;
return AjaxResult.success("总共删除:["+count+"],成功删除:["+success+"],失败:["+fail+"]"+"条件:班级下存在老师或老师");
}
}
... ...
... ... @@ -22,5 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT * FROM test_demo ${ew.customSqlSegment}
</select>
<select id="selectByGradeParentId" resultMap="CGradeResult">
SELECT * FROM c_grade WHERE parent_id =#{gtid}
</select>
</mapper>
... ...
... ... @@ -17,11 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="schoolType" column="school_type"/>
</resultMap>
<select id="selectByUserId" resultType="java.lang.Long">
<select id="selectByUserId" resultType="Long">
SELECT school_id FROM c_register_school WHERE user_id=#{uid}
</select>
</mapper>
... ...
... ... @@ -14,5 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="gardeType" column="garde_type"/>
</resultMap>
<select id="selectByGradeId" resultMap="CRelationshipStudentSgcResult">
SELECT * FROM c_relationship_student_sgc WHERE gerde_id=#{gid}
</select>
</mapper>
... ...
... ... @@ -15,5 +15,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT user_id FROM c_teacher WHERE grade_id =#{gid}
</select>
<select id="selectByGradeId" resultMap="CTeacherResult">
SELECT * FROM c_teacher WHERE grade_id=#{gid}
</select>
</mapper>
... ...
... ... @@ -104,7 +104,7 @@ public class MineController {
@ApiImplicitParam(name = "secretId",value = "可见/不可见",dataType = "Integer",required = true,paramType = "query")
@ApiOperation("修改基本信息的可见,不可见")
@PostMapping("/updateBasicInfoSecret")
@GetMapping("/updateBasicInfoSecret")
public AjaxResult updateBasicInfoSecret(Integer secretId){
log.info("<<<接收的参数<<<::"+secretId);
... ... @@ -163,7 +163,7 @@ public class MineController {
*/
@ApiOperation("简单个人信息")
@PostMapping("/getSomeInfo")
public AjaxResult getSomeInfo(Long userId){
public AjaxResult getSomeInfo(Long userId) {
return mineService.getSomeInfo(userId);
}
... ...
... ... @@ -44,6 +44,11 @@ public class CBasicInformationStudent implements Serializable {
private String nationality;
/**
* 户籍
*/
private String domicile;
/**
* 民族
*/
private String nation;
... ...
package com.example.client.domain.bo;
import cn.bronet.admin.common.annotation.Excel;
import cn.bronet.admin.common.core.domain.BaseEntity;
import cn.bronet.admin.common.core.validate.AddGroup;
import cn.bronet.admin.common.core.validate.EditGroup;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
... ... @@ -45,6 +47,13 @@ public class CBasicInformationStudentBo extends BaseEntity {
private String nationality;
/**
* 户籍
*/
@ApiModelProperty("户籍")
@NotBlank(message = "户籍不能为空", groups = { AddGroup.class, EditGroup.class })
private String domicile;
/**
* 民族
*/
@ApiModelProperty("民族")
... ...
package com.example.client.domain.vo;
import cn.bronet.admin.common.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
... ... @@ -25,6 +27,7 @@ public class CBasicInformationStudentVo {
* 编号
*/
@ApiModelProperty("编号")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
... ... @@ -32,6 +35,7 @@ public class CBasicInformationStudentVo {
*/
@Excel(name = "用户id")
@ApiModelProperty("用户id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
... ... @@ -42,6 +46,13 @@ public class CBasicInformationStudentVo {
private String nationality;
/**
* 户籍
*/
@Excel(name = "户籍")
@ApiModelProperty("户籍")
private String domicile;
/**
* 民族
*/
@Excel(name = "民族")
... ...
package com.example.client.domain.vo;
import cn.bronet.admin.common.annotation.Excel;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
... ... @@ -26,6 +28,7 @@ public class CPersonalInformationVo {
* 编号
*/
@ApiModelProperty("编号")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
/**
... ... @@ -33,6 +36,7 @@ public class CPersonalInformationVo {
*/
@Excel(name = "用户id")
@ApiModelProperty("用户id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
... ...
... ... @@ -2,6 +2,8 @@ package com.example.client.domain.vo;
import cn.bronet.admin.common.annotation.Excel;
import com.example.client.enumeration.Identity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
... ... @@ -23,6 +25,7 @@ public class CUserVo {
* 用户id
*/
@ApiModelProperty("用户id")
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
... ...
package com.example.client.domain.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.util.Date;
... ... @@ -10,9 +12,15 @@ public class MyInfoVo {
/**
* 用户Id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long userId;
/**
* 用户的名字
*/
private String UserName;
/**
* 用户性别 1-男 2-女
*/
private Integer sex;
... ...
... ... @@ -290,7 +290,9 @@ public class MineServiceImpl implements MineService {
.setEmail(bo.getEmail())
.setPhonenumber(bo.getPhonenumber())
.setUserId(bo.getUserId())
.setId(bo.getId());
.setId(bo.getId())
.setSex(bo.getSex())
.setBirthday(bo.getBirthday());
//判断 等于null 没有个人信息
if (bo.getId() == null) {
... ... @@ -613,7 +615,8 @@ public class MineServiceImpl implements MineService {
basicInfo = new CBasicInformationStudent();
BeanUtils.copyProperties(bo,basicInfo);
basicInfo.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now());
.setUpdateTime(LocalDateTime.now())
.setUserId(uId);
cBasicInformationStudentMapper.insert(basicInfo);
... ... @@ -805,14 +808,16 @@ public class MineServiceImpl implements MineService {
@Override
public AjaxResult getSomeInfo(Long userId) {
Long uId = UserContext.currentUserId();
MyInfoVo vo = new MyInfoVo();
CUser cUser = cUserMapper.selectById(userId);
CPersonalInformation personalInfo = cPersonalInformationMapper.getPersonalInfo(userId);
CUser cUser = cUserMapper.selectById(uId);
CPersonalInformation personalInfo = cPersonalInformationMapper.getPersonalInfo(uId);
if (cUser!=null){
vo.setUserId(cUser.getUserId());
vo.setHeadPhoto(cUser.getHeadPortrait());
vo.setUserName(cUser.getUserName());
}
if (personalInfo!=null){
... ...