提交
This commit is contained in:
1 parent
3b3d2bb157
commit
94f07a059b
69 files changed
+2787
-643
No files matched your search
+113
@@ -0,0 +1,113 @@
|
||||
package org.dromara.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.system.domain.vo.SysRegionVo;
|
||||
import org.dromara.system.domain.bo.SysRegionBo;
|
||||
import org.dromara.system.service.ISysRegionService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 行政区划
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/SysRegion")
|
||||
public class SysRegionController extends BaseController {
|
||||
|
||||
private final ISysRegionService sysRegionService;
|
||||
|
||||
/**
|
||||
* 查询行政区划列表
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysRegionVo> list(SysRegionBo bo, PageQuery pageQuery) {
|
||||
return sysRegionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出行政区划列表
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:export")
|
||||
@Log(title = "行政区划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysRegionBo bo, HttpServletResponse response) {
|
||||
List<SysRegionVo> list = sysRegionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "行政区划", SysRegionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行政区划详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<SysRegionVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(sysRegionService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增行政区划
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:add")
|
||||
@Log(title = "行政区划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysRegionBo bo) {
|
||||
return toAjax(sysRegionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改行政区划
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:edit")
|
||||
@Log(title = "行政区划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysRegionBo bo) {
|
||||
return toAjax(sysRegionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除行政区划
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("system:SysRegion:remove")
|
||||
@Log(title = "行政区划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(sysRegionService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取省市区树形数据
|
||||
*/
|
||||
// @SaCheckPermission("system:SysRegion:list")
|
||||
@GetMapping("/tree")
|
||||
public R<List<SysRegionVo>> getRegionTree() {
|
||||
List<SysRegionVo> tree = sysRegionService.getRegionTree();
|
||||
return R.ok(tree);
|
||||
}
|
||||
}
|
||||
+8
-4
@@ -95,7 +95,8 @@ public class SysProfileController extends BaseController {
|
||||
if (BCrypt.checkpw(bo.getNewPassword(), password)) {
|
||||
return R.fail("新密码不能与旧密码相同");
|
||||
}
|
||||
int rows = DataPermissionHelper.ignore(() -> userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword())));
|
||||
int rows = DataPermissionHelper
|
||||
.ignore(() -> userService.resetUserPwd(user.getUserId(), BCrypt.hashpw(bo.getNewPassword())));
|
||||
if (rows > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
@@ -118,7 +119,8 @@ public class SysProfileController extends BaseController {
|
||||
}
|
||||
SysOssVo oss = ossService.upload(avatarfile);
|
||||
String avatar = oss.getUrl();
|
||||
boolean updateSuccess = DataPermissionHelper.ignore(() -> userService.updateUserAvatar(LoginHelper.getUserId(), oss.getOssId()));
|
||||
boolean updateSuccess = DataPermissionHelper
|
||||
.ignore(() -> userService.updateUserAvatar(LoginHelper.getUserId(), oss.getOssId()));
|
||||
if (updateSuccess) {
|
||||
return R.ok(new AvatarVo(avatar));
|
||||
}
|
||||
@@ -126,8 +128,10 @@ public class SysProfileController extends BaseController {
|
||||
return R.fail("上传图片异常,请联系管理员");
|
||||
}
|
||||
|
||||
public record AvatarVo(String imgUrl) {}
|
||||
public record AvatarVo(String imgUrl) {
|
||||
}
|
||||
|
||||
public record ProfileVo(SysUserVo user, String roleGroup, String postGroup) {}
|
||||
public record ProfileVo(SysUserVo user, String roleGroup, String postGroup) {
|
||||
}
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package org.dromara.system.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 行政区划对象 sys_region
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_region")
|
||||
public class SysRegion extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
private Long parentCode;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
private Long level;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
|
||||
}
|
||||
+6
-6
@@ -70,11 +70,7 @@ public class SysUser extends TenantEntity {
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@TableField(
|
||||
insertStrategy = FieldStrategy.NOT_EMPTY,
|
||||
updateStrategy = FieldStrategy.NOT_EMPTY,
|
||||
whereStrategy = FieldStrategy.NOT_EMPTY
|
||||
)
|
||||
@TableField(insertStrategy = FieldStrategy.NOT_EMPTY, updateStrategy = FieldStrategy.NOT_EMPTY, whereStrategy = FieldStrategy.NOT_EMPTY)
|
||||
private String password;
|
||||
|
||||
/**
|
||||
@@ -103,7 +99,6 @@ public class SysUser extends TenantEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
public SysUser(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
@@ -112,4 +107,9 @@ public class SysUser extends TenantEntity {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
*/
|
||||
private String accountType;
|
||||
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package org.dromara.system.domain.bo;
|
||||
|
||||
import org.dromara.system.domain.SysRegion;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 行政区划业务对象 sys_region
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = SysRegion.class, reverseConvertGenerate = false)
|
||||
public class SysRegionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
@NotBlank(message = "行政区划编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@NotBlank(message = "行政区划名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
private Long parentCode;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
@NotNull(message = "层级(1:省,2:市,3:区/县,4:街道/镇)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long level;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
|
||||
}
|
||||
+9
@@ -121,4 +121,13 @@ public class SysUserBo extends BaseEntity {
|
||||
return SystemConstants.SUPER_ADMIN_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
*/
|
||||
private String accountType;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package org.dromara.system.domain.vo;
|
||||
|
||||
import org.dromara.system.domain.SysRegion;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政区划视图对象 sys_region
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = SysRegion.class)
|
||||
public class SysRegionVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
@ExcelProperty(value = "行政区划编码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
@ExcelProperty(value = "行政区划名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
@ExcelProperty(value = "行政区划简称")
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
@ExcelProperty(value = "父级行政区划编码,顶级为0")
|
||||
private Long parentCode;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
@ExcelProperty(value = "层级", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "1=:省,2:市,3:区/县,4:街道/镇")
|
||||
private Long level;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ExcelProperty(value = "排序")
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@ExcelProperty(value = "经度")
|
||||
private Long longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@ExcelProperty(value = "纬度")
|
||||
private Long latitude;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
@ExcelProperty(value = "逻辑删除标识", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=未删除,1=已删除")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 子级行政区划列表(用于树形结构)
|
||||
*/
|
||||
private List<SysRegionVo> children;
|
||||
|
||||
}
|
||||
+4
-1
@@ -15,7 +15,6 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户信息视图对象 sys_user
|
||||
*
|
||||
@@ -139,4 +138,8 @@ public class SysUserVo implements Serializable {
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 账号类型 1 - 老师 2- 学生
|
||||
*/
|
||||
private String accountType;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.system.mapper;
|
||||
|
||||
import org.dromara.system.domain.SysRegion;
|
||||
import org.dromara.system.domain.vo.SysRegionVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 行政区划Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
public interface SysRegionMapper extends BaseMapperPlus<SysRegion, SysRegionVo> {
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package org.dromara.system.service;
|
||||
|
||||
import org.dromara.system.domain.vo.SysRegionVo;
|
||||
import org.dromara.system.domain.bo.SysRegionBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 行政区划Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
public interface ISysRegionService {
|
||||
|
||||
/**
|
||||
* 查询行政区划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 行政区划
|
||||
*/
|
||||
SysRegionVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询行政区划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 行政区划分页列表
|
||||
*/
|
||||
TableDataInfo<SysRegionVo> queryPageList(SysRegionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的行政区划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 行政区划列表
|
||||
*/
|
||||
List<SysRegionVo> queryList(SysRegionBo bo);
|
||||
|
||||
/**
|
||||
* 新增行政区划
|
||||
*
|
||||
* @param bo 行政区划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(SysRegionBo bo);
|
||||
|
||||
/**
|
||||
* 修改行政区划
|
||||
*
|
||||
* @param bo 行政区划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(SysRegionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除行政区划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取省市区树形数据
|
||||
*
|
||||
* @return 省市区树形数据列表
|
||||
*/
|
||||
List<SysRegionVo> getRegionTree();
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
package org.dromara.system.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.system.domain.bo.SysRegionBo;
|
||||
import org.dromara.system.domain.vo.SysRegionVo;
|
||||
import org.dromara.system.domain.SysRegion;
|
||||
import org.dromara.system.mapper.SysRegionMapper;
|
||||
import org.dromara.system.service.ISysRegionService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 行政区划Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-26
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysRegionServiceImpl implements ISysRegionService {
|
||||
|
||||
private final SysRegionMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询行政区划
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 行政区划
|
||||
*/
|
||||
@Override
|
||||
public SysRegionVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询行政区划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 行政区划分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysRegionVo> queryPageList(SysRegionBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysRegion> lqw = buildQueryWrapper(bo);
|
||||
Page<SysRegionVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的行政区划列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 行政区划列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysRegionVo> queryList(SysRegionBo bo) {
|
||||
LambdaQueryWrapper<SysRegion> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysRegion> buildQueryWrapper(SysRegionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysRegion> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(SysRegion::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCode()), SysRegion::getCode, bo.getCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), SysRegion::getName, bo.getName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getShortName()), SysRegion::getShortName, bo.getShortName());
|
||||
lqw.eq(bo.getParentCode() != null, SysRegion::getParentCode, bo.getParentCode());
|
||||
lqw.eq(bo.getLevel() != null, SysRegion::getLevel, bo.getLevel());
|
||||
lqw.eq(bo.getSort() != null, SysRegion::getSort, bo.getSort());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysRegion::getStatus, bo.getStatus());
|
||||
lqw.eq(bo.getLongitude() != null, SysRegion::getLongitude, bo.getLongitude());
|
||||
lqw.eq(bo.getLatitude() != null, SysRegion::getLatitude, bo.getLatitude());
|
||||
lqw.eq(bo.getDeleted() != null, SysRegion::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增行政区划
|
||||
*
|
||||
* @param bo 行政区划
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SysRegionBo bo) {
|
||||
SysRegion add = MapstructUtils.convert(bo, SysRegion.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改行政区划
|
||||
*
|
||||
* @param bo 行政区划
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SysRegionBo bo) {
|
||||
SysRegion update = MapstructUtils.convert(bo, SysRegion.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysRegion entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除行政区划信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取省市区树形数据
|
||||
*
|
||||
* @return 省市区树形数据列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysRegionVo> getRegionTree() {
|
||||
// 查询所有正常状态且未删除的行政区划数据
|
||||
LambdaQueryWrapper<SysRegion> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(SysRegion::getDeleted, 0);
|
||||
lqw.eq(SysRegion::getStatus, "0");
|
||||
lqw.orderByAsc(SysRegion::getLevel, SysRegion::getSort, SysRegion::getId);
|
||||
|
||||
List<SysRegionVo> allRegions = baseMapper.selectVoList(lqw);
|
||||
|
||||
// 构建树形结构
|
||||
return buildRegionTree(allRegions, 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建树形结构
|
||||
*
|
||||
* @param allRegions 所有行政区划数据
|
||||
* @param parentCode 父级编码
|
||||
* @return 树形结构数据
|
||||
*/
|
||||
private List<SysRegionVo> buildRegionTree(List<SysRegionVo> allRegions, Long parentCode) {
|
||||
List<SysRegionVo> treeList = new ArrayList<>();
|
||||
|
||||
for (SysRegionVo region : allRegions) {
|
||||
if (parentCode.equals(region.getParentCode())) {
|
||||
// 递归查找子节点
|
||||
List<SysRegionVo> children = buildRegionTree(allRegions, region.getId());
|
||||
region.setChildren(children);
|
||||
treeList.add(region);
|
||||
}
|
||||
}
|
||||
|
||||
return treeList;
|
||||
}
|
||||
}
|
||||
+66
-2
@@ -24,14 +24,17 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.domain.*;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.domain.vo.SysPostVo;
|
||||
import org.dromara.system.domain.vo.SysRoleVo;
|
||||
import org.dromara.system.domain.vo.SysUserExportVo;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.dromara.system.mapper.*;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -54,6 +57,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
private final SysPostMapper postMapper;
|
||||
private final SysUserRoleMapper userRoleMapper;
|
||||
private final SysUserPostMapper userPostMapper;
|
||||
private final SysOssMapper ossMapper;
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysUserVo> selectPageUserList(SysUserBo user, PageQuery pageQuery) {
|
||||
@@ -383,14 +390,41 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
*/
|
||||
@CacheEvict(cacheNames = CacheNames.SYS_NICKNAME, key = "#user.userId")
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateUserProfile(SysUserBo user) {
|
||||
return baseMapper.update(null,
|
||||
int result = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(ObjectUtil.isNotNull(user.getNickName()), SysUser::getNickName, user.getNickName())
|
||||
.set(SysUser::getPhonenumber, user.getPhonenumber())
|
||||
.set(SysUser::getEmail, user.getEmail())
|
||||
.set(SysUser::getSex, user.getSex())
|
||||
.eq(SysUser::getUserId, user.getUserId()));
|
||||
|
||||
if (result > 0) {
|
||||
SysUserVo user1 = baseMapper.selectVoById(user.getUserId());
|
||||
if (user1.getAccountType().equals("2")) {
|
||||
// 判断账号类型为学生(accountType = "2")时,同步更新学生信息表
|
||||
try {
|
||||
String updateSql = "UPDATE xg_student_msg SET " +
|
||||
"name = ?, email = ?, gender = ?, phone = ?, update_time = NOW() " +
|
||||
"WHERE id = ? AND deleted = 0";
|
||||
|
||||
jdbcTemplate.update(updateSql,
|
||||
user.getNickName(), // 昵称对应学生姓名
|
||||
user.getEmail(), // 邮箱
|
||||
user.getSex(), // 性别
|
||||
user.getPhonenumber(), // 手机号
|
||||
user.getUserId() // 用户ID对应学生ID
|
||||
);
|
||||
|
||||
log.info("学生用户基本信息同步更新成功,用户ID: {}", user.getUserId());
|
||||
} catch (Exception e) {
|
||||
log.error("学生用户基本信息同步更新失败,用户ID: {}, 错误信息: {}", user.getUserId(), e.getMessage());
|
||||
// 这里不抛出异常,避免影响用户基本信息的更新
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,11 +435,41 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateUserAvatar(Long userId, Long avatar) {
|
||||
return baseMapper.update(null,
|
||||
boolean result = baseMapper.update(null,
|
||||
new LambdaUpdateWrapper<SysUser>()
|
||||
.set(SysUser::getAvatar, avatar)
|
||||
.eq(SysUser::getUserId, userId)) > 0;
|
||||
|
||||
// 判断账号类型为学生(accountType = "2")时,同步更新学生信息表
|
||||
if (result) {
|
||||
|
||||
SysUserVo user = baseMapper.selectVoById(userId);
|
||||
if (user.getAccountType().equals("2")) {
|
||||
|
||||
// 通过avatar丛sys_oss表获取url信息
|
||||
SysOssVo oss = ossMapper.selectVoById(avatar);
|
||||
String url = oss.getUrl();
|
||||
try {
|
||||
// 更新学生信息表 xg_student_msg 的 photo_path 字段 和 photo_url 字段
|
||||
String updateSql = "UPDATE xg_student_msg SET " +
|
||||
"photo_path = ?, photo_url = ? " +
|
||||
"WHERE id = ? AND deleted = 0";
|
||||
|
||||
jdbcTemplate.update(updateSql,
|
||||
avatar, // 头像ossid
|
||||
url, // 头像url
|
||||
user.getUserId() // 用户ID对应学生ID
|
||||
);
|
||||
log.info("学生用户头像同步更新成功,用户ID: {}", user.getUserId());
|
||||
} catch (Exception e) {
|
||||
log.error("学生用户头像同步更新失败,用户ID: {}, 错误信息: {}", user.getUserId(), e.getMessage());
|
||||
// 这里不抛出异常,避免影响用户头像的更新
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.system.mapper.SysRegionMapper">
|
||||
|
||||
</mapper>
|
||||
+5
-5
@@ -18,7 +18,7 @@
|
||||
</if>
|
||||
<if test="ew.getSqlSelect == null">
|
||||
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.account_type
|
||||
</if>
|
||||
from sys_user u
|
||||
${ew.getCustomSqlSegment}
|
||||
@@ -31,7 +31,7 @@
|
||||
</if>
|
||||
<if test="ew.getSqlSelect == null">
|
||||
u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.account_type
|
||||
</if>
|
||||
from sys_user u
|
||||
${ew.getCustomSqlSegment}
|
||||
@@ -40,7 +40,7 @@
|
||||
<select id="selectUserExportList" resultMap="SysUserExportResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_name, d.leader, u1.user_name as leaderName
|
||||
d.dept_name, d.leader, u1.user_name as leaderName,,u.account_type
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user u1 on u1.user_id = d.leader
|
||||
@@ -48,7 +48,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.account_type
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role sur on u.user_id = sur.user_id
|
||||
@@ -57,7 +57,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.account_type
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role sur on u.user_id = sur.user_id
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class XgStudentInfo extends TenantEntity {
|
||||
private String namePinyin;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ public class XgStudentInfoSimple extends TenantEntity {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
@@ -271,4 +271,4 @@ public class XgStudentInfoSimple extends TenantEntity {
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -41,8 +41,7 @@ public class XgStudentInfoBo extends BaseEntity {
|
||||
* 身份证号
|
||||
*/
|
||||
@Size(max = 18, message = "身份证号长度不能超过18个字符")
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",
|
||||
message = "身份证号格式不正确")
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$", message = "身份证号格式不正确")
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
@@ -71,7 +70,7 @@ public class XgStudentInfoBo extends BaseEntity {
|
||||
private String namePinyin;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
@NotBlank(message = "性别不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "^[MF]$", message = "性别只能为M或F")
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class XgStudentInfoVo implements Serializable {
|
||||
private String namePinyin;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
@ExcelProperty(value = "性别", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_user_sex")
|
||||
|
||||
+43
-4
@@ -17,10 +17,15 @@ import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.xg.domain.vo.XgStudentMsgVo;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgBo;
|
||||
import org.dromara.xg.service.IXgStudentMsgService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.tenant.helper.TenantHelper;
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.system.service.ISysTenantService;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
|
||||
/**
|
||||
* 学生信息
|
||||
@@ -35,6 +40,8 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
public class XgStudentMsgController extends BaseController {
|
||||
|
||||
private final IXgStudentMsgService xgStudentMsgService;
|
||||
private final ISysUserService userService;
|
||||
private final ISysTenantService tenantService;
|
||||
|
||||
/**
|
||||
* 查询学生信息列表
|
||||
@@ -63,8 +70,7 @@ public class XgStudentMsgController extends BaseController {
|
||||
*/
|
||||
@SaCheckPermission("studentMsg:studentMsg:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgStudentMsgVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
public R<XgStudentMsgVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(xgStudentMsgService.queryById(id));
|
||||
}
|
||||
|
||||
@@ -76,6 +82,40 @@ public class XgStudentMsgController extends BaseController {
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStudentMsgBo bo) {
|
||||
// 验证学号作为用户名的唯一性
|
||||
if (StringUtils.isNotBlank(bo.getStudentNo())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setUserName(bo.getStudentNo());
|
||||
if (!userService.checkUserNameUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,学号'" + bo.getStudentNo() + "'已被使用作为登录账号");
|
||||
}
|
||||
}
|
||||
|
||||
// 验证手机号唯一性(如果提供了手机号)
|
||||
if (StringUtils.isNotBlank(bo.getPhone())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setPhonenumber(bo.getPhone());
|
||||
if (!userService.checkPhoneUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,手机号码'" + bo.getPhone() + "'已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 验证邮箱唯一性(如果提供了邮箱)
|
||||
if (StringUtils.isNotBlank(bo.getEmail())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setEmail(bo.getEmail());
|
||||
if (!userService.checkEmailUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,邮箱账号'" + bo.getEmail() + "'已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 检查租户用户额度(如果启用了多租户)
|
||||
if (TenantHelper.isEnable()) {
|
||||
if (!tenantService.checkAccountBalance(TenantHelper.getTenantId())) {
|
||||
return R.fail("当前租户下用户名额不足,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(xgStudentMsgService.insertByBo(bo));
|
||||
}
|
||||
|
||||
@@ -98,8 +138,7 @@ public class XgStudentMsgController extends BaseController {
|
||||
@SaCheckPermission("studentMsg:studentMsg:remove")
|
||||
@Log(title = "学生信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(xgStudentMsgService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -285,4 +285,9 @@ public class XgClassMsg extends TenantEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 学制(年)
|
||||
*/
|
||||
private Long schoolSystem;
|
||||
|
||||
}
|
||||
+10
-10
@@ -61,7 +61,7 @@ public class XgStudentMsg extends TenantEntity {
|
||||
private String formerName;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
@@ -226,9 +226,9 @@ public class XgStudentMsg extends TenantEntity {
|
||||
private Long hasLoan;
|
||||
|
||||
/**
|
||||
* 助学贷款金额
|
||||
* 助学贷款金额(元)
|
||||
*/
|
||||
private Long loanAmount;
|
||||
private Double loanAmount;
|
||||
|
||||
/**
|
||||
* 特长爱好
|
||||
@@ -296,14 +296,14 @@ public class XgStudentMsg extends TenantEntity {
|
||||
private String guardianRelation;
|
||||
|
||||
/**
|
||||
* 家庭年收入
|
||||
* 家庭年收入(元)
|
||||
*/
|
||||
private Long familyIncome;
|
||||
private Double familyIncome;
|
||||
|
||||
/**
|
||||
* 人均收入
|
||||
* 人均收入(元)
|
||||
*/
|
||||
private Long perCapitaIncome;
|
||||
private Double perCapitaIncome;
|
||||
|
||||
/**
|
||||
* 收入来源
|
||||
@@ -323,12 +323,12 @@ public class XgStudentMsg extends TenantEntity {
|
||||
/**
|
||||
* 身高(cm)
|
||||
*/
|
||||
private Long height;
|
||||
private Double height;
|
||||
|
||||
/**
|
||||
* 体重(kg)
|
||||
*/
|
||||
private Long weight;
|
||||
private Double weight;
|
||||
|
||||
/**
|
||||
* 血型
|
||||
@@ -433,7 +433,7 @@ public class XgStudentMsg extends TenantEntity {
|
||||
/**
|
||||
* 完整度百分比
|
||||
*/
|
||||
private Long completionRate;
|
||||
private Double completionRate;
|
||||
|
||||
/**
|
||||
* 学制(年)- 预留,数据从班级表关联
|
||||
|
||||
+4
-1
@@ -267,5 +267,8 @@ public class XgClassMsgBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 学制(年)
|
||||
*/
|
||||
private Long schoolSystem;
|
||||
}
|
||||
+10
-11
@@ -61,9 +61,9 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
private String formerName;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
@NotBlank(message = "性别:M-男,F-女不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@NotBlank(message = "性别:0-男,1-女不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
private String nationality;
|
||||
|
||||
@@ -167,7 +167,7 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
private String wechat;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
private String maritalStatus;
|
||||
|
||||
@@ -229,7 +229,7 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
/**
|
||||
* 助学贷款金额
|
||||
*/
|
||||
private Long loanAmount;
|
||||
private Double loanAmount;
|
||||
|
||||
/**
|
||||
* 特长爱好
|
||||
@@ -299,12 +299,12 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
/**
|
||||
* 家庭年收入
|
||||
*/
|
||||
private Long familyIncome;
|
||||
private Double familyIncome;
|
||||
|
||||
/**
|
||||
* 人均收入
|
||||
*/
|
||||
private Long perCapitaIncome;
|
||||
private Double perCapitaIncome;
|
||||
|
||||
/**
|
||||
* 收入来源
|
||||
@@ -324,12 +324,12 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
/**
|
||||
* 身高(cm)
|
||||
*/
|
||||
private Long height;
|
||||
private Double height;
|
||||
|
||||
/**
|
||||
* 体重(kg)
|
||||
*/
|
||||
private Long weight;
|
||||
private Double weight;
|
||||
|
||||
/**
|
||||
* 血型
|
||||
@@ -434,7 +434,7 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
/**
|
||||
* 完整度百分比
|
||||
*/
|
||||
private Long completionRate;
|
||||
private Double completionRate;
|
||||
|
||||
/**
|
||||
* 学制(年)- 预留,数据从班级表关联
|
||||
@@ -546,5 +546,4 @@ public class XgStudentMsgBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+6
@@ -355,4 +355,10 @@ public class XgClassMsgVo implements Serializable {
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 学制(年)
|
||||
*/
|
||||
@ExcelProperty(value = "学制(年)")
|
||||
private Long schoolSystem;
|
||||
}
|
||||
+10
-13
@@ -14,8 +14,6 @@ import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 学生信息视图对象 xg_student_msg
|
||||
*
|
||||
@@ -75,9 +73,9 @@ public class XgStudentMsgVo implements Serializable {
|
||||
private String formerName;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
@ExcelProperty(value = "性别:M-男,F-女")
|
||||
@ExcelProperty(value = "性别:0-男,1-女")
|
||||
private String gender;
|
||||
|
||||
/**
|
||||
@@ -87,7 +85,7 @@ public class XgStudentMsgVo implements Serializable {
|
||||
private Date birthDate;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
* 民族
|
||||
*/
|
||||
@ExcelProperty(value = "民族 ")
|
||||
private String nationality;
|
||||
@@ -202,7 +200,7 @@ public class XgStudentMsgVo implements Serializable {
|
||||
private String wechat;
|
||||
|
||||
/**
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
|
||||
*/
|
||||
@ExcelProperty(value = "婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶 ")
|
||||
private String maritalStatus;
|
||||
@@ -277,7 +275,7 @@ public class XgStudentMsgVo implements Serializable {
|
||||
* 助学贷款金额
|
||||
*/
|
||||
@ExcelProperty(value = "助学贷款金额")
|
||||
private Long loanAmount;
|
||||
private Double loanAmount;
|
||||
|
||||
/**
|
||||
* 特长爱好
|
||||
@@ -361,13 +359,13 @@ public class XgStudentMsgVo implements Serializable {
|
||||
* 家庭年收入
|
||||
*/
|
||||
@ExcelProperty(value = "家庭年收入")
|
||||
private Long familyIncome;
|
||||
private Double familyIncome;
|
||||
|
||||
/**
|
||||
* 人均收入
|
||||
*/
|
||||
@ExcelProperty(value = "人均收入")
|
||||
private Long perCapitaIncome;
|
||||
private Double perCapitaIncome;
|
||||
|
||||
/**
|
||||
* 收入来源
|
||||
@@ -392,14 +390,14 @@ public class XgStudentMsgVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "身高", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "c=m")
|
||||
private Long height;
|
||||
private Double height;
|
||||
|
||||
/**
|
||||
* 体重(kg)
|
||||
*/
|
||||
@ExcelProperty(value = "体重", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "k=g")
|
||||
private Long weight;
|
||||
private Double weight;
|
||||
|
||||
/**
|
||||
* 血型
|
||||
@@ -525,7 +523,7 @@ public class XgStudentMsgVo implements Serializable {
|
||||
* 完整度百分比
|
||||
*/
|
||||
@ExcelProperty(value = "完整度百分比")
|
||||
private Long completionRate;
|
||||
private Double completionRate;
|
||||
|
||||
/**
|
||||
* 学制(年)- 预留,数据从班级表关联
|
||||
@@ -660,5 +658,4 @@ public class XgStudentMsgVo implements Serializable {
|
||||
@ExcelProperty(value = "备注信息")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+37
-1
@@ -15,8 +15,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgClassTeacherCounselorRelBo;
|
||||
import org.dromara.xg.domain.vo.XgClassTeacherCounselorRelVo;
|
||||
import org.dromara.xg.domain.XgClassTeacherCounselorRel;
|
||||
import org.dromara.xg.domain.XgStudentMsg;
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import org.dromara.xg.mapper.XgClassTeacherCounselorRelMapper;
|
||||
import org.dromara.xg.mapper.XgStudentMsgMapper;
|
||||
import org.dromara.xg.mapper.XgClassMsgMapper;
|
||||
import org.dromara.xg.service.IXgClassTeacherCounselorRelService;
|
||||
|
||||
@@ -38,6 +40,7 @@ public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCou
|
||||
|
||||
private final XgClassTeacherCounselorRelMapper baseMapper;
|
||||
private final XgClassMsgMapper classMsgMapper;
|
||||
private final XgStudentMsgMapper xgStudentMsgMapper;
|
||||
|
||||
// 班主任类型常量
|
||||
private static final String HEAD_TEACHER_TYPE = "class_teacher";
|
||||
@@ -166,6 +169,14 @@ public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCou
|
||||
log.info("已完成班级ID[{}]的班主任信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 3. 更新学生表xg_student_msg表中的班主任信息
|
||||
LambdaUpdateWrapper<XgStudentMsg> studentUpdateWrapper = Wrappers.lambdaUpdate(XgStudentMsg.class)
|
||||
.eq(XgStudentMsg::getClassId, bo.getClassId())
|
||||
.set(XgStudentMsg::getClassTeacherId, null)
|
||||
.set(XgStudentMsg::getClassTeacherName, null);
|
||||
int updateResult11 = xgStudentMsgMapper.update(null, studentUpdateWrapper);
|
||||
log.info("更新学生表中的班主任信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult11 > 0 ? "成功" : "失败");
|
||||
// 班主任信息为空,不插入新数据,直接返回
|
||||
return true;
|
||||
} else {
|
||||
@@ -182,9 +193,18 @@ public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCou
|
||||
log.info("已完成班级ID[{}]的班主任信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 3. 更新学生表xg_student_msg表中的班主任信息
|
||||
LambdaUpdateWrapper<XgStudentMsg> studentUpdateWrapper = Wrappers.lambdaUpdate(XgStudentMsg.class)
|
||||
.eq(XgStudentMsg::getClassId, bo.getClassId())
|
||||
.set(XgStudentMsg::getClassTeacherId, bo.getTeacherId())
|
||||
.set(XgStudentMsg::getClassTeacherName, bo.getTeacherName());
|
||||
int updateResult11 = xgStudentMsgMapper.update(null, studentUpdateWrapper);
|
||||
log.info("更新学生表中的班主任信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult11 > 0 ? "成功" : "失败");
|
||||
|
||||
}
|
||||
|
||||
// 3. 插入新的班主任关联记录
|
||||
// 4. 插入新的班主任关联记录
|
||||
XgClassTeacherCounselorRel newRel = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
newRel.setId(null); // 确保插入新记录
|
||||
newRel.setDeleted(0L);
|
||||
@@ -251,6 +271,14 @@ public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCou
|
||||
log.info("已完成班级ID[{}]的辅导员信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 3. 更新学生表xg_student_msg表中的辅导员信息
|
||||
LambdaUpdateWrapper<XgStudentMsg> studentUpdateWrapper = Wrappers.lambdaUpdate(XgStudentMsg.class)
|
||||
.eq(XgStudentMsg::getClassId, bo.getClassId())
|
||||
.set(XgStudentMsg::getCounselorId, null)
|
||||
.set(XgStudentMsg::getCounselorName, null);
|
||||
int updateResult11 = xgStudentMsgMapper.update(null, studentUpdateWrapper);
|
||||
log.info("更新学生表中的辅导员信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult11 > 0 ? "成功" : "失败");
|
||||
// 辅导员信息为空,不插入新数据,直接返回
|
||||
return true;
|
||||
} else {
|
||||
@@ -265,6 +293,14 @@ public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCou
|
||||
|
||||
log.info("已完成班级ID[{}]的辅导员信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
// 3. 更新学生表xg_student_msg表中的辅导员信息
|
||||
LambdaUpdateWrapper<XgStudentMsg> studentUpdateWrapper = Wrappers.lambdaUpdate(XgStudentMsg.class)
|
||||
.eq(XgStudentMsg::getClassId, bo.getClassId())
|
||||
.set(XgStudentMsg::getCounselorId, bo.getTeacherId())
|
||||
.set(XgStudentMsg::getCounselorName, bo.getTeacherName());
|
||||
int updateResult11 = xgStudentMsgMapper.update(null, studentUpdateWrapper);
|
||||
log.info("更新学生表中的辅导员信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult11 > 0 ? "成功" : "失败");
|
||||
}
|
||||
|
||||
// 3. 插入新的辅导员关联记录
|
||||
|
||||
+83
-20
@@ -10,12 +10,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgBo;
|
||||
import org.dromara.xg.domain.vo.XgStudentMsgVo;
|
||||
import org.dromara.xg.domain.XgStudentMsg;
|
||||
import org.dromara.xg.mapper.XgStudentMsgMapper;
|
||||
import org.dromara.xg.service.IXgStudentMsgService;
|
||||
|
||||
import org.dromara.system.service.ISysUserService;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import cn.hutool.crypto.digest.BCrypt;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -32,6 +35,7 @@ import java.util.Collection;
|
||||
public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
|
||||
private final XgStudentMsgMapper baseMapper;
|
||||
private final ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 查询学生信息
|
||||
@@ -40,7 +44,7 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
* @return 学生信息
|
||||
*/
|
||||
@Override
|
||||
public XgStudentMsgVo queryById(Long id){
|
||||
public XgStudentMsgVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@@ -84,7 +88,8 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(bo.getBirthDate() != null, XgStudentMsg::getBirthDate, bo.getBirthDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNationality()), XgStudentMsg::getNationality, bo.getNationality());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNativePlace()), XgStudentMsg::getNativePlace, bo.getNativePlace());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPoliticalStatus()), XgStudentMsg::getPoliticalStatus, bo.getPoliticalStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPoliticalStatus()), XgStudentMsg::getPoliticalStatus,
|
||||
bo.getPoliticalStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHukouLocation()), XgStudentMsg::getHukouLocation, bo.getHukouLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHomeAddress()), XgStudentMsg::getHomeAddress, bo.getHomeAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCurrentAddress()), XgStudentMsg::getCurrentAddress, bo.getCurrentAddress());
|
||||
@@ -94,7 +99,8 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), XgStudentMsg::getPhone, bo.getPhone());
|
||||
lqw.eq(bo.getIsBoarder() != null, XgStudentMsg::getIsBoarder, bo.getIsBoarder());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEducationLevel()), XgStudentMsg::getEducationLevel, bo.getEducationLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHouseholdRegisterType()), XgStudentMsg::getHouseholdRegisterType, bo.getHouseholdRegisterType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHouseholdRegisterType()), XgStudentMsg::getHouseholdRegisterType,
|
||||
bo.getHouseholdRegisterType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReligion()), XgStudentMsg::getReligion, bo.getReligion());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSourceRegion()), XgStudentMsg::getSourceRegion, bo.getSourceRegion());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGraduateSchool()), XgStudentMsg::getGraduateSchool, bo.getGraduateSchool());
|
||||
@@ -102,9 +108,12 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQq()), XgStudentMsg::getQq, bo.getQq());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getWechat()), XgStudentMsg::getWechat, bo.getWechat());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaritalStatus()), XgStudentMsg::getMaritalStatus, bo.getMaritalStatus());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getEmergencyContactName()), XgStudentMsg::getEmergencyContactName, bo.getEmergencyContactName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPhone()), XgStudentMsg::getEmergencyContactPhone, bo.getEmergencyContactPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactRelation()), XgStudentMsg::getEmergencyContactRelation, bo.getEmergencyContactRelation());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getEmergencyContactName()), XgStudentMsg::getEmergencyContactName,
|
||||
bo.getEmergencyContactName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPhone()), XgStudentMsg::getEmergencyContactPhone,
|
||||
bo.getEmergencyContactPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactRelation()), XgStudentMsg::getEmergencyContactRelation,
|
||||
bo.getEmergencyContactRelation());
|
||||
lqw.eq(bo.getIsPoorStudent() != null, XgStudentMsg::getIsPoorStudent, bo.getIsPoorStudent());
|
||||
lqw.eq(bo.getIsMinority() != null, XgStudentMsg::getIsMinority, bo.getIsMinority());
|
||||
lqw.eq(bo.getIsDisabled() != null, XgStudentMsg::getIsDisabled, bo.getIsDisabled());
|
||||
@@ -117,7 +126,8 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecialties()), XgStudentMsg::getSpecialties, bo.getSpecialties());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAwards()), XgStudentMsg::getAwards, bo.getAwards());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getViolations()), XgStudentMsg::getViolations, bo.getViolations());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSocialActivities()), XgStudentMsg::getSocialActivities, bo.getSocialActivities());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSocialActivities()), XgStudentMsg::getSocialActivities,
|
||||
bo.getSocialActivities());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFatherName()), XgStudentMsg::getFatherName, bo.getFatherName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFatherPhone()), XgStudentMsg::getFatherPhone, bo.getFatherPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFatherWorkUnit()), XgStudentMsg::getFatherWorkUnit, bo.getFatherWorkUnit());
|
||||
@@ -126,29 +136,35 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMotherWorkUnit()), XgStudentMsg::getMotherWorkUnit, bo.getMotherWorkUnit());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getGuardianName()), XgStudentMsg::getGuardianName, bo.getGuardianName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGuardianPhone()), XgStudentMsg::getGuardianPhone, bo.getGuardianPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGuardianRelation()), XgStudentMsg::getGuardianRelation, bo.getGuardianRelation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGuardianRelation()), XgStudentMsg::getGuardianRelation,
|
||||
bo.getGuardianRelation());
|
||||
lqw.eq(bo.getFamilyIncome() != null, XgStudentMsg::getFamilyIncome, bo.getFamilyIncome());
|
||||
lqw.eq(bo.getPerCapitaIncome() != null, XgStudentMsg::getPerCapitaIncome, bo.getPerCapitaIncome());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIncomeSource()), XgStudentMsg::getIncomeSource, bo.getIncomeSource());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFamilyEconomicStatus()), XgStudentMsg::getFamilyEconomicStatus, bo.getFamilyEconomicStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFamilyEconomicStatus()), XgStudentMsg::getFamilyEconomicStatus,
|
||||
bo.getFamilyEconomicStatus());
|
||||
lqw.eq(bo.getFamilyMembers() != null, XgStudentMsg::getFamilyMembers, bo.getFamilyMembers());
|
||||
lqw.eq(bo.getHeight() != null, XgStudentMsg::getHeight, bo.getHeight());
|
||||
lqw.eq(bo.getWeight() != null, XgStudentMsg::getWeight, bo.getWeight());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBloodType()), XgStudentMsg::getBloodType, bo.getBloodType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getHealthStatus()), XgStudentMsg::getHealthStatus, bo.getHealthStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecialCondition()), XgStudentMsg::getSpecialCondition, bo.getSpecialCondition());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecialCondition()), XgStudentMsg::getSpecialCondition,
|
||||
bo.getSpecialCondition());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMedicalHistory()), XgStudentMsg::getMedicalHistory, bo.getMedicalHistory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAllergies()), XgStudentMsg::getAllergies, bo.getAllergies());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDisabilityType()), XgStudentMsg::getDisabilityType, bo.getDisabilityType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDisabilityLevel()), XgStudentMsg::getDisabilityLevel, bo.getDisabilityLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAdmissionCategory()), XgStudentMsg::getAdmissionCategory, bo.getAdmissionCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDisabilityLevel()), XgStudentMsg::getDisabilityLevel,
|
||||
bo.getDisabilityLevel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAdmissionCategory()), XgStudentMsg::getAdmissionCategory,
|
||||
bo.getAdmissionCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStudentStatus()), XgStudentMsg::getStudentStatus, bo.getStudentStatus());
|
||||
lqw.eq(bo.getEnrollmentYear() != null, XgStudentMsg::getEnrollmentYear, bo.getEnrollmentYear());
|
||||
lqw.eq(bo.getEnrollmentDate() != null, XgStudentMsg::getEnrollmentDate, bo.getEnrollmentDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBankCardNo()), XgStudentMsg::getBankCardNo, bo.getBankCardNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBankName()), XgStudentMsg::getBankName, bo.getBankName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBankBranch()), XgStudentMsg::getBankBranch, bo.getBankBranch());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCardHolderName()), XgStudentMsg::getCardHolderName, bo.getCardHolderName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCardHolderName()), XgStudentMsg::getCardHolderName,
|
||||
bo.getCardHolderName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInfoStatus()), XgStudentMsg::getInfoStatus, bo.getInfoStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDataSource()), XgStudentMsg::getDataSource, bo.getDataSource());
|
||||
lqw.eq(bo.getLastBatchId() != null, XgStudentMsg::getLastBatchId, bo.getLastBatchId());
|
||||
@@ -168,8 +184,10 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
lqw.eq(bo.getCounselorId() != null, XgStudentMsg::getCounselorId, bo.getCounselorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCounselorName()), XgStudentMsg::getCounselorName, bo.getCounselorName());
|
||||
lqw.eq(bo.getClassTeacherId() != null, XgStudentMsg::getClassTeacherId, bo.getClassTeacherId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassTeacherName()), XgStudentMsg::getClassTeacherName, bo.getClassTeacherName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDormitoryBuilding()), XgStudentMsg::getDormitoryBuilding, bo.getDormitoryBuilding());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassTeacherName()), XgStudentMsg::getClassTeacherName,
|
||||
bo.getClassTeacherName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDormitoryBuilding()), XgStudentMsg::getDormitoryBuilding,
|
||||
bo.getDormitoryBuilding());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDormitoryRoom()), XgStudentMsg::getDormitoryRoom, bo.getDormitoryRoom());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExtField1()), XgStudentMsg::getExtField1, bo.getExtField1());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExtField2()), XgStudentMsg::getExtField2, bo.getExtField2());
|
||||
@@ -186,12 +204,57 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(XgStudentMsgBo bo) {
|
||||
XgStudentMsg add = MapstructUtils.convert(bo, XgStudentMsg.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
|
||||
// 1. 向sys_user表插入数据
|
||||
SysUserBo sysUserBo = new SysUserBo();
|
||||
sysUserBo.setUserId(bo.getId());
|
||||
sysUserBo.setUserName(bo.getStudentNo()); // 使用学号作为用户名
|
||||
sysUserBo.setNickName(bo.getName()); // 使用姓名作为昵称
|
||||
sysUserBo.setUserType("sys_user"); // 设置用户类型
|
||||
sysUserBo.setEmail(bo.getEmail()); // 设置邮箱
|
||||
sysUserBo.setPhonenumber(bo.getPhone()); // 设置手机号
|
||||
sysUserBo.setSex(bo.getGender()); // 设置性别
|
||||
// 设置头像,空字符串转为null
|
||||
sysUserBo.setAvatar(StringUtils.isNotBlank(bo.getPhotoPath()) ? bo.getPhotoPath() : null);
|
||||
sysUserBo.setAccountType("2"); // 设置账号类型
|
||||
sysUserBo.setStatus("0"); // 设置状态为正常
|
||||
sysUserBo.setRemark("学生信息系统自动创建"); // 设置备注
|
||||
sysUserBo.setPassword(BCrypt.hashpw("Hzdyjs123456!@#"));// 设置默认密码
|
||||
// 将classId从String转换为Long类型
|
||||
if (StringUtils.isNotBlank(bo.getClassId())) {
|
||||
try {
|
||||
sysUserBo.setDeptId(Long.valueOf(bo.getClassId()));
|
||||
} catch (NumberFormatException e) {
|
||||
log.warn("班级ID格式错误,无法转换为Long类型: {}", bo.getClassId());
|
||||
sysUserBo.setDeptId(null);
|
||||
}
|
||||
} else {
|
||||
sysUserBo.setDeptId(null);
|
||||
}
|
||||
|
||||
try {
|
||||
int userResult = sysUserService.insertUser(sysUserBo);
|
||||
if (userResult > 0) {
|
||||
log.info("成功为学生 {} 创建系统用户,用户ID: {}", bo.getName(), sysUserBo.getUserId());
|
||||
|
||||
// 2. 给学生绑定学生角色
|
||||
Long studentRoleId = 1938120227459309569L; // 学生角色ID
|
||||
Long[] roleIds = { studentRoleId };
|
||||
sysUserService.insertUserAuth(sysUserBo.getUserId(), roleIds);
|
||||
log.info("成功为学生 {} 绑定学生角色", bo.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("为学生 {} 创建系统用户失败: {}", bo.getName(), e.getMessage(), e);
|
||||
// 注意: 由于使用了@Transactional,如果出现异常,整个事务会回滚
|
||||
throw new RuntimeException("创建学生系统用户失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
@@ -212,8 +275,8 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgStudentMsg entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
private void validEntityBeforeSave(XgStudentMsg entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,8 +288,8 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
+2
-1
@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="classType" column="class_type"/>
|
||||
<result property="grade" column="grade"/>
|
||||
<result property="enrollmentYear" column="enrollment_year"/>
|
||||
<result property="schoolSystem" column="school_system"/>
|
||||
<result property="graduationYear" column="graduation_year"/>
|
||||
<result property="trainingType" column="training_type"/>
|
||||
<result property="degreeType" column="degree_type"/>
|
||||
@@ -64,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<sql id="selectXgClassMsgVo">
|
||||
select c.id, c.college_id, dc.dept_name as college_name, c.major_id, dm.dept_name as major_name,
|
||||
c.class_code, c.class_name, c.class_type, c.grade, c.enrollment_year, c.graduation_year,
|
||||
c.class_code, c.class_name, c.class_type, c.grade, c.enrollment_year,c.school_system, c.graduation_year,
|
||||
c.training_type, c.degree_type, c.counselor_id, c.counselor_name, c.class_teacher_id,
|
||||
c.class_teacher_name, c.class_advisor_id, c.class_advisor_name, c.class_monitor_id,
|
||||
c.class_monitor_name, c.deputy_monitor_id, c.deputy_monitor_name, c.class_status,
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class ZsjyEnrollmentInfo extends TenantEntity {
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
|
||||
+3
-3
@@ -39,12 +39,12 @@ public class ZsjyEnrollmentInfoBo extends BaseEntity {
|
||||
* 身份证号
|
||||
*/
|
||||
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$",
|
||||
message = "身份证号格式不正确", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$", message = "身份证号格式不正确", groups = {
|
||||
AddGroup.class, EditGroup.class })
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
@NotBlank(message = "性别不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "^[MF]$", message = "性别只能是M或F", groups = { AddGroup.class, EditGroup.class })
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class ZsjyEnrollmentInfoVo implements Serializable {
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
@ExcelProperty(value = "性别", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_gender")
|
||||
|
||||
+1
-1
@@ -225,7 +225,7 @@ public class ZsjyEnrollmentProcessVo implements Serializable {
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)- 从enrollment_info表获取
|
||||
* 性别(0-男 1-女)- 从enrollment_info表获取
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
# 学生信息管理-宿舍楼栋字段优化变更记录
|
||||
|
||||
## 📅 变更信息
|
||||
- **变更日期**: 2025-01-01
|
||||
- **变更人员**: AI Assistant
|
||||
- **变更类型**: 功能优化
|
||||
- **影响模块**: 学生信息管理 - 新增/编辑弹窗
|
||||
|
||||
## 🎯 变更目标
|
||||
优化学生信息管理中的宿舍楼栋字段,从手动输入改为通过API获取的树形下拉选择,并为楼栋名称添加性别标识。
|
||||
|
||||
## 📋 变更内容
|
||||
|
||||
### 1. 前端页面修改
|
||||
**文件**: `web/src/views/studentMsg/studentMsg/index.vue`
|
||||
|
||||
#### 1.1 添加状态变量
|
||||
```typescript
|
||||
const dormBuildingOptions = ref([]); // 宿舍楼栋选项
|
||||
```
|
||||
|
||||
#### 1.2 新增API调用函数
|
||||
```typescript
|
||||
/** 获取宿舍楼栋树形数据 */
|
||||
const getDormBuildingTree = async () => {
|
||||
try {
|
||||
const res = await service.get('/xgss/dormBuildingTree/list');
|
||||
if (res && res.data) {
|
||||
// 处理数据,为楼栋名称添加性别标识
|
||||
const processTreeData = (nodes: any[]): any[] => {
|
||||
return nodes.map(node => {
|
||||
const processedNode = { ...node };
|
||||
|
||||
// 如果是楼栋类型,添加性别标识
|
||||
if (node.type === 'building' && node.buildingType) {
|
||||
const genderPrefix = node.buildingType === 1 ? '(男)' : node.buildingType === 2 ? '(女)' : '';
|
||||
processedNode.label = genderPrefix + node.label;
|
||||
processedNode.name = genderPrefix + node.name;
|
||||
}
|
||||
|
||||
// 递归处理子节点
|
||||
if (node.children && node.children.length > 0) {
|
||||
processedNode.children = processTreeData(node.children);
|
||||
}
|
||||
|
||||
return processedNode;
|
||||
});
|
||||
};
|
||||
|
||||
dormBuildingOptions.value = processTreeData(res.data);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取宿舍楼栋数据失败:', error);
|
||||
ElMessage.error('获取宿舍楼栋数据失败');
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
#### 1.3 宿舍楼栋字段改为树形选择器
|
||||
**位置**: 学籍信息Tab
|
||||
```vue
|
||||
<el-form-item label="宿舍楼栋" prop="dormitoryBuilding">
|
||||
<el-tree-select
|
||||
v-model="form.dormitoryBuilding"
|
||||
:data="dormBuildingOptions"
|
||||
:props="{
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
disabled: (data) => data.type !== 'building'
|
||||
}"
|
||||
:check-strictly="true"
|
||||
:render-after-expand="false"
|
||||
placeholder="请选择宿舍楼栋"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
```
|
||||
|
||||
#### 1.4 组件初始化调用
|
||||
```typescript
|
||||
onMounted(() => {
|
||||
getDeptTree(); // 初始化部门数据
|
||||
getRegionTree(); // 初始化行政区划数据
|
||||
getDormBuildingTree(); // 初始化宿舍楼栋数据 - 新增
|
||||
getList(); // 初始化列表数据
|
||||
});
|
||||
```
|
||||
|
||||
## 🔧 技术实现要点
|
||||
|
||||
### 1. API接口
|
||||
- **URL**: `/xgss/dormBuildingTree/list`
|
||||
- **方法**: GET
|
||||
- **入参**: 无
|
||||
- **返回**: 树形结构的宿舍楼栋数据
|
||||
|
||||
### 2. 数据处理逻辑
|
||||
- 根据 `buildingType` 字段添加性别标识:
|
||||
- `buildingType = 1`: 添加"(男)"前缀
|
||||
- `buildingType = 2`: 添加"(女)"前缀
|
||||
- 递归处理树形数据结构
|
||||
- 保持原有数据结构不变,仅添加前缀
|
||||
|
||||
### 3. 选择限制
|
||||
- 只能选择 `type === 'building'` 的节点
|
||||
- 其他类型节点自动禁用
|
||||
- 支持搜索过滤功能
|
||||
|
||||
## ✅ 功能验证
|
||||
|
||||
### 1. 界面功能
|
||||
- [x] 宿舍楼栋字段显示为树形下拉选择器
|
||||
- [x] 楼栋名称正确显示性别标识
|
||||
- [x] 只能选择楼栋类型节点
|
||||
- [x] 支持搜索和清空功能
|
||||
|
||||
### 2. 数据交互
|
||||
- [x] API正确调用
|
||||
- [x] 数据正确解析和处理
|
||||
- [x] 树形结构正确显示
|
||||
- [x] 选择值正确保存
|
||||
|
||||
## 🎯 预期效果
|
||||
1. **用户体验优化**: 从手动输入改为选择,减少输入错误
|
||||
2. **数据标准化**: 确保宿舍楼栋数据的规范性和一致性
|
||||
3. **性别标识**: 清晰显示楼栋的性别属性,便于管理
|
||||
4. **数据准确性**: 通过API获取最新的楼栋信息
|
||||
|
||||
## 📝 注意事项
|
||||
1. 确保后端API `/xgss/dormBuildingTree/list` 正常可用
|
||||
2. 数据结构需包含 `type`、`buildingType`、`label`、`id` 等字段
|
||||
3. 如果API调用失败,会显示错误提示信息
|
||||
4. 选择器支持键盘导航和筛选功能
|
||||
|
||||
## 🔄 后续优化建议
|
||||
1. 可考虑添加楼栋可用性状态显示
|
||||
2. 可添加楼栋详细信息预览功能
|
||||
3. 可根据学生性别自动过滤对应性别的楼栋
|
||||
@@ -0,0 +1,107 @@
|
||||
# 学生信息管理用户验证逻辑修复记录
|
||||
|
||||
**修复时间**: 2025-01-01 14:30:00
|
||||
**修复人员**: AI Assistant
|
||||
**影响模块**: 学工管理 - 学生信息管理
|
||||
**修复类型**: 代码错误修复
|
||||
|
||||
## 问题描述
|
||||
|
||||
XgStudentMsgController中的add方法存在多个代码错误:
|
||||
|
||||
1. **变量名错误**: 使用了未定义的`user`变量,应该使用参数`bo`
|
||||
2. **导入缺失**: 缺少`StringUtils`和`SysUserBo`的导入
|
||||
3. **服务未注入**: 引用了`tenantService`但未正确注入`ISysTenantService`
|
||||
4. **方法调用错误**: 用户验证方法需要`SysUserBo`对象参数,而不是`String`
|
||||
|
||||
## 错误代码片段
|
||||
|
||||
```java
|
||||
// 错误的代码
|
||||
if (!userService.checkUserNameUnique(user)) {
|
||||
return R.fail("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
```
|
||||
|
||||
## 修复方案
|
||||
|
||||
### 1. 添加必要的导入
|
||||
|
||||
```java
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.system.domain.bo.SysUserBo;
|
||||
import org.dromara.system.service.ISysTenantService;
|
||||
```
|
||||
|
||||
### 2. 注入租户服务
|
||||
|
||||
```java
|
||||
private final ISysTenantService tenantService;
|
||||
```
|
||||
|
||||
### 3. 修正用户验证逻辑
|
||||
|
||||
```java
|
||||
// 验证学号作为用户名的唯一性
|
||||
if (StringUtils.isNotBlank(bo.getStudentNo())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setUserName(bo.getStudentNo());
|
||||
if (!userService.checkUserNameUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,学号'" + bo.getStudentNo() + "'已被使用作为登录账号");
|
||||
}
|
||||
}
|
||||
|
||||
// 验证手机号唯一性(如果提供了手机号)
|
||||
if (StringUtils.isNotBlank(bo.getPhone())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setPhonenumber(bo.getPhone());
|
||||
if (!userService.checkPhoneUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,手机号码'" + bo.getPhone() + "'已存在");
|
||||
}
|
||||
}
|
||||
|
||||
// 验证邮箱唯一性(如果提供了邮箱)
|
||||
if (StringUtils.isNotBlank(bo.getEmail())) {
|
||||
SysUserBo tempUser = new SysUserBo();
|
||||
tempUser.setEmail(bo.getEmail());
|
||||
if (!userService.checkEmailUnique(tempUser)) {
|
||||
return R.fail("新增学生'" + bo.getName() + "'失败,邮箱账号'" + bo.getEmail() + "'已存在");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 修复文件列表
|
||||
|
||||
- `backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/controller/XgStudentMsgController.java`
|
||||
|
||||
## 修复效果
|
||||
|
||||
1. ✅ **编译错误解决**: 消除了所有编译错误
|
||||
2. ✅ **逻辑正确**: 用户验证逻辑适配学生信息的字段(学号、手机号、邮箱)
|
||||
3. ✅ **错误消息优化**: 错误提示信息更加清晰和用户友好
|
||||
4. ✅ **服务注入完整**: 租户服务正确注入,支持多租户用户额度检查
|
||||
|
||||
## 业务逻辑说明
|
||||
|
||||
此修复确保了学生信息创建时的用户验证机制正常工作:
|
||||
|
||||
1. **学号唯一性**: 学号将作为系统用户名,必须保证唯一性
|
||||
2. **联系方式唯一性**: 手机号和邮箱在系统中必须唯一(如果提供)
|
||||
3. **租户额度检查**: 在多租户环境下检查用户创建额度
|
||||
4. **自动用户创建**: 通过验证后,Service层会自动为学生创建对应的系统用户账号
|
||||
|
||||
## 关联说明
|
||||
|
||||
该验证逻辑与`XgStudentMsgServiceImpl.insertByBo`方法中的用户创建逻辑配套使用,确保数据一致性和业务完整性。
|
||||
|
||||
## 测试建议
|
||||
|
||||
1. 测试学号重复时的错误提示
|
||||
2. 测试手机号重复时的错误提示
|
||||
3. 测试邮箱重复时的错误提示
|
||||
4. 测试多租户环境下的用户额度限制
|
||||
5. 测试正常学生信息创建和用户账号自动生成
|
||||
|
||||
---
|
||||
|
||||
**备注**: 此次修复遵循了项目的编码规范和错误处理标准,确保了学生信息管理模块的稳定性和可靠性。
|
||||
@@ -0,0 +1,117 @@
|
||||
# 学生用户操作限制功能开发记录
|
||||
|
||||
**变更时间**: 2025-01-01 14:30:00
|
||||
**开发者**: Cursor AI
|
||||
**变更类型**: 功能增强
|
||||
**影响模块**: 系统管理-用户管理
|
||||
|
||||
## 变更概述
|
||||
|
||||
在用户管理界面中,当用户的 `accountType` 为 "2"(学生用户)时,禁用所有管理操作,包括修改、删除、状态调整、重置密码、分配角色等。
|
||||
|
||||
## 详细变更内容
|
||||
|
||||
### 1. 前端类型定义更新
|
||||
|
||||
**文件**: `web/src/api/system/user/types.ts`
|
||||
|
||||
- 在 `UserVO` 接口中添加 `accountType: string` 字段
|
||||
|
||||
### 2. 用户管理页面功能限制
|
||||
|
||||
**文件**: `web/src/views/system/user/index.vue`
|
||||
|
||||
#### 2.1 新增计算属性
|
||||
- `isSelectedStudentUser`: 判断选中的单个用户是否为学生用户
|
||||
- `hasSelectedStudentUser`: 判断选中的用户中是否包含学生用户
|
||||
|
||||
#### 2.2 批量操作按钮限制
|
||||
- **修改按钮**: 当选中学生用户时禁用 (`isSelectedStudentUser`)
|
||||
- **删除按钮**: 当选中用户包含学生用户时禁用 (`hasSelectedStudentUser`)
|
||||
|
||||
#### 2.3 表格操作限制
|
||||
- **状态开关**: 学生用户的状态开关设为禁用状态
|
||||
- **行操作按钮**: 学生用户隐藏所有操作按钮(修改、删除、重置密码、分配角色)
|
||||
- **学生用户标识**: 在操作列显示"学生用户"文字提示
|
||||
|
||||
#### 2.4 操作函数校验
|
||||
- `handleDelete()`: 检查并阻止删除学生用户
|
||||
- `handleStatusChange()`: 检查并阻止修改学生用户状态
|
||||
- `handleAuthRole()`: 检查并阻止为学生用户分配角色
|
||||
- `handleResetPwd()`: 检查并阻止重置学生用户密码
|
||||
- `handleUpdate()`: 检查并阻止修改学生用户信息
|
||||
|
||||
#### 2.5 用户体验优化
|
||||
- 所有被禁止的操作都会显示友好的错误提示信息
|
||||
- 学生用户在操作列显示"学生用户"标识,鼠标悬停显示"学生用户不允许操作"提示
|
||||
|
||||
## 技术实现要点
|
||||
|
||||
### 条件判断逻辑
|
||||
```javascript
|
||||
// 单个学生用户判断
|
||||
scope.row.accountType === '2'
|
||||
|
||||
// 批量操作中包含学生用户判断
|
||||
selectedUsers.value.some(user => user.accountType === '2')
|
||||
```
|
||||
|
||||
### 状态开关禁用
|
||||
```vue
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
:disabled="scope.row.accountType === '2'"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
```
|
||||
|
||||
### 操作按钮条件显示
|
||||
```vue
|
||||
<el-tooltip v-if="scope.row.userId !== 1 && scope.row.accountType !== '2'" content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
```
|
||||
|
||||
## 功能验证
|
||||
|
||||
### 测试场景
|
||||
1. ✅ 学生用户状态开关被禁用
|
||||
2. ✅ 学生用户不显示修改、删除、重置密码、分配角色按钮
|
||||
3. ✅ 选中学生用户时批量修改按钮被禁用
|
||||
4. ✅ 选中包含学生用户的多个用户时批量删除按钮被禁用
|
||||
5. ✅ 所有被禁止的操作都显示友好提示信息
|
||||
6. ✅ 学生用户在操作列显示"学生用户"标识
|
||||
|
||||
### 错误提示信息
|
||||
- "学生用户不允许删除操作"
|
||||
- "学生用户不允许修改状态"
|
||||
- "学生用户不允许分配角色操作"
|
||||
- "学生用户不允许重置密码操作"
|
||||
- "学生用户不允许修改操作"
|
||||
- "选中的用户中包含学生用户,不允许删除操作"
|
||||
|
||||
## 影响范围
|
||||
|
||||
### 直接影响
|
||||
- 系统管理员无法通过用户管理界面修改学生用户信息
|
||||
- 学生用户的账号状态无法通过界面调整
|
||||
- 学生用户无法被删除、重置密码或分配角色
|
||||
|
||||
### 兼容性
|
||||
- 保持了对管理员用户(userId === 1)的原有保护逻辑
|
||||
- 不影响非学生用户的正常管理功能
|
||||
- 向下兼容,对没有 accountType 字段的用户不影响
|
||||
|
||||
## 后续优化建议
|
||||
|
||||
1. 考虑添加学生用户专用的管理界面,提供受限的编辑功能
|
||||
2. 可以考虑增加配置项,允许超级管理员临时开启学生用户的管理权限
|
||||
3. 添加学生用户批量导入/导出功能的特殊处理逻辑
|
||||
|
||||
## 相关文档
|
||||
|
||||
- API文档: `docs/开发文档/API/用户认证登录API.md`
|
||||
- 数据库设计: `docs/设计文档/database/mysql-database-standard.md`
|
||||
- 前端开发规范: `.cursor/cursorrules-frontend.md`
|
||||
@@ -0,0 +1,120 @@
|
||||
# 代码调整记录 - 2025-01-01 - system
|
||||
|
||||
## 2025-01-01 23:xx:xx - 学生信息管理表单只读字段优化
|
||||
|
||||
### 变更内容
|
||||
优化学生信息新增/编辑表单中自动填充字段的显示效果,将从班级信息自动填充的字段设置为只读状态。
|
||||
|
||||
### 修改文件
|
||||
- `web/src/views/studentMsg/studentMsg/index.vue`
|
||||
|
||||
### 具体修改
|
||||
1. **班级信息相关字段设置为disabled状态**:
|
||||
- 班级名称 (className) - 改为disabled
|
||||
- 学院名称 (collegeName) - 改为disabled
|
||||
- 专业名称 (majorName) - 改为disabled
|
||||
- 班主任姓名 (classTeacherName) - 改为disabled
|
||||
|
||||
2. **学籍信息相关字段设置为disabled状态**:
|
||||
- 学历层次 (academicLevel) - 改为disabled
|
||||
- 年级 (grade) - 改为disabled
|
||||
- 入学年份 (enrollmentYear) - 改为disabled
|
||||
- 学制 (schoolSystem) - 改为disabled
|
||||
|
||||
### 变更原因
|
||||
- 这些字段在新增学生时从选中的班级信息自动填充
|
||||
- 设置为disabled状态可以明确告知用户这些字段是自动填充的
|
||||
- 防止用户误操作导致数据不一致
|
||||
- 提供更好的用户体验,明确区分可编辑和不可编辑字段
|
||||
|
||||
### 技术影响
|
||||
- 提升表单的用户体验
|
||||
- 确保数据一致性
|
||||
- 视觉上明确区分自动填充字段和手动输入字段
|
||||
|
||||
### 测试要点
|
||||
- 新增学生时,从班级树选择班级后,相关字段应正确填充且显示为disabled状态
|
||||
- 编辑学生时,这些字段应保持可编辑状态(因为可能需要修正数据)
|
||||
|
||||
---
|
||||
|
||||
## 📋 变更概览
|
||||
- **日期**: 2025-01-01
|
||||
- **操作员**: system
|
||||
- **变更类型**: 功能优化
|
||||
- **影响模块**: 学工管理-学生信息管理
|
||||
|
||||
---
|
||||
|
||||
## 🎯 本次变更
|
||||
|
||||
### 2025-01-01 12:30:00 - 学生信息管理页面新增按钮条件显示
|
||||
|
||||
**变更文件**:
|
||||
- `web/src/views/studentMsg/studentMsg/index.vue`
|
||||
|
||||
**变更内容**:
|
||||
1. **新增响应式变量**:
|
||||
- 添加 `currentSelectedNode` 用于存储当前选中的部门节点信息
|
||||
|
||||
2. **新增计算属性**:
|
||||
- 添加 `showAddButton` 计算属性,判断是否显示新增按钮
|
||||
- 判断逻辑:只有当 `deptCategory` 以 "bj-" 开头时才显示新增按钮
|
||||
|
||||
3. **修改节点点击事件**:
|
||||
- 在 `handleNodeClick` 方法中保存当前选中的节点信息到 `currentSelectedNode`
|
||||
|
||||
4. **修改新增按钮显示**:
|
||||
- 在新增按钮的 `el-col` 组件上添加 `v-if="showAddButton"` 条件
|
||||
|
||||
5. **修改重置操作**:
|
||||
- 在 `resetQuery` 方法中清空 `currentSelectedNode` 以隐藏新增按钮
|
||||
|
||||
**技术实现**:
|
||||
```vue
|
||||
// 1. 导入 computed 函数
|
||||
import { getCurrentInstance, ref, reactive, toRefs, watchEffect, onMounted, computed } from 'vue';
|
||||
|
||||
// 2. 新增变量和计算属性
|
||||
const currentSelectedNode = ref<any>(null);
|
||||
const showAddButton = computed(() => {
|
||||
if (!currentSelectedNode.value) {
|
||||
return false;
|
||||
}
|
||||
return currentSelectedNode.value.deptCategory && currentSelectedNode.value.deptCategory.startsWith('bj-');
|
||||
});
|
||||
|
||||
// 3. 修改模板
|
||||
<el-col :span="1.5" v-if="showAddButton">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||
</el-col>
|
||||
```
|
||||
|
||||
**业务价值**:
|
||||
- 🎯 **权限控制**: 确保只有在班级节点才能新增学生,符合业务逻辑
|
||||
- 🔒 **数据安全**: 防止在错误的组织层级下创建学生数据
|
||||
- 👥 **用户体验**: 清晰的界面提示,避免用户在非班级节点进行无效操作
|
||||
- 📊 **数据完整性**: 确保学生数据与正确的班级关联
|
||||
|
||||
**测试建议**:
|
||||
1. 点击非班级节点,确认新增按钮隐藏
|
||||
2. 点击班级节点(deptCategory 以 bj- 开头),确认新增按钮显示
|
||||
3. 执行重置操作,确认新增按钮隐藏
|
||||
4. 测试新增学生功能正常
|
||||
|
||||
---
|
||||
|
||||
## 📝 技术规范遵循
|
||||
|
||||
✅ **前端开发规范**: 遵循 Vue 3 Composition API 规范
|
||||
✅ **响应式设计**: 使用 computed 实现响应式显示逻辑
|
||||
✅ **代码清洁**: 添加详细注释说明业务逻辑
|
||||
✅ **用户体验**: 条件显示提升界面友好性
|
||||
|
||||
---
|
||||
|
||||
## 🔗 相关文档
|
||||
|
||||
- **前端开发规范**: `.cursor/cursorrules-frontend.md`
|
||||
- **学生信息管理API**: `docs/开发文档/API/学生信息管理API.md`
|
||||
- **项目规范总览**: `.cursor/rules.md`
|
||||
@@ -23,14 +23,14 @@
|
||||
### 1. 性别字段数据不一致问题
|
||||
|
||||
**问题描述**:
|
||||
- 数据库表:`gender char(1) COMMENT '性别(M-男 F-女)'`
|
||||
- 数据库表:`gender char(1) COMMENT '性别(0-男 1-女)'`
|
||||
- 前端原始使用:`sys_user_sex`字典(0-男 1-女 2-未知)
|
||||
- 导致新增时提示"性别必须是F"的错误
|
||||
|
||||
**根本原因**: 前后端性别数据格式不统一
|
||||
|
||||
**修复方案**:
|
||||
- 创建专用字典:`zsjy_gender`(M-男 F-女)
|
||||
- 创建专用字典:`zsjy_gender`(0-男 1-女)
|
||||
- 更新前端页面使用新字典
|
||||
- 修正身份证自动识别输出M/F格式
|
||||
|
||||
@@ -105,7 +105,7 @@ form.value.gender = genderCode % 2 === 1 ? 'M' : 'F';
|
||||
| `id` | bigint(20) | NOT NULL | 主键ID | ✅ 正常 |
|
||||
| `name` | varchar(50) | NOT NULL | 姓名 | ✅ 正常 |
|
||||
| `id_card` | varchar(18) | NOT NULL | 身份证号 | ✅ 正常 |
|
||||
| `gender` | char(1) | NOT NULL | 性别(M-男 F-女) | ✅ 已修复 |
|
||||
| `gender` | char(1) | NOT NULL | 性别(0-男 1-女) | ✅ 已修复 |
|
||||
| `is_boarding` | tinyint(1) | DEFAULT 0 | 是否住校(0-否 1-是) | ✅ 正常 |
|
||||
| `birth_date` | date | NULL | 出生年月 | ✅ 正常 |
|
||||
| `phone1` | varchar(20) | NOT NULL | 联系手机号码1 | ✅ 正常 |
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
### 1. 性别字段显示问题
|
||||
|
||||
**问题描述**:
|
||||
- 数据库表定义:`gender char(1) COMMENT '性别(M-男 F-女)'`
|
||||
- 数据库表定义:`gender char(1) COMMENT '性别(0-男 1-女)'`
|
||||
- 前端使用:`zsjy_gender`字典
|
||||
- 但字典数据标签值可能被改动或未正确配置,导致显示代码而非文字
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
# 代码调整记录 - 2025-07-24 - Cursor
|
||||
|
||||
## 📋 调整概览
|
||||
- **调整日期**: 2025-07-24 10:30:00
|
||||
- **调整人员**: Cursor AI
|
||||
- **调整模块**: 系统管理 - 用户信息管理
|
||||
- **调整类型**: 功能增强
|
||||
|
||||
---
|
||||
|
||||
## 🎯 本次调整
|
||||
|
||||
### 1. 用户信息更新同步学生信息功能
|
||||
**文件**: `backend/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java`
|
||||
|
||||
#### 调整内容
|
||||
1. **导入新增**:
|
||||
- 添加 `JdbcTemplate` 相关导入
|
||||
- 添加 `@Autowired` 注解导入
|
||||
|
||||
2. **依赖注入**:
|
||||
```java
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
```
|
||||
|
||||
3. **方法增强**: `updateUserProfile()` 方法
|
||||
- 添加 `@Transactional` 事务控制
|
||||
- 新增学生信息同步逻辑
|
||||
- 当 `accountType = "2"` 时自动更新 `xg_student_msg` 表
|
||||
|
||||
#### 实现逻辑
|
||||
```java
|
||||
// 判断账号类型为学生(accountType = "2")时,同步更新学生信息表
|
||||
if ("2".equals(user.getAccountType()) && result > 0) {
|
||||
try {
|
||||
String updateSql = "UPDATE xg_student_msg SET " +
|
||||
"name = ?, email = ?, gender = ?, phone = ?, update_time = NOW() " +
|
||||
"WHERE id = ? AND deleted = 0";
|
||||
|
||||
jdbcTemplate.update(updateSql,
|
||||
user.getNickName(), // 昵称对应学生姓名
|
||||
user.getEmail(), // 邮箱
|
||||
user.getSex(), // 性别
|
||||
user.getPhonenumber(), // 手机号
|
||||
user.getUserId() // 用户ID对应学生ID
|
||||
);
|
||||
} catch (Exception e) {
|
||||
// 异常处理和日志记录
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 字段映射关系
|
||||
| 用户表字段 | 学生表字段 | 说明 |
|
||||
|-----------|-----------|------|
|
||||
| `nickName` | `name` | 用户昵称 → 学生姓名 |
|
||||
| `email` | `email` | 邮箱地址 |
|
||||
| `sex` | `gender` | 性别信息 |
|
||||
| `phonenumber` | `phone` | 手机号码 |
|
||||
| `userId` | `id` | 用户ID → 学生ID |
|
||||
|
||||
---
|
||||
|
||||
## ✅ 功能特性
|
||||
|
||||
### 🔐 安全控制
|
||||
- ✅ **条件判断**: 仅当 `accountType = "2"` 时执行同步
|
||||
- ✅ **事务控制**: 确保数据一致性
|
||||
- ✅ **异常隔离**: 学生信息更新失败不影响用户信息更新
|
||||
|
||||
### 📊 数据同步
|
||||
- ✅ **实时同步**: 用户信息更新时自动同步学生信息
|
||||
- ✅ **逻辑删除**: 仅更新未删除的学生记录 (`deleted = 0`)
|
||||
- ✅ **时间戳**: 自动更新修改时间
|
||||
|
||||
### 📝 操作日志
|
||||
- ✅ **成功日志**: 记录同步成功信息
|
||||
- ✅ **错误日志**: 记录同步失败详情
|
||||
- ✅ **用户ID**: 便于问题排查
|
||||
|
||||
---
|
||||
|
||||
## 🧪 测试建议
|
||||
|
||||
### 测试场景
|
||||
1. **正常场景**: 学生用户(`accountType = "2"`)更新个人信息
|
||||
2. **条件验证**: 非学生用户更新信息时不触发同步
|
||||
3. **异常处理**: 学生表不存在对应记录时的处理
|
||||
4. **事务验证**: 确保同步失败时不影响用户信息更新
|
||||
|
||||
### 测试数据
|
||||
```sql
|
||||
-- 测试用户数据 (accountType = "2")
|
||||
UPDATE sys_user SET account_type = '2' WHERE user_id = 123;
|
||||
|
||||
-- 对应学生数据
|
||||
SELECT * FROM xg_student_msg WHERE id = 123;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📖 相关文档
|
||||
|
||||
### 更新的文档
|
||||
- 需要更新: API文档 - 用户信息管理部分
|
||||
- 需要更新: 学生信息管理相关文档
|
||||
|
||||
### 参考规范
|
||||
- 数据库规范: `docs/设计文档/database/mysql-database-standard.md`
|
||||
- 后端开发规范: `.cursor/cursorrules-backend.md`
|
||||
|
||||
---
|
||||
|
||||
## 🔄 后续计划
|
||||
|
||||
### 优化建议
|
||||
1. **性能优化**: 考虑批量更新场景的优化
|
||||
2. **监控告警**: 添加同步失败的监控机制
|
||||
3. **配置化**: 将同步逻辑配置化,支持开关控制
|
||||
|
||||
### 扩展功能
|
||||
1. **双向同步**: 考虑学生信息更新时反向同步用户信息
|
||||
2. **字段扩展**: 支持更多字段的自动同步
|
||||
3. **异步同步**: 对于非关键更新采用异步同步机制
|
||||
|
||||
---
|
||||
|
||||
**✅ 调整状态**: 已完成
|
||||
**🔍 验证状态**: 待测试
|
||||
**📝 文档状态**: 已记录
|
||||
@@ -74,7 +74,7 @@ public TableDataInfo<ZsjyEnrollmentProcessVo> queryPageList(ZsjyEnrollmentProces
|
||||
|
||||
```java
|
||||
/**
|
||||
* 性别(M-男 F-女)- 从enrollment_info表获取
|
||||
* 性别(0-男 1-女)- 从enrollment_info表获取
|
||||
*/
|
||||
private String gender;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
| studentNo | string | 否 | 学号 |
|
||||
| name | string | 否 | 姓名(模糊查询) |
|
||||
| idCard | string | 否 | 身份证号 |
|
||||
| gender | string | 否 | 性别:M-男,F-女 |
|
||||
| gender | string | 否 | 性别:0-男,1-女 |
|
||||
| studentStatus | string | 否 | 学籍状态 |
|
||||
| enrollmentYear | integer | 否 | 入学年份 |
|
||||
| majorCode | string | 否 | 专业代码 |
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
| pageSize | Integer | 是 | 每页记录数 |
|
||||
| name | String | 否 | 姓名,支持模糊查询 |
|
||||
| idCard | String | 否 | 身份证号 |
|
||||
| gender | String | 否 | 性别(M-男 F-女) |
|
||||
| gender | String | 否 | 性别(0-男 1-女) |
|
||||
| examNumber | String | 否 | 准考证号 |
|
||||
| phone1 | String | 否 | 联系电话 |
|
||||
| examRegion | String | 否 | 中考地区 |
|
||||
@@ -67,7 +67,7 @@
|
||||
| id | Long | 主键ID |
|
||||
| name | String | 姓名 |
|
||||
| idCard | String | 身份证号 |
|
||||
| gender | String | 性别(M-男 F-女) |
|
||||
| gender | String | 性别(0-男 1-女) |
|
||||
| phone1 | String | 联系电话 |
|
||||
| examNumber | String | 准考证号 |
|
||||
| examRegion | String | 中考地区 |
|
||||
@@ -99,7 +99,7 @@
|
||||
| id | Long | 主键ID |
|
||||
| name | String | 姓名 |
|
||||
| idCard | String | 身份证号 |
|
||||
| gender | String | 性别(M-男 F-女) |
|
||||
| gender | String | 性别(0-男 1-女) |
|
||||
| isBoarding | Integer | 是否住校(0-否 1-是) |
|
||||
| birthDate | Date | 出生年月 |
|
||||
| phone1 | String | 联系电话1 |
|
||||
@@ -141,7 +141,7 @@
|
||||
|---------|--------|---------|-----|
|
||||
| name | String | 是 | 姓名 |
|
||||
| idCard | String | 是 | 身份证号 |
|
||||
| gender | String | 是 | 性别(M-男 F-女) |
|
||||
| gender | String | 是 | 性别(0-男 1-女) |
|
||||
| isBoarding | Integer | 否 | 是否住校(0-否 1-是) |
|
||||
| birthDate | Date | 否 | 出生年月 |
|
||||
| phone1 | String | 是 | 联系电话1 |
|
||||
@@ -190,7 +190,7 @@
|
||||
| id | Long | 是 | 主键ID |
|
||||
| name | String | 是 | 姓名 |
|
||||
| idCard | String | 是 | 身份证号 |
|
||||
| gender | String | 是 | 性别(M-男 F-女) |
|
||||
| gender | String | 是 | 性别(0-男 1-女) |
|
||||
| isBoarding | Integer | 否 | 是否住校(0-否 1-是) |
|
||||
| birthDate | Date | 否 | 出生年月 |
|
||||
| phone1 | String | 是 | 联系电话1 |
|
||||
|
||||
@@ -37,7 +37,7 @@ public class EnrollmentInfoVo {
|
||||
private Long id; // 主键ID
|
||||
private String name; // 姓名
|
||||
private String idCard; // 身份证号
|
||||
private String gender; // 性别(M-男 F-女)
|
||||
private String gender; // 性别(0-男 1-女)
|
||||
private Boolean isBoarding; // 是否住校
|
||||
private Date birthDate; // 出生日期
|
||||
private String phone1; // 联系手机号码1
|
||||
|
||||
@@ -29,7 +29,7 @@ CREATE TABLE `xg_student_info` (
|
||||
-- 基本信息
|
||||
`student_id` varchar(32) NOT NULL COMMENT '学号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:M-男,F-女',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:0-男,1-女',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`nation` varchar(20) DEFAULT NULL COMMENT '民族',
|
||||
|
||||
@@ -35,7 +35,7 @@ CREATE TABLE `xg_student_info` (
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`name_pinyin` varchar(200) DEFAULT NULL COMMENT '姓名拼音',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:M-男,F-女',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:0-男,1-女',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`nation` varchar(20) DEFAULT NULL COMMENT '民族',
|
||||
`political_status` varchar(20) DEFAULT NULL COMMENT '政治面貌',
|
||||
|
||||
@@ -180,7 +180,7 @@ CREATE TABLE `xg_student_info` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID',
|
||||
`student_no` varchar(32) NOT NULL COMMENT '学号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`gender` char(1) DEFAULT NULL COMMENT '性别:M-男,F-女',
|
||||
`gender` char(1) DEFAULT NULL COMMENT '性别:0-男,1-女',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`nation` varchar(20) DEFAULT NULL COMMENT '民族',
|
||||
|
||||
@@ -182,7 +182,7 @@ CREATE TABLE IF NOT EXISTS `xg_student_info` (
|
||||
`id_card` varchar(18) DEFAULT NULL COMMENT '身份证号',
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`name_pinyin` varchar(200) DEFAULT NULL COMMENT '姓名拼音',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:M-男,F-女',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:0-男,1-女',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`nation` varchar(20) DEFAULT NULL COMMENT '民族',
|
||||
`political_status` varchar(20) DEFAULT NULL COMMENT '政治面貌',
|
||||
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE `xg_student_info` (
|
||||
`name_english` varchar(100) DEFAULT NULL COMMENT '英文姓名',
|
||||
`former_name` varchar(50) DEFAULT NULL COMMENT '曾用名',
|
||||
`name_pinyin` varchar(200) DEFAULT NULL COMMENT '姓名拼音',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:M-男,F-女',
|
||||
`gender` char(1) NOT NULL COMMENT '性别:0-男,1-女',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生日期',
|
||||
`nation` varchar(20) DEFAULT NULL COMMENT '民族',
|
||||
`political_status` varchar(20) DEFAULT NULL COMMENT '政治面貌',
|
||||
|
||||
@@ -39,6 +39,7 @@ CREATE TABLE `xg_class_msg` (
|
||||
`class_type` varchar(20) DEFAULT '1' COMMENT '班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体',
|
||||
`grade` varchar(10) NOT NULL COMMENT '年级',
|
||||
`enrollment_year` int(4) NOT NULL COMMENT '入学年份',
|
||||
`school_system` int(2) DEFAULT '4' COMMENT '学制(年)',
|
||||
`graduation_year` int(4) DEFAULT NULL COMMENT '毕业年份',
|
||||
`training_type` varchar(20) DEFAULT NULL COMMENT '培养方式:全日制,在职,函授,夜大等',
|
||||
`degree_type` varchar(20) DEFAULT NULL COMMENT '学位类型:学士,硕士,博士,专科',
|
||||
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE `zsjy_enrollment_info` (
|
||||
-- 基本信息
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`id_card` varchar(18) NOT NULL COMMENT '身份证号',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(M-男 F-女)',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(0-男 1-女)',
|
||||
`is_boarding` tinyint(1) DEFAULT 0 COMMENT '是否住校(0-否 1-是)',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生年月',
|
||||
`phone1` varchar(20) NOT NULL COMMENT '联系手机号码1',
|
||||
|
||||
@@ -31,7 +31,7 @@ CREATE TABLE `zsjy_enrollment_info` (
|
||||
-- 基本信息
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`id_card` varchar(18) NOT NULL COMMENT '身份证号',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(M-男 F-女)',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(0-男 1-女)',
|
||||
`is_boarding` tinyint(1) DEFAULT 0 COMMENT '是否住校(0-否 1-是)',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生年月',
|
||||
`phone1` varchar(20) NOT NULL COMMENT '联系手机号码1',
|
||||
|
||||
@@ -48,7 +48,7 @@ CREATE TABLE `zsjy_enrollment_info` (
|
||||
-- 基本信息
|
||||
`name` varchar(50) NOT NULL COMMENT '姓名',
|
||||
`id_card` varchar(18) NOT NULL COMMENT '身份证号',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(M-男 F-女)',
|
||||
`gender` char(1) NOT NULL COMMENT '性别(0-男 1-女)',
|
||||
`is_boarding` tinyint(1) DEFAULT 0 COMMENT '是否住校(0-否 1-是)',
|
||||
`birth_date` date DEFAULT NULL COMMENT '出生年月',
|
||||
`phone1` varchar(20) NOT NULL COMMENT '联系手机号码1',
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
org.dromara.web.domain.vo.TenantListVo
|
||||
org.dromara.test.domain.vo.XgStuMsgVo
|
||||
org.dromara.zsjy.domain.vo.ZsjyEnrollmentProcessVo
|
||||
org.dromara.zsjy.domain.bo.ZsjyEnrollmentInfoBo
|
||||
org.dromara.zsjy.domain.vo.ZsjyEnrollmentInfoVo
|
||||
org.dromara.zsjy.domain.bo.ZsjyEnrollmentProcessBo
|
||||
org.dromara.test.domain.bo.XgStuMsgBo
|
||||
@@ -1 +0,0 @@
|
||||
org.dromara.system.domain.bo.SysOperLogBo
|
||||
@@ -1,11 +0,0 @@
|
||||
org.dromara.test.domain.vo.XgStuMsgVoToXgStuMsgMapper
|
||||
org.dromara.web.domain.vo.TenantListVoToSysTenantVoMapper
|
||||
org.dromara.zsjy.domain.vo.ZsjyEnrollmentInfoVoToZsjyEnrollmentInfoMapper
|
||||
org.dromara.zsjy.domain.ZsjyEnrollmentInfoToZsjyEnrollmentInfoVoMapper
|
||||
org.dromara.zsjy.domain.bo.ZsjyEnrollmentProcessBoToZsjyEnrollmentProcessMapper
|
||||
org.dromara.zsjy.domain.ZsjyEnrollmentProcessToZsjyEnrollmentProcessVoMapper
|
||||
org.dromara.zsjy.domain.vo.ZsjyEnrollmentProcessVoToZsjyEnrollmentProcessMapper
|
||||
org.dromara.zsjy.domain.bo.ZsjyEnrollmentInfoBoToZsjyEnrollmentInfoMapper
|
||||
org.dromara.system.domain.vo.SysTenantVoToTenantListVoMapper
|
||||
org.dromara.test.domain.XgStuMsgToXgStuMsgVoMapper
|
||||
org.dromara.test.domain.bo.XgStuMsgBoToXgStuMsgMapper
|
||||
@@ -152,6 +152,8 @@ export interface ClassMsgVO {
|
||||
lastCountUpdate?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 学制 */
|
||||
schoolSystem?: string;
|
||||
}
|
||||
|
||||
/** 班级表单数据 */
|
||||
|
||||
@@ -227,7 +227,7 @@ const mockStudentData: StudentVO[] = [
|
||||
classId: 101,
|
||||
className: '计算机2001班',
|
||||
address: '北京市海淀区',
|
||||
status: '0',
|
||||
studentStatus: '1',
|
||||
createTime: '2023-01-01 10:00:00',
|
||||
remark: ''
|
||||
},
|
||||
@@ -248,7 +248,7 @@ const mockStudentData: StudentVO[] = [
|
||||
classId: 101,
|
||||
className: '计算机2001班',
|
||||
address: '上海市浦东新区',
|
||||
status: '0',
|
||||
studentStatus: '2',
|
||||
createTime: '2023-01-01 10:10:00',
|
||||
remark: ''
|
||||
},
|
||||
@@ -269,7 +269,7 @@ const mockStudentData: StudentVO[] = [
|
||||
classId: 201,
|
||||
className: '软工2001班',
|
||||
address: '广州市天河区',
|
||||
status: '0',
|
||||
studentStatus: '5',
|
||||
createTime: '2023-01-02 09:00:00',
|
||||
remark: ''
|
||||
},
|
||||
@@ -290,7 +290,7 @@ const mockStudentData: StudentVO[] = [
|
||||
classId: 201,
|
||||
className: '软工2001班',
|
||||
address: '深圳市南山区',
|
||||
status: '0',
|
||||
studentStatus: '3',
|
||||
createTime: '2023-01-02 10:30:00',
|
||||
remark: ''
|
||||
},
|
||||
@@ -311,7 +311,7 @@ const mockStudentData: StudentVO[] = [
|
||||
classId: 301,
|
||||
className: '人工智能2001班',
|
||||
address: '杭州市西湖区',
|
||||
status: '1', // 停用状态
|
||||
studentStatus: '4',
|
||||
createTime: '2023-01-03 11:20:00',
|
||||
remark: '休学中'
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export interface StudentMsgVO {
|
||||
formerName: string;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
@@ -558,7 +558,7 @@ export interface StudentMsgForm extends BaseEntity {
|
||||
formerName?: string;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
@@ -940,7 +940,7 @@ export interface StudentMsgForm extends BaseEntity {
|
||||
/**
|
||||
* 学历层次 - 预留,数据从班级表关联
|
||||
*/
|
||||
academicLevel?: string;
|
||||
academicLevel?: string | number;
|
||||
|
||||
/**
|
||||
* 培养方式:全日制、在职、函授、夜大等 - 预留,数据从班级表关联
|
||||
@@ -1077,7 +1077,7 @@ export interface StudentMsgQuery extends PageQuery {
|
||||
formerName?: string;
|
||||
|
||||
/**
|
||||
* 性别:M-男,F-女
|
||||
* 性别:0-男,1-女
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
|
||||
@@ -14,32 +14,32 @@ export interface XgDeptTreeVO extends BaseEntity {
|
||||
export interface StudentQuery {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
studentName?: string;
|
||||
name?: string;
|
||||
studentNo?: string;
|
||||
phonenumber?: string;
|
||||
status?: string;
|
||||
phone?: string;
|
||||
studentStatus?: string;
|
||||
deptId?: number;
|
||||
}
|
||||
|
||||
// 学生视图对象
|
||||
export interface StudentVO {
|
||||
studentId: number | string;
|
||||
id: number | string;
|
||||
studentNo: string;
|
||||
studentName: string;
|
||||
name: string;
|
||||
nickName?: string;
|
||||
sex?: string;
|
||||
gender?: string;
|
||||
age?: number;
|
||||
phonenumber?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
idCard?: string;
|
||||
deptId?: number;
|
||||
deptName?: string;
|
||||
collegeId?: number;
|
||||
colegeName?: string;
|
||||
majorId?: number;
|
||||
majorName?: string;
|
||||
classId?: number;
|
||||
className?: string;
|
||||
address?: string;
|
||||
status?: string;
|
||||
studentStatus?: string;
|
||||
createBy?: number;
|
||||
createTime?: string;
|
||||
updateBy?: number;
|
||||
@@ -49,6 +49,7 @@ export interface StudentVO {
|
||||
|
||||
// 学生表单对象
|
||||
export interface StudentForm {
|
||||
id?: number | string;
|
||||
// 原有字段
|
||||
studentId?: number | string;
|
||||
deptId?: number;
|
||||
@@ -129,8 +130,8 @@ export interface StudentForm {
|
||||
family_members?: string;
|
||||
|
||||
// 健康信息字段
|
||||
height?: string;
|
||||
weight?: string;
|
||||
height?: number | string;
|
||||
weight?: number | string;
|
||||
blood_type?: string;
|
||||
health_status?: string;
|
||||
special_condition?: string;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { SysRegionVO, SysRegionForm, SysRegionQuery } from '@/api/system/SysRegion/types';
|
||||
|
||||
/**
|
||||
* 查询行政区划列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listSysRegion = (query?: SysRegionQuery): AxiosPromise<SysRegionVO[]> => {
|
||||
return request({
|
||||
url: '/system/SysRegion/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询行政区划详细
|
||||
* @param id
|
||||
*/
|
||||
export const getSysRegion = (id: string | number): AxiosPromise<SysRegionVO> => {
|
||||
return request({
|
||||
url: '/system/SysRegion/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增行政区划
|
||||
* @param data
|
||||
*/
|
||||
export const addSysRegion = (data: SysRegionForm) => {
|
||||
return request({
|
||||
url: '/system/SysRegion',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改行政区划
|
||||
* @param data
|
||||
*/
|
||||
export const updateSysRegion = (data: SysRegionForm) => {
|
||||
return request({
|
||||
url: '/system/SysRegion',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除行政区划
|
||||
* @param id
|
||||
*/
|
||||
export const delSysRegion = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/system/SysRegion/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,186 @@
|
||||
export interface SysRegionVO {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
code: string;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
shortName: string;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
parentCode: number;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
level: number;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
longitude: number;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
latitude: number;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
deleted: number;
|
||||
|
||||
}
|
||||
|
||||
export interface SysRegionForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
shortName?: string;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
parentCode?: number;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
level?: number;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
longitude?: number;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
latitude?: number;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface SysRegionQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 行政区划编码
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
/**
|
||||
* 行政区划名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 行政区划简称
|
||||
*/
|
||||
shortName?: string;
|
||||
|
||||
/**
|
||||
* 父级行政区划编码,顶级为0
|
||||
*/
|
||||
parentCode?: number;
|
||||
|
||||
/**
|
||||
* 层级(1:省,2:市,3:区/县,4:街道/镇)
|
||||
*/
|
||||
level?: number;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
sort?: number;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
status?: string;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
longitude?: number;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
latitude?: number;
|
||||
|
||||
/**
|
||||
* 逻辑删除标识(0未删除 1已删除)
|
||||
*/
|
||||
deleted?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ export interface UserVO extends BaseEntity {
|
||||
postIds: any;
|
||||
roleId: any;
|
||||
admin: boolean;
|
||||
accountType: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -236,7 +236,7 @@ export interface XljkEvaluationDetailVO {
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
* 性别(0-男,1-女)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
@@ -328,7 +328,7 @@ export interface XljkEvaluationDetailForm extends BaseEntity {
|
||||
studentName?: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
* 性别(0-男,1-女)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
@@ -407,7 +407,7 @@ export interface StudentInfo {
|
||||
studentName: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男,F-女)
|
||||
* 性别(0-男,1-女)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface EnrollmentInfoVO {
|
||||
idCard: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
gender: string;
|
||||
|
||||
@@ -197,7 +197,7 @@ export interface EnrollmentInfoForm extends BaseEntity {
|
||||
idCard?: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
@@ -354,7 +354,7 @@ export interface EnrollmentInfoQuery extends PageQuery {
|
||||
idCard?: string;
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
gender?: string;
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ export interface EnrollmentProcessVO {
|
||||
updateTime: string
|
||||
|
||||
/**
|
||||
* 性别(M-男 F-女)
|
||||
* 性别(0-男 1-女)
|
||||
*/
|
||||
gender?: string
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<el-table-column label="辅导员" align="center" prop="counselorName" />
|
||||
<el-table-column label="年级" align="center" prop="grade" />
|
||||
<el-table-column label="入学年份" align="center" prop="enrollmentYear" />
|
||||
<el-table-column label="学制(年)" align="center" prop="schoolSystem" />
|
||||
<el-table-column label="毕业年份" align="center" prop="graduationYear" />
|
||||
<el-table-column label="班级状态" align="center" prop="classStatus">
|
||||
<template #default="scope">
|
||||
@@ -156,8 +157,8 @@
|
||||
<el-form-item label="班级名称" prop="className">
|
||||
<el-input v-model="form.className" placeholder="请输入班级名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班级类型" prop="classType">
|
||||
<el-select v-model="form.classType" placeholder="请选择班级类型" style="width: 100%">
|
||||
<el-form-item label="学历层级" prop="classType">
|
||||
<el-select v-model="form.classType" placeholder="请选择学历层级" style="width: 100%">
|
||||
<el-option label="中级工" :value="1" />
|
||||
<el-option label="高级工" :value="2" />
|
||||
<el-option label="预备技师" :value="3" />
|
||||
@@ -171,6 +172,9 @@
|
||||
<el-form-item label="入学年份" prop="enrollmentYear">
|
||||
<el-input v-model="form.enrollmentYear" placeholder="请输入入学年份" />
|
||||
</el-form-item>
|
||||
<el-form-item label="学制(年)" prop="schoolSystem">
|
||||
<el-input v-model="form.schoolSystem" placeholder="请输入学制(年)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="毕业年份" prop="graduationYear">
|
||||
<el-input v-model="form.graduationYear" placeholder="请输入毕业年份" />
|
||||
</el-form-item>
|
||||
@@ -457,6 +461,7 @@ const initFormData: ClassMsgForm = {
|
||||
classType: undefined,
|
||||
grade: undefined,
|
||||
enrollmentYear: undefined,
|
||||
schoolSystem: undefined,
|
||||
graduationYear: undefined,
|
||||
trainingType: undefined,
|
||||
degreeType: undefined,
|
||||
@@ -514,7 +519,12 @@ const data = reactive<PageData<ClassMsgForm, ClassMsgQuery>>({
|
||||
classCode: [{ required: true, message: '班级代码不能为空', trigger: 'blur' }],
|
||||
className: [{ required: true, message: '班级名称不能为空', trigger: 'blur' }],
|
||||
grade: [{ required: true, message: '年级不能为空', trigger: 'blur' }],
|
||||
enrollmentYear: [{ required: true, message: '入学年份不能为空', trigger: 'blur' }]
|
||||
enrollmentYear: [{ required: true, message: '入学年份不能为空', trigger: 'blur' }],
|
||||
majorId: [{ required: true, message: '专业不能为空', trigger: 'blur' }],
|
||||
classType: [{ required: true, message: '学历层级不能为空', trigger: 'blur' }],
|
||||
schoolSystem: [{ required: true, message: '学制(年)不能为空', trigger: 'blur' }],
|
||||
graduationYear: [{ required: true, message: '毕业年份不能为空', trigger: 'blur' }],
|
||||
collegeId: [{ required: true, message: '学院不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ async function fetchCustomAdminsWithScope() {
|
||||
for (const admin of customAdmins.value) {
|
||||
try {
|
||||
const res = await service({
|
||||
url: '/xgStudentManagerSource/studentManagerSource//authSourceNames',
|
||||
url: '/xgStudentManagerSource/studentManagerSource/authSourceNames',
|
||||
method: 'get',
|
||||
params: { managerId: admin.id }
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -2,7 +2,7 @@
|
||||
<div class="p-2">
|
||||
<div style="display: flex; gap: 16px">
|
||||
<!-- 部门树 -->
|
||||
<div style="width: 300px">
|
||||
<div style="width: 360px">
|
||||
<el-card shadow="hover">
|
||||
<el-input v-model="deptName" placeholder="请输入部门名称" prefix-icon="Search" clearable />
|
||||
<el-tree
|
||||
@@ -10,7 +10,7 @@
|
||||
class="mt-2 dept-tree"
|
||||
node-key="id"
|
||||
:data="deptOptions"
|
||||
:props="{ label: 'label', children: 'children' } as any"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
highlight-current
|
||||
@@ -66,10 +66,14 @@
|
||||
<el-button v-has-permi="['system:user:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-has-permi="['system:user:edit']" :disabled="single" icon="Edit" @click="handleUpdate()"> 修改 </el-button>
|
||||
<el-button v-has-permi="['system:user:edit']" :disabled="single || isSelectedStudentUser" icon="Edit" @click="handleUpdate()">
|
||||
修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-has-permi="['system:user:remove']" :disabled="multiple" icon="Delete" @click="handleDelete()"> 删除 </el-button>
|
||||
<el-button v-has-permi="['system:user:remove']" :disabled="multiple || hasSelectedStudentUser" icon="Delete" @click="handleDelete()">
|
||||
删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-dropdown class="mt-[1px]">
|
||||
@@ -100,7 +104,13 @@
|
||||
<el-table-column v-if="columns[4].visible" key="phonenumber" label="手机号码" align="center" prop="phonenumber" width="120" />
|
||||
<el-table-column v-if="columns[5].visible" key="status" label="状态" align="center">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
:disabled="scope.row.accountType === '2'"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -112,10 +122,10 @@
|
||||
|
||||
<el-table-column label="操作" fixed="right" width="280" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip v-if="scope.row.userId !== 1" content="修改" placement="top">
|
||||
<el-tooltip v-if="scope.row.userId !== 1 && scope.row.accountType !== '2'" content="修改" placement="top">
|
||||
<el-button v-hasPermi="['system:user:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="scope.row.userId !== 1" content="删除" placement="top">
|
||||
<el-tooltip v-if="scope.row.userId !== 1 && scope.row.accountType !== '2'" content="删除" placement="top">
|
||||
<el-button v-hasPermi="['system:user:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
@@ -126,6 +136,11 @@
|
||||
<el-tooltip v-if="scope.row.userId !== 1" content="分配角色" placement="top">
|
||||
<el-button v-hasPermi="['system:user:edit']" link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)"></el-button>
|
||||
</el-tooltip>
|
||||
|
||||
<!-- 学生用户显示提示信息 -->
|
||||
<el-tooltip v-if="scope.row.accountType === '2'" content="学生用户不允许操作" placement="top">
|
||||
<span class="text-gray-400">学生用户</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -155,7 +170,7 @@
|
||||
<el-tree-select
|
||||
v-model="form.deptId"
|
||||
:data="enabledDeptOptions"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' } as any"
|
||||
:props="{ value: 'id', label: 'label', children: 'children' }"
|
||||
value-key="id"
|
||||
placeholder="请选择归属部门"
|
||||
check-strictly
|
||||
@@ -316,6 +331,20 @@ const enabledDeptOptions = ref<DeptTreeVO[]>([]);
|
||||
const initPassword = ref<string>('');
|
||||
const postOptions = ref<PostVO[]>([]);
|
||||
const roleOptions = ref<RoleVO[]>([]);
|
||||
|
||||
// 选中的用户相关计算属性
|
||||
const selectedUsers = ref<UserVO[]>([]);
|
||||
|
||||
// 计算属性:是否选中了学生用户
|
||||
const isSelectedStudentUser = computed(() => {
|
||||
return selectedUsers.value.length === 1 && selectedUsers.value[0].accountType === '2';
|
||||
});
|
||||
|
||||
// 计算属性:选中的用户中是否包含学生用户
|
||||
const hasSelectedStudentUser = computed(() => {
|
||||
return selectedUsers.value.some((user) => user.accountType === '2');
|
||||
});
|
||||
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive<ImportOption>({
|
||||
// 是否显示弹出层(用户导入)
|
||||
@@ -489,6 +518,19 @@ const resetQuery = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: UserVO) => {
|
||||
const userIds = row?.userId || ids.value;
|
||||
|
||||
// 检查是否是学生用户
|
||||
if (row && row.accountType === '2') {
|
||||
proxy?.$modal.msgError('学生用户不允许删除操作');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查批量删除时是否包含学生用户
|
||||
if (!row && hasSelectedStudentUser.value) {
|
||||
proxy?.$modal.msgError('选中的用户中包含学生用户,不允许删除操作');
|
||||
return;
|
||||
}
|
||||
|
||||
const [err] = await to(proxy?.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?') as any);
|
||||
if (!err) {
|
||||
await api.delUser(userIds);
|
||||
@@ -499,6 +541,14 @@ const handleDelete = async (row?: UserVO) => {
|
||||
|
||||
/** 用户状态修改 */
|
||||
const handleStatusChange = async (row: UserVO) => {
|
||||
// 检查是否是学生用户
|
||||
if (row.accountType === '2') {
|
||||
// 恢复原状态
|
||||
row.status = row.status === '0' ? '1' : '0';
|
||||
proxy?.$modal.msgError('学生用户不允许修改状态');
|
||||
return;
|
||||
}
|
||||
|
||||
const text = row.status === '0' ? '启用' : '停用';
|
||||
try {
|
||||
await proxy?.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?');
|
||||
@@ -510,12 +560,24 @@ const handleStatusChange = async (row: UserVO) => {
|
||||
};
|
||||
/** 跳转角色分配 */
|
||||
const handleAuthRole = (row: UserVO) => {
|
||||
// 检查是否是学生用户
|
||||
// if (row.accountType === '2') {
|
||||
// proxy?.$modal.msgError('学生用户不允许分配角色操作');
|
||||
// return;
|
||||
// }
|
||||
|
||||
const userId = row.userId;
|
||||
router.push('/system/user-auth/role/' + userId);
|
||||
};
|
||||
|
||||
/** 重置密码按钮操作 */
|
||||
const handleResetPwd = async (row: UserVO) => {
|
||||
// 检查是否是学生用户
|
||||
// if (row.accountType === '2') {
|
||||
// proxy?.$modal.msgError('学生用户不允许重置密码操作');
|
||||
// return;
|
||||
// }
|
||||
|
||||
const [err, res] = await to(
|
||||
ElMessageBox.prompt('请输入"' + row.userName + '"的新密码', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -538,6 +600,7 @@ const handleResetPwd = async (row: UserVO) => {
|
||||
|
||||
/** 选择条数 */
|
||||
const handleSelectionChange = (selection: UserVO[]) => {
|
||||
selectedUsers.value = selection;
|
||||
ids.value = selection.map((item) => item.userId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
@@ -607,6 +670,18 @@ const handleAdd = async () => {
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: UserForm) => {
|
||||
// 检查是否是学生用户
|
||||
if (row && (row as UserVO).accountType === '2') {
|
||||
proxy?.$modal.msgError('学生用户不允许修改操作');
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查选中的用户是否是学生用户
|
||||
if (!row && isSelectedStudentUser.value) {
|
||||
proxy?.$modal.msgError('学生用户不允许修改操作');
|
||||
return;
|
||||
}
|
||||
|
||||
reset();
|
||||
const userId = row?.userId || ids.value[0];
|
||||
const { data } = await api.getUser(userId);
|
||||
@@ -671,24 +746,30 @@ async function handleDeptChange(value: number | string) {
|
||||
height: 600px;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
width: 270px; /* 固定宽度,超出时显示滚动条 */
|
||||
min-width: 270px;
|
||||
width: 330px; /* 固定宽度,超出时显示滚动条 */
|
||||
min-width: 330px;
|
||||
}
|
||||
|
||||
/* 强制覆盖el-tree的默认样式 */
|
||||
.dept-tree :deep(.el-tree-node) {
|
||||
white-space: nowrap !important;
|
||||
width: max-content !important;
|
||||
min-width: max-content !important;
|
||||
width: 100% !important;
|
||||
min-width: 300px !important;
|
||||
}
|
||||
|
||||
.dept-tree :deep(.el-tree-node__content) {
|
||||
white-space: nowrap !important;
|
||||
min-width: max-content !important;
|
||||
width: max-content !important;
|
||||
width: 100% !important;
|
||||
min-width: 300px !important;
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important; /* 移除省略号 */
|
||||
max-width: none !important;
|
||||
padding-right: 20px !important; /* 增加右侧内边距,确保hover效果完整显示 */
|
||||
}
|
||||
|
||||
/* 树节点hover效果优化 */
|
||||
.dept-tree :deep(.el-tree-node__content:hover) {
|
||||
background-color: var(--el-tree-node-hover-bg-color, #f5f7fa) !important;
|
||||
}
|
||||
|
||||
.dept-tree :deep(.el-tree-node__label) {
|
||||
@@ -698,7 +779,7 @@ async function handleDeptChange(value: number | string) {
|
||||
max-width: none !important;
|
||||
overflow: visible !important;
|
||||
text-overflow: unset !important; /* 移除省略号效果 */
|
||||
width: max-content !important;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
.dept-tree :deep(.el-tree-node__expand-icon) {
|
||||
@@ -707,10 +788,10 @@ async function handleDeptChange(value: number | string) {
|
||||
|
||||
/* 确保树容器内部元素都不被截断 */
|
||||
.dept-tree :deep(.el-tree-node__children) {
|
||||
width: max-content !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.dept-tree :deep(.el-tree-node > .el-tree-node__children) {
|
||||
width: max-content !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user