正在显示
25 个修改的文件
包含
484 行增加
和
37 行删除
@@ -4,6 +4,7 @@ import java.util.List; | @@ -4,6 +4,7 @@ import java.util.List; | ||
4 | import java.util.Arrays; | 4 | import java.util.Arrays; |
5 | 5 | ||
6 | import io.swagger.annotations.ApiImplicitParam; | 6 | import io.swagger.annotations.ApiImplicitParam; |
7 | +import io.swagger.annotations.ApiModelProperty; | ||
7 | import lombok.RequiredArgsConstructor; | 8 | import lombok.RequiredArgsConstructor; |
8 | import javax.validation.constraints.*; | 9 | import javax.validation.constraints.*; |
9 | 10 | ||
@@ -69,9 +70,9 @@ public class CGradeController extends BaseController { | @@ -69,9 +70,9 @@ public class CGradeController extends BaseController { | ||
69 | } | 70 | } |
70 | 71 | ||
71 | /** | 72 | /** |
72 | - * 获取学校年级详细信息 | 73 | + * 获取需要修改的年级信息 |
73 | */ | 74 | */ |
74 | - @ApiOperation("获取学校年级详细信息") | 75 | + @ApiOperation("获取需要修改的年级信息") |
75 | @PreAuthorize("@ss.hasPermi('demo:grade:query')") | 76 | @PreAuthorize("@ss.hasPermi('demo:grade:query')") |
76 | @GetMapping("/{id}") | 77 | @GetMapping("/{id}") |
77 | public AjaxResult<CGradeVo> getInfo(@NotNull(message = "主键不能为空") | 78 | public AjaxResult<CGradeVo> getInfo(@NotNull(message = "主键不能为空") |
@@ -92,9 +93,9 @@ public class CGradeController extends BaseController { | @@ -92,9 +93,9 @@ public class CGradeController extends BaseController { | ||
92 | } | 93 | } |
93 | 94 | ||
94 | /** | 95 | /** |
95 | - * 修改学校年级 | 96 | + * 修改学校年级和班级 |
96 | */ | 97 | */ |
97 | - @ApiOperation("修改学校年级") | 98 | + @ApiOperation("修改学校年级和班级") |
98 | @PreAuthorize("@ss.hasPermi('demo:grade:edit')") | 99 | @PreAuthorize("@ss.hasPermi('demo:grade:edit')") |
99 | @Log(title = "学校年级", businessType = BusinessType.UPDATE) | 100 | @Log(title = "学校年级", businessType = BusinessType.UPDATE) |
100 | @RepeatSubmit | 101 | @RepeatSubmit |
@@ -104,26 +105,27 @@ public class CGradeController extends BaseController { | @@ -104,26 +105,27 @@ public class CGradeController extends BaseController { | ||
104 | } | 105 | } |
105 | 106 | ||
106 | /** | 107 | /** |
107 | - * 删除学校年级 | 108 | + * 删除学校班级 |
108 | */ | 109 | */ |
109 | - @ApiOperation("删除学校年级") | 110 | + @ApiOperation("删除学校班级") |
110 | @PreAuthorize("@ss.hasPermi('demo:grade:remove')") | 111 | @PreAuthorize("@ss.hasPermi('demo:grade:remove')") |
111 | - @Log(title = "学校年级" , businessType = BusinessType.DELETE) | 112 | + @Log(title = "学校班级" , businessType = BusinessType.DELETE) |
112 | @DeleteMapping("/{ids}") | 113 | @DeleteMapping("/{ids}") |
113 | public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空") | 114 | public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空") |
114 | @PathVariable Long[] ids) { | 115 | @PathVariable Long[] ids) { |
115 | return toAjax(iCGradeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); | 116 | return toAjax(iCGradeService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); |
116 | } | 117 | } |
117 | 118 | ||
119 | + | ||
118 | /** | 120 | /** |
119 | * 查询此学校下所有的年级 | 121 | * 查询此学校下所有的年级 |
120 | - */ | 122 | + *//* |
121 | @ApiOperation("查询此年级下的所有年级") | 123 | @ApiOperation("查询此年级下的所有年级") |
122 | @GetMapping("/getAllGrades") | 124 | @GetMapping("/getAllGrades") |
123 | public AjaxResult myAllGrades(@RequestBody CGradeBo bo){ | 125 | public AjaxResult myAllGrades(@RequestBody CGradeBo bo){ |
124 | 126 | ||
125 | return iCGradeService.getAllGrades(bo); | 127 | return iCGradeService.getAllGrades(bo); |
126 | - } | 128 | + }*/ |
127 | 129 | ||
128 | /** | 130 | /** |
129 | * 添加年级 | 131 | * 添加年级 |
@@ -161,7 +163,7 @@ public class CGradeController extends BaseController { | @@ -161,7 +163,7 @@ public class CGradeController extends BaseController { | ||
161 | 163 | ||
162 | /** | 164 | /** |
163 | * 查询此学校下所有班级 | 165 | * 查询此学校下所有班级 |
164 | - */ | 166 | + *//* |
165 | @ApiOperation("查询此学校下所有班级") | 167 | @ApiOperation("查询此学校下所有班级") |
166 | @PostMapping("/getAllClasses") | 168 | @PostMapping("/getAllClasses") |
167 | public AjaxResult myAllClasses(@RequestBody CGradeBo bo){ | 169 | public AjaxResult myAllClasses(@RequestBody CGradeBo bo){ |
@@ -169,7 +171,7 @@ public class CGradeController extends BaseController { | @@ -169,7 +171,7 @@ public class CGradeController extends BaseController { | ||
169 | log.info("<<<接收的参数<<<::"+bo); | 171 | log.info("<<<接收的参数<<<::"+bo); |
170 | 172 | ||
171 | return iCGradeService.getAllClasses(bo); | 173 | return iCGradeService.getAllClasses(bo); |
172 | - } | 174 | + }*/ |
173 | 175 | ||
174 | /** | 176 | /** |
175 | * 查询此学校下正常状态的班级 | 177 | * 查询此学校下正常状态的班级 |
@@ -181,4 +183,70 @@ public class CGradeController extends BaseController { | @@ -181,4 +183,70 @@ public class CGradeController extends BaseController { | ||
181 | 183 | ||
182 | return iCGradeService.getClasses(gradeParentId); | 184 | return iCGradeService.getClasses(gradeParentId); |
183 | } | 185 | } |
186 | + | ||
187 | + /** | ||
188 | + * 查看年级的详细信息 | ||
189 | + */ | ||
190 | + @ApiImplicitParam(name = "gradeId",value ="年级ID",dataType = "Long",required = true,paramType = "query") | ||
191 | + @ApiOperation("查看年级的详细信息") | ||
192 | + @PostMapping("/getGradeInfo") | ||
193 | + public AjaxResult myGradeInfo(Long gradeId){ | ||
194 | + | ||
195 | + log.info("<<<接收的参数<<<::"+gradeId); | ||
196 | + | ||
197 | + return iCGradeService.getGradeInfo(gradeId); | ||
198 | + } | ||
199 | + | ||
200 | + /** | ||
201 | + * 查看班级的详细信息 | ||
202 | + */ | ||
203 | + @ApiImplicitParam(name = "gradeId",value = "班级ID",dataType = "Long",required = true,paramType = "query") | ||
204 | + @ApiOperation("查看班级的详细信息") | ||
205 | + @PostMapping("/getClassInfo") | ||
206 | + public AjaxResult myClassInfo(Long gradeId){ | ||
207 | + | ||
208 | + log.info("<<<接收的参数<<<::"+gradeId); | ||
209 | + | ||
210 | + return iCGradeService.getClassInfo(gradeId); | ||
211 | + } | ||
212 | + | ||
213 | + /** | ||
214 | + * 获取需要修改的班级信息 | ||
215 | + */ | ||
216 | + @ApiImplicitParam(name = "gradeId",value = "班级ID",dataType = "Long",required = true,paramType = "query") | ||
217 | + @ApiOperation("获取需要修改的班级信息") | ||
218 | + @GetMapping("/getClassInfo") | ||
219 | + public AjaxResult myClassEdit(Long gradeId){ | ||
220 | + | ||
221 | + log.info("<<<接收的参数<<<::"+gradeId); | ||
222 | + | ||
223 | + return iCGradeService.getUpdateClassInfo(gradeId); | ||
224 | + } | ||
225 | + | ||
226 | + /** | ||
227 | + * 删除学校年级 | ||
228 | + */ | ||
229 | + @ApiOperation("删除学校年级") | ||
230 | + @DeleteMapping("/deleteGrade/{ids}") | ||
231 | + public AjaxResult myDeleteGrade(@NotEmpty(message = "主键不能为空") | ||
232 | + @PathVariable Long[] ids) { | ||
233 | + | ||
234 | + List<@NotEmpty(message = "主键不能为空") Long> gradeIds = Arrays.asList(ids); | ||
235 | + | ||
236 | + return iCGradeService.deleteGrade(gradeIds); | ||
237 | + } | ||
238 | + | ||
239 | + /** | ||
240 | + * 删除学校班级(备选) | ||
241 | + */ | ||
242 | + @ApiOperation("删除学校班级(备选)") | ||
243 | + @DeleteMapping("/deleteClasses/{ids}") | ||
244 | + public AjaxResult myDeleteClasses(@NotEmpty(message = "主键不能为空") | ||
245 | + @PathVariable Long[] ids) { | ||
246 | + | ||
247 | + List<@NotEmpty(message = "主键不能为空") Long> gradeIds = Arrays.asList(ids); | ||
248 | + | ||
249 | + return iCGradeService.deleteClasses(gradeIds); | ||
250 | + } | ||
251 | + | ||
184 | } | 252 | } |
1 | package cn.bronet.admin.demo.domain.bo; | 1 | package cn.bronet.admin.demo.domain.bo; |
2 | 2 | ||
3 | import cn.bronet.admin.common.core.domain.BaseEntity; | 3 | import cn.bronet.admin.common.core.domain.BaseEntity; |
4 | +import cn.bronet.admin.common.core.validate.AddGroup; | ||
5 | +import cn.bronet.admin.common.core.validate.EditGroup; | ||
4 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
6 | import lombok.Data; | 8 | import lombok.Data; |
7 | import lombok.EqualsAndHashCode; | 9 | import lombok.EqualsAndHashCode; |
8 | import javax.validation.constraints.*; | 10 | import javax.validation.constraints.*; |
11 | +import java.util.Date; | ||
9 | 12 | ||
10 | 13 | ||
11 | /** | 14 | /** |
@@ -42,6 +45,7 @@ public class CGradeBo extends BaseEntity { | @@ -42,6 +45,7 @@ public class CGradeBo extends BaseEntity { | ||
42 | * 学校班级类型 1-年级 2-班级 3-其他 | 45 | * 学校班级类型 1-年级 2-班级 3-其他 |
43 | */ | 46 | */ |
44 | @ApiModelProperty("学校班级类型 1-年级 2-班级 3-其他") | 47 | @ApiModelProperty("学校班级类型 1-年级 2-班级 3-其他") |
48 | + @NotNull(message = "学校班级类型不能为空", groups = { AddGroup.class, EditGroup.class }) | ||
45 | private Integer gradeType; | 49 | private Integer gradeType; |
46 | 50 | ||
47 | /** | 51 | /** |
@@ -152,5 +152,4 @@ public class CBasicInformationStudentVo { | @@ -152,5 +152,4 @@ public class CBasicInformationStudentVo { | ||
152 | @ApiModelProperty("可见(1 仅自己可见 2-品台可见 3全部可见)") | 152 | @ApiModelProperty("可见(1 仅自己可见 2-品台可见 3全部可见)") |
153 | private String secret; | 153 | private String secret; |
154 | 154 | ||
155 | - | ||
156 | } | 155 | } |
1 | package cn.bronet.admin.demo.domain.vo; | 1 | package cn.bronet.admin.demo.domain.vo; |
2 | 2 | ||
3 | import cn.bronet.admin.common.annotation.Excel; | 3 | import cn.bronet.admin.common.annotation.Excel; |
4 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
5 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
4 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
6 | import lombok.Data; | 8 | import lombok.Data; |
7 | 9 | ||
10 | +import java.time.LocalDateTime; | ||
11 | + | ||
8 | 12 | ||
9 | /** | 13 | /** |
10 | * 学校年级视图对象 c_grade | 14 | * 学校年级视图对象 c_grade |
@@ -22,6 +26,7 @@ public class CGradeVo { | @@ -22,6 +26,7 @@ public class CGradeVo { | ||
22 | * 编号 | 26 | * 编号 |
23 | */ | 27 | */ |
24 | @ApiModelProperty("编号") | 28 | @ApiModelProperty("编号") |
29 | + @JsonSerialize(using = ToStringSerializer.class) | ||
25 | private Long id; | 30 | private Long id; |
26 | 31 | ||
27 | /** | 32 | /** |
@@ -51,8 +56,19 @@ public class CGradeVo { | @@ -51,8 +56,19 @@ public class CGradeVo { | ||
51 | @Excel(name = "父类id") | 56 | @Excel(name = "父类id") |
52 | @ApiModelProperty("父类id") | 57 | @ApiModelProperty("父类id") |
53 | private Long parentId; | 58 | private Long parentId; |
54 | - | 59 | + /** |
60 | + * 状态 | ||
61 | + */ | ||
62 | + @Excel(name = "状态") | ||
63 | + @ApiModelProperty("状态 0-正常 1-不正常") | ||
55 | private Integer state; | 64 | private Integer state; |
56 | 65 | ||
66 | + /** | ||
67 | + * 创建时间 | ||
68 | + */ | ||
69 | + @Excel(name = "创建时间") | ||
70 | + @ApiModelProperty("创建时间") | ||
71 | + private LocalDateTime createTime; | ||
72 | + | ||
57 | 73 | ||
58 | } | 74 | } |
@@ -118,5 +118,12 @@ public class CPersonalInformationVo { | @@ -118,5 +118,12 @@ public class CPersonalInformationVo { | ||
118 | @ApiModelProperty("粉丝数") | 118 | @ApiModelProperty("粉丝数") |
119 | private Long beanVermicelli; | 119 | private Long beanVermicelli; |
120 | 120 | ||
121 | + /** | ||
122 | + * 头像照片 | ||
123 | + */ | ||
124 | + @Excel(name = "头像照片") | ||
125 | + @ApiModelProperty("头像照片") | ||
126 | + private String headPortrait; | ||
127 | + | ||
121 | 128 | ||
122 | } | 129 | } |
1 | +package cn.bronet.admin.demo.domain.vo; | ||
2 | + | ||
3 | +import cn.bronet.admin.common.annotation.Excel; | ||
4 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
5 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
6 | +import io.swagger.annotations.ApiModelProperty; | ||
7 | +import lombok.Data; | ||
8 | +import org.springframework.web.bind.annotation.PathVariable; | ||
9 | + | ||
10 | +import java.time.LocalDateTime; | ||
11 | + | ||
12 | +@Data | ||
13 | +public class ClassInfoVo { | ||
14 | + | ||
15 | + /** | ||
16 | + * 编号 | ||
17 | + */ | ||
18 | + @ApiModelProperty("编号") | ||
19 | + @JsonSerialize(using = ToStringSerializer.class) | ||
20 | + private Long id; | ||
21 | + | ||
22 | + /** | ||
23 | + * 类型名字 | ||
24 | + */ | ||
25 | + @Excel(name = "类型名字") | ||
26 | + @ApiModelProperty("类型名字") | ||
27 | + private String gradeName; | ||
28 | + | ||
29 | + /** | ||
30 | + * 学校id | ||
31 | + */ | ||
32 | + @Excel(name = "学校id") | ||
33 | + @ApiModelProperty("学校id") | ||
34 | + private Long schoolId; | ||
35 | + | ||
36 | + /** | ||
37 | + * 学校班级类型 1-年级 2-班级 3-其他 | ||
38 | + */ | ||
39 | + @Excel(name = "学校班级类型 1-年级 2-班级 3-其他") | ||
40 | + @ApiModelProperty("学校班级类型 1-年级 2-班级 3-其他") | ||
41 | + private Integer gradeType; | ||
42 | + | ||
43 | + /** | ||
44 | + * 父类id | ||
45 | + */ | ||
46 | + @Excel(name = "父类id") | ||
47 | + @ApiModelProperty("父类id") | ||
48 | + private Long parentId; | ||
49 | + /** | ||
50 | + * 状态 | ||
51 | + */ | ||
52 | + @Excel(name = "状态") | ||
53 | + @ApiModelProperty("状态 0-正常 1-不正常") | ||
54 | + private Integer state; | ||
55 | + | ||
56 | + /** | ||
57 | + * 创建时间 | ||
58 | + */ | ||
59 | + @Excel(name = "创建时间") | ||
60 | + @ApiModelProperty("创建时间") | ||
61 | + private LocalDateTime createTime; | ||
62 | + | ||
63 | + /** | ||
64 | + * 年级信息 | ||
65 | + */ | ||
66 | + private CGradeVo gradeVo; | ||
67 | +} |
1 | +package cn.bronet.admin.demo.domain.vo; | ||
2 | + | ||
3 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
4 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
5 | +import lombok.Data; | ||
6 | + | ||
7 | +import java.time.LocalDateTime; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +@Data | ||
11 | +public class GradeInfoVo { | ||
12 | + | ||
13 | + /** | ||
14 | + * 年级ID | ||
15 | + */ | ||
16 | + @JsonSerialize(using = ToStringSerializer.class) | ||
17 | + private Long id; | ||
18 | + | ||
19 | + /** | ||
20 | + * 年级名称 | ||
21 | + */ | ||
22 | + private String gradeName; | ||
23 | + | ||
24 | + /** | ||
25 | + * 创建时间 | ||
26 | + */ | ||
27 | + private LocalDateTime createTime; | ||
28 | + /** | ||
29 | + * 班级集合 | ||
30 | + */ | ||
31 | + private List<CGradeVo> classesList; | ||
32 | +} |
@@ -20,7 +20,9 @@ import java.util.List; | @@ -20,7 +20,9 @@ import java.util.List; | ||
20 | public interface CGradeMapper extends BaseMapperPlus<CGrade> { | 20 | public interface CGradeMapper extends BaseMapperPlus<CGrade> { |
21 | 21 | ||
22 | 22 | ||
23 | - List<CGrade> selectBySchoolId(@Param("sid") Long sid, @Param("gtid") Integer gtid); | 23 | + List<CGrade> selectBySchoolId(@Param("sid") Long sid, @Param("gtid") Long gtid); |
24 | 24 | ||
25 | Page<CGradeVo> customPageList(@Param("page") Page<CGrade> page, @Param("ew") Wrapper<CGrade> wrapper); | 25 | Page<CGradeVo> customPageList(@Param("page") Page<CGrade> page, @Param("ew") Wrapper<CGrade> wrapper); |
26 | + | ||
27 | + List<CGrade> selectByGradeParentId(Long gtid); | ||
26 | } | 28 | } |
@@ -2,6 +2,9 @@ package cn.bronet.admin.demo.mapper; | @@ -2,6 +2,9 @@ package cn.bronet.admin.demo.mapper; | ||
2 | 2 | ||
3 | import cn.bronet.admin.demo.domain.CRegisterSchool; | 3 | import cn.bronet.admin.demo.domain.CRegisterSchool; |
4 | import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; | 4 | import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; |
5 | +import cn.bronet.admin.demo.domain.CRelationshipStudentSgc; | ||
6 | + | ||
7 | +import java.util.List; | ||
5 | 8 | ||
6 | /** | 9 | /** |
7 | * 学校身份信息Mapper接口 | 10 | * 学校身份信息Mapper接口 |
@@ -13,4 +16,5 @@ public interface CRegisterSchoolMapper extends BaseMapperPlus<CRegisterSchool> { | @@ -13,4 +16,5 @@ public interface CRegisterSchoolMapper extends BaseMapperPlus<CRegisterSchool> { | ||
13 | 16 | ||
14 | Long selectByUserId(Long uid); | 17 | Long selectByUserId(Long uid); |
15 | 18 | ||
19 | + | ||
16 | } | 20 | } |
@@ -3,6 +3,8 @@ package cn.bronet.admin.demo.mapper; | @@ -3,6 +3,8 @@ package cn.bronet.admin.demo.mapper; | ||
3 | import cn.bronet.admin.demo.domain.CRelationshipStudentSgc; | 3 | import cn.bronet.admin.demo.domain.CRelationshipStudentSgc; |
4 | import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; | 4 | import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; |
5 | 5 | ||
6 | +import java.util.List; | ||
7 | + | ||
6 | /** | 8 | /** |
7 | * 学生学校绑定表Mapper接口 | 9 | * 学生学校绑定表Mapper接口 |
8 | * | 10 | * |
@@ -12,5 +14,5 @@ import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; | @@ -12,5 +14,5 @@ import cn.bronet.admin.common.core.mybatisplus.core.BaseMapperPlus; | ||
12 | public interface CRelationshipStudentSgcMapper extends BaseMapperPlus<CRelationshipStudentSgc> { | 14 | public interface CRelationshipStudentSgcMapper extends BaseMapperPlus<CRelationshipStudentSgc> { |
13 | 15 | ||
14 | 16 | ||
15 | - | 17 | + List<CRelationshipStudentSgc> selectByGradeId(Long gid); |
16 | } | 18 | } |
@@ -14,4 +14,6 @@ import java.util.List; | @@ -14,4 +14,6 @@ import java.util.List; | ||
14 | public interface CTeacherMapper extends BaseMapperPlus<CTeacher> { | 14 | public interface CTeacherMapper extends BaseMapperPlus<CTeacher> { |
15 | 15 | ||
16 | List<Long> getTeachers(Long gid); | 16 | List<Long> getTeachers(Long gid); |
17 | + | ||
18 | + List<CTeacher> selectByGradeId(Long gid); | ||
17 | } | 19 | } |
@@ -19,7 +19,7 @@ import java.util.List; | @@ -19,7 +19,7 @@ import java.util.List; | ||
19 | public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> { | 19 | public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> { |
20 | 20 | ||
21 | /** | 21 | /** |
22 | - * 查询单个 | 22 | + * 获取需要修改的学校年级或班级信息 |
23 | * @return | 23 | * @return |
24 | */ | 24 | */ |
25 | CGradeVo queryById(Long id); | 25 | CGradeVo queryById(Long id); |
@@ -97,4 +97,38 @@ public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> { | @@ -97,4 +97,38 @@ public interface ICGradeService extends IServicePlus<CGrade, CGradeVo> { | ||
97 | */ | 97 | */ |
98 | AjaxResult getClasses(Long gradeParentId); | 98 | AjaxResult getClasses(Long gradeParentId); |
99 | 99 | ||
100 | + /** | ||
101 | + * 查询年级的详细信息 | ||
102 | + * @param gradeId | ||
103 | + * @return | ||
104 | + */ | ||
105 | + AjaxResult getGradeInfo(Long gradeId); | ||
106 | + | ||
107 | + /** | ||
108 | + * 查询班级的详细信息 | ||
109 | + * @param gradeId | ||
110 | + * @return | ||
111 | + */ | ||
112 | + AjaxResult getClassInfo(Long gradeId); | ||
113 | + | ||
114 | + /** | ||
115 | + * 获取需要修改的班级信息 | ||
116 | + * @param gradeId | ||
117 | + * @return | ||
118 | + */ | ||
119 | + AjaxResult getUpdateClassInfo(Long gradeId); | ||
120 | + | ||
121 | + /** | ||
122 | + * 删除学校的年级 | ||
123 | + * @param gradeIds | ||
124 | + * @return | ||
125 | + */ | ||
126 | + AjaxResult deleteGrade(List<Long> gradeIds); | ||
127 | + | ||
128 | + /** | ||
129 | + *删除学校班级(备选) | ||
130 | + * @param gradeIds | ||
131 | + * @return | ||
132 | + */ | ||
133 | + AjaxResult deleteClasses(List<Long> gradeIds); | ||
100 | } | 134 | } |
1 | package cn.bronet.admin.demo.service.impl; | 1 | package cn.bronet.admin.demo.service.impl; |
2 | 2 | ||
3 | import cn.bronet.admin.common.core.domain.AjaxResult; | 3 | import cn.bronet.admin.common.core.domain.AjaxResult; |
4 | -import cn.bronet.admin.common.utils.ServletUtils; | 4 | +import cn.bronet.admin.demo.domain.CRelationshipStudentSgc; |
5 | +import cn.bronet.admin.demo.domain.CTeacher; | ||
5 | import cn.bronet.admin.demo.domain.CUser; | 6 | import cn.bronet.admin.demo.domain.CUser; |
6 | -import cn.bronet.admin.demo.domain.vo.TestDemoVo; | ||
7 | -import cn.bronet.admin.demo.mapper.CRegisterSchoolMapper; | ||
8 | -import cn.bronet.admin.demo.mapper.CUserMapper; | 7 | +import cn.bronet.admin.demo.domain.vo.ClassInfoVo; |
8 | +import cn.bronet.admin.demo.domain.vo.GradeInfoVo; | ||
9 | +import cn.bronet.admin.demo.mapper.*; | ||
9 | import cn.hutool.core.bean.BeanUtil; | 10 | import cn.hutool.core.bean.BeanUtil; |
10 | import cn.bronet.admin.common.utils.PageUtils; | 11 | import cn.bronet.admin.common.utils.PageUtils; |
11 | import cn.bronet.admin.common.core.page.PagePlus; | 12 | import cn.bronet.admin.common.core.page.PagePlus; |
12 | import cn.bronet.admin.common.core.page.TableDataInfo; | 13 | import cn.bronet.admin.common.core.page.TableDataInfo; |
13 | import cn.hutool.core.util.StrUtil; | 14 | import cn.hutool.core.util.StrUtil; |
14 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 15 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
15 | -import javassist.runtime.Desc; | ||
16 | import lombok.extern.slf4j.Slf4j; | 16 | import lombok.extern.slf4j.Slf4j; |
17 | import org.springframework.beans.BeanUtils; | 17 | import org.springframework.beans.BeanUtils; |
18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -23,8 +23,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | @@ -23,8 +23,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
23 | import cn.bronet.admin.demo.domain.bo.CGradeBo; | 23 | import cn.bronet.admin.demo.domain.bo.CGradeBo; |
24 | import cn.bronet.admin.demo.domain.vo.CGradeVo; | 24 | import cn.bronet.admin.demo.domain.vo.CGradeVo; |
25 | import cn.bronet.admin.demo.domain.CGrade; | 25 | import cn.bronet.admin.demo.domain.CGrade; |
26 | -import cn.bronet.admin.demo.mapper.CGradeMapper; | ||
27 | import cn.bronet.admin.demo.service.ICGradeService; | 26 | import cn.bronet.admin.demo.service.ICGradeService; |
27 | +import org.springframework.transaction.annotation.Transactional; | ||
28 | + | ||
28 | 29 | ||
29 | import java.time.LocalDateTime; | 30 | import java.time.LocalDateTime; |
30 | import java.util.ArrayList; | 31 | import java.util.ArrayList; |
@@ -51,6 +52,12 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -51,6 +52,12 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
51 | @Autowired | 52 | @Autowired |
52 | private CRegisterSchoolMapper cRegisterSchoolMapper; | 53 | private CRegisterSchoolMapper cRegisterSchoolMapper; |
53 | 54 | ||
55 | + @Autowired | ||
56 | + private CTeacherMapper cTeacherMapper; | ||
57 | + | ||
58 | + @Autowired | ||
59 | + private CRelationshipStudentSgcMapper cRelationshipStudentSgcMapper; | ||
60 | + | ||
54 | 61 | ||
55 | @Override | 62 | @Override |
56 | public CGradeVo queryById(Long id){ | 63 | public CGradeVo queryById(Long id){ |
@@ -60,9 +67,12 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -60,9 +67,12 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
60 | @Override | 67 | @Override |
61 | public TableDataInfo<CGradeVo> queryPageList(CGradeBo bo) { | 68 | public TableDataInfo<CGradeVo> queryPageList(CGradeBo bo) { |
62 | 69 | ||
70 | + // TODO: 2021/9/24 获取当前登录人Id | ||
71 | + Long uId=119911L; | ||
72 | + Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); | ||
73 | + bo.setSchoolId(schoolId); | ||
63 | 74 | ||
64 | - | ||
65 | - PagePlus<CGrade, CGradeVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); | 75 | + PagePlus<CGrade, CGradeVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); |
66 | return PageUtils.buildDataInfo(result); | 76 | return PageUtils.buildDataInfo(result); |
67 | } | 77 | } |
68 | 78 | ||
@@ -91,6 +101,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -91,6 +101,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
91 | 101 | ||
92 | @Override | 102 | @Override |
93 | public Boolean updateByBo(CGradeBo bo) { | 103 | public Boolean updateByBo(CGradeBo bo) { |
104 | + | ||
94 | CGrade update = BeanUtil.toBean(bo, CGrade.class); | 105 | CGrade update = BeanUtil.toBean(bo, CGrade.class); |
95 | validEntityBeforeSave(update); | 106 | validEntityBeforeSave(update); |
96 | return updateById(update); | 107 | return updateById(update); |
@@ -144,7 +155,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -144,7 +155,7 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
144 | public AjaxResult saveGrade(CGradeBo bo) { | 155 | public AjaxResult saveGrade(CGradeBo bo) { |
145 | 156 | ||
146 | //获取登录用户的Id | 157 | //获取登录用户的Id |
147 | - Long uId=111111L; | 158 | + Long uId=119911L; |
148 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); | 159 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); |
149 | 160 | ||
150 | //创建需要添加到数据库的参数 | 161 | //创建需要添加到数据库的参数 |
@@ -171,7 +182,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -171,7 +182,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
171 | 182 | ||
172 | //获取登录人的Id | 183 | //获取登录人的Id |
173 | Long uId =119911L; | 184 | Long uId =119911L; |
174 | - CUser cUser = cUserMapper.selectById(uId); | ||
175 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); | 185 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); |
176 | 186 | ||
177 | //创建数据库查询条件 | 187 | //创建数据库查询条件 |
@@ -214,7 +224,8 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -214,7 +224,8 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
214 | //创建存储信息 | 224 | //创建存储信息 |
215 | CGrade grade = new CGrade(); | 225 | CGrade grade = new CGrade(); |
216 | BeanUtils.copyProperties(bo,grade); | 226 | BeanUtils.copyProperties(bo,grade); |
217 | - grade.setSchoolId(schoolId); | 227 | + grade.setSchoolId(schoolId) |
228 | + .setCreateTime(LocalDateTime.now()); | ||
218 | 229 | ||
219 | cGradeMapper.insert(grade); | 230 | cGradeMapper.insert(grade); |
220 | 231 | ||
@@ -251,7 +262,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -251,7 +262,6 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
251 | 262 | ||
252 | //获取登录人用户 | 263 | //获取登录人用户 |
253 | Long uId=119911L; | 264 | Long uId=119911L; |
254 | - CUser cUser = cUserMapper.selectById(uId); | ||
255 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); | 265 | Long schoolId = cRegisterSchoolMapper.selectByUserId(uId); |
256 | 266 | ||
257 | LambdaQueryWrapper<CGrade> wrapper = new LambdaQueryWrapper<>(); | 267 | LambdaQueryWrapper<CGrade> wrapper = new LambdaQueryWrapper<>(); |
@@ -275,4 +285,146 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | @@ -275,4 +285,146 @@ public class CGradeServiceImpl extends ServicePlusImpl<CGradeMapper, CGrade, CGr | ||
275 | 285 | ||
276 | return AjaxResult.success(vos); | 286 | return AjaxResult.success(vos); |
277 | } | 287 | } |
288 | + | ||
289 | + /** | ||
290 | + * 查询年级的信息信息 | ||
291 | + * @param gradeId | ||
292 | + * @return | ||
293 | + */ | ||
294 | + @Override | ||
295 | + public AjaxResult getGradeInfo(Long gradeId) { | ||
296 | + | ||
297 | + | ||
298 | + GradeInfoVo vo = new GradeInfoVo(); | ||
299 | + CGrade grade = cGradeMapper.selectById(gradeId); | ||
300 | + List<CGrade> classes = cGradeMapper.selectByGradeParentId( grade.getId()); | ||
301 | + List<CGradeVo> classesList = new ArrayList<>(); | ||
302 | + | ||
303 | + //判断 classes不为null | ||
304 | + if (!classes.isEmpty()){ | ||
305 | + for (CGrade aClass : classes) { | ||
306 | + | ||
307 | + CGradeVo classVo = new CGradeVo(); | ||
308 | + BeanUtils.copyProperties(aClass,classVo); | ||
309 | + | ||
310 | + classesList.add(classVo); | ||
311 | + } | ||
312 | + | ||
313 | + vo.setClassesList(classesList); | ||
314 | + } | ||
315 | + //填数据到返回值中 | ||
316 | + vo.setGradeName(grade.getGradeName()); | ||
317 | + vo.setId(grade.getId()); | ||
318 | + vo.setCreateTime(grade.getCreateTime()); | ||
319 | + | ||
320 | + return AjaxResult.success(vo); | ||
321 | + } | ||
322 | + | ||
323 | + /** | ||
324 | + * 查询班级的详细系信息 | ||
325 | + * @param gradeId | ||
326 | + * @return | ||
327 | + */ | ||
328 | + @Override | ||
329 | + public AjaxResult getClassInfo(Long gradeId) { | ||
330 | + | ||
331 | + CGrade classVo = cGradeMapper.selectById(gradeId); | ||
332 | + | ||
333 | + CGradeVo vo = new CGradeVo(); | ||
334 | + BeanUtils.copyProperties(classVo,vo); | ||
335 | + | ||
336 | + return AjaxResult.success(vo); | ||
337 | + } | ||
338 | + | ||
339 | + /** | ||
340 | + * 获取需要修改的班级Id | ||
341 | + * @param gradeId | ||
342 | + * @return | ||
343 | + */ | ||
344 | + @Override | ||
345 | + public AjaxResult getUpdateClassInfo(Long gradeId) { | ||
346 | + | ||
347 | + ClassInfoVo vo = new ClassInfoVo(); | ||
348 | + CGrade cClass = cGradeMapper.selectById(gradeId); | ||
349 | + CGrade cGrade = cGradeMapper.selectById(cClass.getParentId()); | ||
350 | + | ||
351 | + if (cClass != null){ | ||
352 | + BeanUtils.copyProperties(cClass,vo); | ||
353 | + } | ||
354 | + | ||
355 | + if (cGrade != null){ | ||
356 | + CGradeVo cGradeVo = new CGradeVo(); | ||
357 | + BeanUtils.copyProperties(cGrade,cGradeVo); | ||
358 | + vo.setGradeVo(cGradeVo); | ||
359 | + } | ||
360 | + | ||
361 | + return AjaxResult.success(vo); | ||
362 | + } | ||
363 | + | ||
364 | + /** | ||
365 | + * 删除学校年级 | ||
366 | + * @param gradeIds | ||
367 | + * @return | ||
368 | + */ | ||
369 | + @Transactional | ||
370 | + @Override | ||
371 | + public AjaxResult deleteGrade(List<Long> gradeIds) { | ||
372 | + | ||
373 | + //想要删除的总数 | ||
374 | + int count = gradeIds.size(); | ||
375 | + | ||
376 | + //成功删除数量 | ||
377 | + int success = 0; | ||
378 | + | ||
379 | + for (int i = 0; i < gradeIds.size(); i++) { | ||
380 | + | ||
381 | + List<CGrade> cGrades = cGradeMapper.selectByGradeParentId(gradeIds.get(i)); | ||
382 | + | ||
383 | + if (cGrades.isEmpty()){ | ||
384 | + | ||
385 | + cGradeMapper.deleteById(gradeIds.get(i)); | ||
386 | + success++; | ||
387 | + } | ||
388 | + } | ||
389 | + | ||
390 | + //失败数量 | ||
391 | + int fail = count-success; | ||
392 | + | ||
393 | + return AjaxResult.success("总共删除:["+count+"],成功删除:["+success+"],失败:["+fail+"]"+"条件:年级下存在班级"); | ||
394 | + } | ||
395 | + | ||
396 | + /** | ||
397 | + * 删除学校班级(备选) | ||
398 | + * @param gradeIds | ||
399 | + * @return | ||
400 | + */ | ||
401 | + @Transactional | ||
402 | + @Override | ||
403 | + public AjaxResult deleteClasses(List<Long> gradeIds) { | ||
404 | + | ||
405 | + //想要删除的总数 | ||
406 | + int count = gradeIds.size(); | ||
407 | + | ||
408 | + //成功删除数量 | ||
409 | + int success = 0; | ||
410 | + | ||
411 | + for (int i = 0; i < gradeIds.size(); i++) { | ||
412 | + | ||
413 | + List<CTeacher> cTeachers = cTeacherMapper.selectByGradeId(gradeIds.get(i)); | ||
414 | + List<CRelationshipStudentSgc> cStudent = cRelationshipStudentSgcMapper.selectByGradeId(gradeIds.get(i)); | ||
415 | + | ||
416 | + | ||
417 | + if (cTeachers.isEmpty() && cStudent.isEmpty()){ | ||
418 | + | ||
419 | + cGradeMapper.deleteById(gradeIds.get(i)); | ||
420 | + success++; | ||
421 | + } | ||
422 | + } | ||
423 | + | ||
424 | + //失败数量 | ||
425 | + int fail = count-success; | ||
426 | + | ||
427 | + return AjaxResult.success("总共删除:["+count+"],成功删除:["+success+"],失败:["+fail+"]"+"条件:班级下存在老师或老师"); | ||
428 | + | ||
429 | + } | ||
278 | } | 430 | } |
@@ -22,5 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -22,5 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
22 | SELECT * FROM test_demo ${ew.customSqlSegment} | 22 | SELECT * FROM test_demo ${ew.customSqlSegment} |
23 | </select> | 23 | </select> |
24 | 24 | ||
25 | + <select id="selectByGradeParentId" resultMap="CGradeResult"> | ||
26 | + SELECT * FROM c_grade WHERE parent_id =#{gtid} | ||
27 | + </select> | ||
28 | + | ||
25 | 29 | ||
26 | </mapper> | 30 | </mapper> |
@@ -17,11 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -17,11 +17,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
17 | <result property="schoolType" column="school_type"/> | 17 | <result property="schoolType" column="school_type"/> |
18 | </resultMap> | 18 | </resultMap> |
19 | 19 | ||
20 | - <select id="selectByUserId" resultType="java.lang.Long"> | 20 | + <select id="selectByUserId" resultType="Long"> |
21 | 21 | ||
22 | SELECT school_id FROM c_register_school WHERE user_id=#{uid} | 22 | SELECT school_id FROM c_register_school WHERE user_id=#{uid} |
23 | 23 | ||
24 | </select> | 24 | </select> |
25 | 25 | ||
26 | 26 | ||
27 | + | ||
28 | + | ||
27 | </mapper> | 29 | </mapper> |
@@ -14,5 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -14,5 +14,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
14 | <result property="gardeType" column="garde_type"/> | 14 | <result property="gardeType" column="garde_type"/> |
15 | </resultMap> | 15 | </resultMap> |
16 | 16 | ||
17 | + <select id="selectByGradeId" resultMap="CRelationshipStudentSgcResult"> | ||
18 | + SELECT * FROM c_relationship_student_sgc WHERE gerde_id=#{gid} | ||
19 | + </select> | ||
17 | 20 | ||
18 | -</mapper> | ||
21 | +</mapper> |
@@ -15,5 +15,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -15,5 +15,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
15 | SELECT user_id FROM c_teacher WHERE grade_id =#{gid} | 15 | SELECT user_id FROM c_teacher WHERE grade_id =#{gid} |
16 | </select> | 16 | </select> |
17 | 17 | ||
18 | + <select id="selectByGradeId" resultMap="CTeacherResult"> | ||
19 | + SELECT * FROM c_teacher WHERE grade_id=#{gid} | ||
20 | + </select> | ||
21 | + | ||
18 | 22 | ||
19 | </mapper> | 23 | </mapper> |
@@ -104,7 +104,7 @@ public class MineController { | @@ -104,7 +104,7 @@ public class MineController { | ||
104 | 104 | ||
105 | @ApiImplicitParam(name = "secretId",value = "可见/不可见",dataType = "Integer",required = true,paramType = "query") | 105 | @ApiImplicitParam(name = "secretId",value = "可见/不可见",dataType = "Integer",required = true,paramType = "query") |
106 | @ApiOperation("修改基本信息的可见,不可见") | 106 | @ApiOperation("修改基本信息的可见,不可见") |
107 | - @PostMapping("/updateBasicInfoSecret") | 107 | + @GetMapping("/updateBasicInfoSecret") |
108 | public AjaxResult updateBasicInfoSecret(Integer secretId){ | 108 | public AjaxResult updateBasicInfoSecret(Integer secretId){ |
109 | 109 | ||
110 | log.info("<<<接收的参数<<<::"+secretId); | 110 | log.info("<<<接收的参数<<<::"+secretId); |
@@ -163,7 +163,7 @@ public class MineController { | @@ -163,7 +163,7 @@ public class MineController { | ||
163 | */ | 163 | */ |
164 | @ApiOperation("简单个人信息") | 164 | @ApiOperation("简单个人信息") |
165 | @PostMapping("/getSomeInfo") | 165 | @PostMapping("/getSomeInfo") |
166 | - public AjaxResult getSomeInfo(Long userId){ | 166 | + public AjaxResult getSomeInfo(Long userId) { |
167 | 167 | ||
168 | return mineService.getSomeInfo(userId); | 168 | return mineService.getSomeInfo(userId); |
169 | } | 169 | } |
@@ -43,7 +43,12 @@ public class CBasicInformationStudent implements Serializable { | @@ -43,7 +43,12 @@ public class CBasicInformationStudent implements Serializable { | ||
43 | */ | 43 | */ |
44 | private String nationality; | 44 | private String nationality; |
45 | 45 | ||
46 | - /** | 46 | + /** |
47 | + * 户籍 | ||
48 | + */ | ||
49 | + private String domicile; | ||
50 | + | ||
51 | + /** | ||
47 | * 民族 | 52 | * 民族 |
48 | */ | 53 | */ |
49 | private String nation; | 54 | private String nation; |
1 | package com.example.client.domain.bo; | 1 | package com.example.client.domain.bo; |
2 | 2 | ||
3 | +import cn.bronet.admin.common.annotation.Excel; | ||
3 | import cn.bronet.admin.common.core.domain.BaseEntity; | 4 | import cn.bronet.admin.common.core.domain.BaseEntity; |
4 | import cn.bronet.admin.common.core.validate.AddGroup; | 5 | import cn.bronet.admin.common.core.validate.AddGroup; |
5 | import cn.bronet.admin.common.core.validate.EditGroup; | 6 | import cn.bronet.admin.common.core.validate.EditGroup; |
7 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
6 | import io.swagger.annotations.ApiModel; | 8 | import io.swagger.annotations.ApiModel; |
7 | import io.swagger.annotations.ApiModelProperty; | 9 | import io.swagger.annotations.ApiModelProperty; |
8 | import lombok.Data; | 10 | import lombok.Data; |
@@ -44,6 +46,13 @@ public class CBasicInformationStudentBo extends BaseEntity { | @@ -44,6 +46,13 @@ public class CBasicInformationStudentBo extends BaseEntity { | ||
44 | @NotBlank(message = "国籍不能为空", groups = { AddGroup.class, EditGroup.class }) | 46 | @NotBlank(message = "国籍不能为空", groups = { AddGroup.class, EditGroup.class }) |
45 | private String nationality; | 47 | private String nationality; |
46 | 48 | ||
49 | + /** | ||
50 | + * 户籍 | ||
51 | + */ | ||
52 | + @ApiModelProperty("户籍") | ||
53 | + @NotBlank(message = "户籍不能为空", groups = { AddGroup.class, EditGroup.class }) | ||
54 | + private String domicile; | ||
55 | + | ||
47 | /** | 56 | /** |
48 | * 民族 | 57 | * 民族 |
49 | */ | 58 | */ |
1 | package com.example.client.domain.vo; | 1 | package com.example.client.domain.vo; |
2 | 2 | ||
3 | import cn.bronet.admin.common.annotation.Excel; | 3 | import cn.bronet.admin.common.annotation.Excel; |
4 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
5 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
4 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
6 | import io.swagger.models.auth.In; | 8 | import io.swagger.models.auth.In; |
@@ -25,6 +27,7 @@ public class CBasicInformationStudentVo { | @@ -25,6 +27,7 @@ public class CBasicInformationStudentVo { | ||
25 | * 编号 | 27 | * 编号 |
26 | */ | 28 | */ |
27 | @ApiModelProperty("编号") | 29 | @ApiModelProperty("编号") |
30 | + @JsonSerialize(using = ToStringSerializer.class) | ||
28 | private Long id; | 31 | private Long id; |
29 | 32 | ||
30 | /** | 33 | /** |
@@ -32,6 +35,7 @@ public class CBasicInformationStudentVo { | @@ -32,6 +35,7 @@ public class CBasicInformationStudentVo { | ||
32 | */ | 35 | */ |
33 | @Excel(name = "用户id") | 36 | @Excel(name = "用户id") |
34 | @ApiModelProperty("用户id") | 37 | @ApiModelProperty("用户id") |
38 | + @JsonSerialize(using = ToStringSerializer.class) | ||
35 | private Long userId; | 39 | private Long userId; |
36 | 40 | ||
37 | /** | 41 | /** |
@@ -41,6 +45,13 @@ public class CBasicInformationStudentVo { | @@ -41,6 +45,13 @@ public class CBasicInformationStudentVo { | ||
41 | @ApiModelProperty("国籍") | 45 | @ApiModelProperty("国籍") |
42 | private String nationality; | 46 | private String nationality; |
43 | 47 | ||
48 | + /** | ||
49 | + * 户籍 | ||
50 | + */ | ||
51 | + @Excel(name = "户籍") | ||
52 | + @ApiModelProperty("户籍") | ||
53 | + private String domicile; | ||
54 | + | ||
44 | /** | 55 | /** |
45 | * 民族 | 56 | * 民族 |
46 | */ | 57 | */ |
1 | package com.example.client.domain.vo; | 1 | package com.example.client.domain.vo; |
2 | 2 | ||
3 | import cn.bronet.admin.common.annotation.Excel; | 3 | import cn.bronet.admin.common.annotation.Excel; |
4 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
5 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
4 | import io.swagger.annotations.ApiModel; | 6 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 7 | import io.swagger.annotations.ApiModelProperty; |
6 | import lombok.Data; | 8 | import lombok.Data; |
@@ -26,6 +28,7 @@ public class CPersonalInformationVo { | @@ -26,6 +28,7 @@ public class CPersonalInformationVo { | ||
26 | * 编号 | 28 | * 编号 |
27 | */ | 29 | */ |
28 | @ApiModelProperty("编号") | 30 | @ApiModelProperty("编号") |
31 | + @JsonSerialize(using = ToStringSerializer.class) | ||
29 | private Long id; | 32 | private Long id; |
30 | 33 | ||
31 | /** | 34 | /** |
@@ -33,6 +36,7 @@ public class CPersonalInformationVo { | @@ -33,6 +36,7 @@ public class CPersonalInformationVo { | ||
33 | */ | 36 | */ |
34 | @Excel(name = "用户id") | 37 | @Excel(name = "用户id") |
35 | @ApiModelProperty("用户id") | 38 | @ApiModelProperty("用户id") |
39 | + @JsonSerialize(using = ToStringSerializer.class) | ||
36 | private Long userId; | 40 | private Long userId; |
37 | 41 | ||
38 | /** | 42 | /** |
@@ -2,6 +2,8 @@ package com.example.client.domain.vo; | @@ -2,6 +2,8 @@ package com.example.client.domain.vo; | ||
2 | 2 | ||
3 | import cn.bronet.admin.common.annotation.Excel; | 3 | import cn.bronet.admin.common.annotation.Excel; |
4 | import com.example.client.enumeration.Identity; | 4 | import com.example.client.enumeration.Identity; |
5 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
6 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
5 | import io.swagger.annotations.ApiModel; | 7 | import io.swagger.annotations.ApiModel; |
6 | import io.swagger.annotations.ApiModelProperty; | 8 | import io.swagger.annotations.ApiModelProperty; |
7 | import lombok.Data; | 9 | import lombok.Data; |
@@ -23,6 +25,7 @@ public class CUserVo { | @@ -23,6 +25,7 @@ public class CUserVo { | ||
23 | * 用户id | 25 | * 用户id |
24 | */ | 26 | */ |
25 | @ApiModelProperty("用户id") | 27 | @ApiModelProperty("用户id") |
28 | + @JsonSerialize(using = ToStringSerializer.class) | ||
26 | private Long userId; | 29 | private Long userId; |
27 | 30 | ||
28 | /** | 31 | /** |
1 | package com.example.client.domain.vo; | 1 | package com.example.client.domain.vo; |
2 | 2 | ||
3 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
4 | +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; | ||
3 | import lombok.Data; | 5 | import lombok.Data; |
4 | 6 | ||
5 | import java.util.Date; | 7 | import java.util.Date; |
@@ -10,9 +12,15 @@ public class MyInfoVo { | @@ -10,9 +12,15 @@ public class MyInfoVo { | ||
10 | /** | 12 | /** |
11 | * 用户Id | 13 | * 用户Id |
12 | */ | 14 | */ |
15 | + @JsonSerialize(using = ToStringSerializer.class) | ||
13 | private Long userId; | 16 | private Long userId; |
14 | 17 | ||
15 | /** | 18 | /** |
19 | + * 用户的名字 | ||
20 | + */ | ||
21 | + private String UserName; | ||
22 | + | ||
23 | + /** | ||
16 | * 用户性别 1-男 2-女 | 24 | * 用户性别 1-男 2-女 |
17 | */ | 25 | */ |
18 | private Integer sex; | 26 | private Integer sex; |
@@ -290,7 +290,9 @@ public class MineServiceImpl implements MineService { | @@ -290,7 +290,9 @@ public class MineServiceImpl implements MineService { | ||
290 | .setEmail(bo.getEmail()) | 290 | .setEmail(bo.getEmail()) |
291 | .setPhonenumber(bo.getPhonenumber()) | 291 | .setPhonenumber(bo.getPhonenumber()) |
292 | .setUserId(bo.getUserId()) | 292 | .setUserId(bo.getUserId()) |
293 | - .setId(bo.getId()); | 293 | + .setId(bo.getId()) |
294 | + .setSex(bo.getSex()) | ||
295 | + .setBirthday(bo.getBirthday()); | ||
294 | 296 | ||
295 | //判断 等于null 没有个人信息 | 297 | //判断 等于null 没有个人信息 |
296 | if (bo.getId() == null) { | 298 | if (bo.getId() == null) { |
@@ -613,7 +615,8 @@ public class MineServiceImpl implements MineService { | @@ -613,7 +615,8 @@ public class MineServiceImpl implements MineService { | ||
613 | basicInfo = new CBasicInformationStudent(); | 615 | basicInfo = new CBasicInformationStudent(); |
614 | BeanUtils.copyProperties(bo,basicInfo); | 616 | BeanUtils.copyProperties(bo,basicInfo); |
615 | basicInfo.setCreateTime(LocalDateTime.now()) | 617 | basicInfo.setCreateTime(LocalDateTime.now()) |
616 | - .setUpdateTime(LocalDateTime.now()); | 618 | + .setUpdateTime(LocalDateTime.now()) |
619 | + .setUserId(uId); | ||
617 | 620 | ||
618 | cBasicInformationStudentMapper.insert(basicInfo); | 621 | cBasicInformationStudentMapper.insert(basicInfo); |
619 | 622 | ||
@@ -805,14 +808,16 @@ public class MineServiceImpl implements MineService { | @@ -805,14 +808,16 @@ public class MineServiceImpl implements MineService { | ||
805 | @Override | 808 | @Override |
806 | public AjaxResult getSomeInfo(Long userId) { | 809 | public AjaxResult getSomeInfo(Long userId) { |
807 | 810 | ||
811 | + Long uId = UserContext.currentUserId(); | ||
808 | MyInfoVo vo = new MyInfoVo(); | 812 | MyInfoVo vo = new MyInfoVo(); |
809 | - CUser cUser = cUserMapper.selectById(userId); | ||
810 | - CPersonalInformation personalInfo = cPersonalInformationMapper.getPersonalInfo(userId); | 813 | + CUser cUser = cUserMapper.selectById(uId); |
814 | + CPersonalInformation personalInfo = cPersonalInformationMapper.getPersonalInfo(uId); | ||
811 | 815 | ||
812 | if (cUser!=null){ | 816 | if (cUser!=null){ |
813 | 817 | ||
814 | vo.setUserId(cUser.getUserId()); | 818 | vo.setUserId(cUser.getUserId()); |
815 | vo.setHeadPhoto(cUser.getHeadPortrait()); | 819 | vo.setHeadPhoto(cUser.getHeadPortrait()); |
820 | + vo.setUserName(cUser.getUserName()); | ||
816 | } | 821 | } |
817 | 822 | ||
818 | if (personalInfo!=null){ | 823 | if (personalInfo!=null){ |
-
请 注册 或 登录 后发表评论