From fe787e5772ce4d1b343b7ff2feb427f1d59cecdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=9C=A3=E9=94=8B?= <361882884@qq.com> Date: Sun, 30 Nov 2025 10:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=A2=E6=88=B7=E9=9C=80?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../psychology/PsyUserProfileController.java | 12 + .../src/main/resources/application-druid.yml | 2 +- ry-xinli-admin/src/main/resources/banner.txt | 21 - .../common/core/domain/entity/SysUser.java | 36 +- .../psychology/PsyUserProfileMapper.java | 8 + .../psychology/PsyUserProfileServiceImpl.java | 41 +- .../psychology/IPsyUserProfileService.java | 8 + .../resources/mapper/system/SysUserMapper.xml | 8 +- .../psychology/PsyUserProfileMapper.xml | 85 +++- xinli-ui/src/api/psychology/profile.js | 9 + .../src/views/psychology/assessment/start.vue | 15 +- .../src/views/psychology/permission/user.vue | 2 +- .../src/views/psychology/profile/index.vue | 477 +++++++----------- xinli-ui/src/views/system/role/authUser.vue | 8 +- xinli-ui/src/views/system/role/selectUser.vue | 8 +- xinli-ui/src/views/system/user/authRole.vue | 2 +- xinli-ui/src/views/system/user/index.vue | 59 ++- .../src/views/system/user/profile/index.vue | 6 +- .../views/system/user/profile/userInfo.vue | 4 +- 19 files changed, 412 insertions(+), 399 deletions(-) diff --git a/ry-xinli-admin/src/main/java/com/ddnai/web/controller/psychology/PsyUserProfileController.java b/ry-xinli-admin/src/main/java/com/ddnai/web/controller/psychology/PsyUserProfileController.java index 9d536f74..6fa05e55 100644 --- a/ry-xinli-admin/src/main/java/com/ddnai/web/controller/psychology/PsyUserProfileController.java +++ b/ry-xinli-admin/src/main/java/com/ddnai/web/controller/psychology/PsyUserProfileController.java @@ -187,6 +187,18 @@ public class PsyUserProfileController extends BaseController return getDataTable(list); } + /** + * 获取学员档案列表(仅包含拥有学员角色的用户) + */ + @PreAuthorize("@ss.hasPermi('psychology:profile:list')") + @GetMapping("/student/list") + public TableDataInfo studentList(PsyUserProfile profile) + { + startPage(); + List list = profileService.selectStudentProfileList(profile); + return getDataTable(list); + } + /** * 新增档案 */ diff --git a/ry-xinli-admin/src/main/resources/application-druid.yml b/ry-xinli-admin/src/main/resources/application-druid.yml index 2127354c..6f7ff468 100644 --- a/ry-xinli-admin/src/main/resources/application-druid.yml +++ b/ry-xinli-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://127.0.0.1:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + url: jdbc:mysql://1.15.149.240:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true username: ry_xinli password: ZLZBcfGtsWJe5r4z # 从库数据源 diff --git a/ry-xinli-admin/src/main/resources/banner.txt b/ry-xinli-admin/src/main/resources/banner.txt index 36cee63d..528be7f7 100644 --- a/ry-xinli-admin/src/main/resources/banner.txt +++ b/ry-xinli-admin/src/main/resources/banner.txt @@ -1,24 +1,3 @@ Application Version: ${ruoyi.version} Spring Boot Version: ${spring-boot.version} -//////////////////////////////////////////////////////////////////// -// _ooOoo_ // -// o8888888o // -// 88" . "88 // -// (| ^_^ |) // -// O\ = /O // -// ____/`---'\____ // -// .' \\| |// `. // -// / \\||| : |||// \ // -// / _||||| -:- |||||- \ // -// | | \\\ - /// | | // -// | \_| ''\---/'' | | // -// \ .-\__ `-` ___/-. / // -// ___`. .' /--.--\ `. . ___ // -// ."" '< `.___\_<|>_/___.' >'"". // -// | | : `- \`.;`\ _ /`;.`/ - ` : | | // -// \ \ `-. \_ __\ /__ _/ .-` / / // -// ========`-.____`-.___\_____/___.-`____.-'======== // -// `=---=' // -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // // AI心理健康测评系统 永不宕机 永无BUG // -//////////////////////////////////////////////////////////////////// diff --git a/ry-xinli-common/src/main/java/com/ddnai/common/core/domain/entity/SysUser.java b/ry-xinli-common/src/main/java/com/ddnai/common/core/domain/entity/SysUser.java index c07edb36..70a2469c 100644 --- a/ry-xinli-common/src/main/java/com/ddnai/common/core/domain/entity/SysUser.java +++ b/ry-xinli-common/src/main/java/com/ddnai/common/core/domain/entity/SysUser.java @@ -29,12 +29,12 @@ public class SysUser extends BaseEntity @Excel(name = "部门编号", type = Type.IMPORT) private Long deptId; - /** 用户账号 */ - @Excel(name = "登录名称") + /** 用户账号(信息编号/登录账号) */ + @Excel(name = "信息编号") private String userName; - /** 用户昵称 */ - @Excel(name = "用户名称") + /** 用户真实姓名(罪犯姓名) */ + @Excel(name = "罪犯姓名") private String nickName; /** 用户邮箱 */ @@ -55,6 +55,9 @@ public class SysUser extends BaseEntity /** 密码 */ private String password; + /** 注册类型 */ + private String registerType; + /** 账号状态(0正常 1停用) */ @Excel(name = "账号状态", readConverterExp = "0=正常,1=停用") private String status; @@ -106,10 +109,6 @@ public class SysUser extends BaseEntity @Excel(name = "身份证号") private String idCard; - /** 生日 */ - @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") - private Date birthday; - /** 学历 */ @Excel(name = "学历") private String education; @@ -171,6 +170,7 @@ public class SysUser extends BaseEntity } @Xss(message = "用户昵称不能包含脚本字符") + @NotBlank(message = "姓名不能为空") @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") public String getNickName() { @@ -248,6 +248,16 @@ public class SysUser extends BaseEntity this.password = password; } + public String getRegisterType() + { + return registerType; + } + + public void setRegisterType(String registerType) + { + this.registerType = registerType; + } + public String getStatus() { return status; @@ -380,16 +390,6 @@ public class SysUser extends BaseEntity this.idCard = idCard; } - public Date getBirthday() - { - return birthday; - } - - public void setBirthday(Date birthday) - { - this.birthday = birthday; - } - public String getEducation() { return education; diff --git a/ry-xinli-system/src/main/java/com/ddnai/system/mapper/psychology/PsyUserProfileMapper.java b/ry-xinli-system/src/main/java/com/ddnai/system/mapper/psychology/PsyUserProfileMapper.java index 768505f9..51e9d3b5 100644 --- a/ry-xinli-system/src/main/java/com/ddnai/system/mapper/psychology/PsyUserProfileMapper.java +++ b/ry-xinli-system/src/main/java/com/ddnai/system/mapper/psychology/PsyUserProfileMapper.java @@ -42,6 +42,14 @@ public interface PsyUserProfileMapper */ public List selectProfileList(PsyUserProfile profile); + /** + * 查询学员档案列表(仅包含拥有学员角色的用户) + * + * @param profile 档案信息 + * @return 档案集合 + */ + public List selectStudentProfileList(PsyUserProfile profile); + /** * 新增档案 * diff --git a/ry-xinli-system/src/main/java/com/ddnai/system/service/impl/psychology/PsyUserProfileServiceImpl.java b/ry-xinli-system/src/main/java/com/ddnai/system/service/impl/psychology/PsyUserProfileServiceImpl.java index bae52304..0ec5f3bf 100644 --- a/ry-xinli-system/src/main/java/com/ddnai/system/service/impl/psychology/PsyUserProfileServiceImpl.java +++ b/ry-xinli-system/src/main/java/com/ddnai/system/service/impl/psychology/PsyUserProfileServiceImpl.java @@ -90,6 +90,19 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService return profileMapper.selectProfileList(profile); } + /** + * 查询学员档案列表(仅包含拥有学员角色的用户) + * + * @param profile 档案信息 + * @return 档案集合 + */ + @Override + @com.ddnai.common.annotation.DataScope(deptAlias = "d", userAlias = "u") + public List selectStudentProfileList(PsyUserProfile profile) + { + return profileMapper.selectStudentProfileList(profile); + } + /** * 新增档案 * @@ -531,14 +544,36 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService if (failureNum > 0) { - failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); - throw new ServiceException(failureMsg.toString()); + if (successNum == 0) + { + // 全部失败,保持原有行为:抛出异常 + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } + else + { + // 部分成功、部分失败:同时返回成功和失败统计,前端可一次性展示 + StringBuilder resultMsg = new StringBuilder(); + resultMsg.append("本次导入完成:共 ") + .append(successNum + failureNum) + .append(" 条,其中成功 ") + .append(successNum) + .append(" 条,失败 ") + .append(failureNum) + .append(" 条。成功明细如下:"); + + resultMsg.append(successMsg); + failureMsg.insert(0, "

失败明细如下:"); + resultMsg.append(failureMsg); + return resultMsg.toString(); + } } else { + // 全部成功 successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + return successMsg.toString(); } - return successMsg.toString(); } } diff --git a/ry-xinli-system/src/main/java/com/ddnai/system/service/psychology/IPsyUserProfileService.java b/ry-xinli-system/src/main/java/com/ddnai/system/service/psychology/IPsyUserProfileService.java index b670a5c6..31067124 100644 --- a/ry-xinli-system/src/main/java/com/ddnai/system/service/psychology/IPsyUserProfileService.java +++ b/ry-xinli-system/src/main/java/com/ddnai/system/service/psychology/IPsyUserProfileService.java @@ -42,6 +42,14 @@ public interface IPsyUserProfileService */ public List selectProfileList(PsyUserProfile profile); + /** + * 查询学员档案列表(仅包含拥有学员角色的用户) + * + * @param profile 档案信息 + * @return 档案集合 + */ + public List selectStudentProfileList(PsyUserProfile profile); + /** * 新增档案 * diff --git a/ry-xinli-system/src/main/resources/mapper/system/SysUserMapper.xml b/ry-xinli-system/src/main/resources/mapper/system/SysUserMapper.xml index 0f35a1d6..b70f33b4 100644 --- a/ry-xinli-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ry-xinli-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.register_type, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar as user_avatar, u.phonenumber as phone, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by as user_create_by, u.create_time as user_create_time, u.remark as user_remark, + d.dept_name, d.leader, + p.profile_id, p.profile_type, p.profile_data, p.avatar, p.id_card, p.birthday, + p.prison, p.prison_area, p.gender, p.nation, p.education_level, p.crime_name, + p.sentence_term, p.sentence_start_date, p.sentence_end_date, p.entry_date, + p.info_number, p.create_by, p.create_time, p.update_by, p.update_time, p.remark + from sys_user u + left join sys_dept d on u.dept_id = d.dept_id + left join psy_user_profile p on u.user_id = p.user_id + inner join sys_user_role ur on u.user_id = ur.user_id + inner join sys_role r on ur.role_id = r.role_id + where u.del_flag = '0' + and ( + lower(r.role_key) = 'student' + or r.role_name like '%学员%' + or r.role_id = 101 + ) + + AND u.user_id = #{userId} + + + AND u.user_name like concat('%', #{userName}, '%') + + + AND p.profile_type = #{profileType} + + + AND p.id_card like concat('%', #{idCard}, '%') + + + AND p.info_number like concat('%', #{infoNumber}, '%') + + + AND p.prison like concat('%', #{prison}, '%') + + + AND p.prison_area like concat('%', #{prisonArea}, '%') + + + AND p.gender = #{gender} + + + AND p.nation like concat('%', #{nation}, '%') + + + AND p.education_level = #{educationLevel} + + + AND p.crime_name like concat('%', #{crimeName}, '%') + + + AND date_format(u.create_time,'%Y%m%d') >= date_format(#{params.beginTime},'%Y%m%d') + + + AND date_format(u.create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') + + + AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) + + ${params.dataScope} + order by u.create_time desc + + diff --git a/xinli-ui/src/api/psychology/profile.js b/xinli-ui/src/api/psychology/profile.js index 47894322..7bf84e25 100644 --- a/xinli-ui/src/api/psychology/profile.js +++ b/xinli-ui/src/api/psychology/profile.js @@ -9,6 +9,15 @@ export function listProfile(query) { }) } +// 查询学员档案列表(仅包含拥有学员角色的用户) +export function listStudentProfile(query) { + return request({ + url: '/psychology/profile/student/list', + method: 'get', + params: query + }) +} + // 查询档案详细 export function getProfile(profileId) { return request({ diff --git a/xinli-ui/src/views/psychology/assessment/start.vue b/xinli-ui/src/views/psychology/assessment/start.vue index bb60d5c4..fc541da6 100644 --- a/xinli-ui/src/views/psychology/assessment/start.vue +++ b/xinli-ui/src/views/psychology/assessment/start.vue @@ -85,7 +85,7 @@