From 0add812615b70d64fa404919175643ab8819862b Mon Sep 17 00:00:00 2001 From: elliott <382696293@qq.com> Date: Thu, 11 Jan 2024 18:00:52 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysUser.java | 16 +++++++- .../main/resources/mapper/SiteInfoMapper.xml | 4 +- .../service/impl/SysUserServiceImpl.java | 32 ++++++++++++++- flossom-ui/src/views/system/firing/index.vue | 26 +++++++----- .../src/views/system/scriptTag/index.vue | 9 +++- .../views/system/siteCarouselInfo/index.vue | 12 +++--- .../src/views/system/siteInfo/index.vue | 41 ++++++++++--------- 7 files changed, 97 insertions(+), 43 deletions(-) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysUser.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysUser.java index 0630fe7..a49d390 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysUser.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/SysUser.java @@ -25,13 +25,17 @@ public class SysUser extends BaseEntity private static final long serialVersionUID = 1L; /** 用户ID */ - @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") +// @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号") private Long userId; /** 部门ID */ - @Excel(name = "部门编号", type = Type.IMPORT) +// @Excel(name = "部门编号", type = Type.IMPORT) private Long deptId; + /** 部门名称 */ + @Excel(name = "部门名称", type = Type.IMPORT) + private String deptName; + /** 用户账号 */ @Excel(name = "登录名称") private String userName; @@ -92,6 +96,14 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + public SysUser() { diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml index 7fee971..8c087ac 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SiteInfoMapper.xml @@ -60,8 +60,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and site_type = #{siteType} and site_name like concat('%', #{siteName}, '%') and file_url = #{fileUrl} - and site_start_time = #{siteStartTime} - and site_end_time = #{siteEndTime} + and site_start_time < #{siteStartTime} + and site_end_time > #{siteEndTime} and user_register_start_time = #{userRegisterStartTime} and user_register_end_time = #{userRegisterEndTime} and open_type = #{openType} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysUserServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysUserServiceImpl.java index 560fcec..fe6ed3a 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysUserServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/SysUserServiceImpl.java @@ -2,6 +2,7 @@ package com.flossom.system.service.impl; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import javax.validation.Validator; @@ -53,6 +54,8 @@ public class SysUserServiceImpl implements ISysUserService @Autowired protected Validator validator; + @Autowired + private SysDeptMapper deptMapper; /** * 根据条件分页查询用户列表 @@ -495,9 +498,33 @@ public class SysUserServiceImpl implements ISysUserService String password = configService.selectConfigByKey("sys.user.initPassword"); for (SysUser user : userList) { + if (Objects.isNull(user)) { + failureNum++; + continue; + } user.setUserId(null); try { + // 验证部门是否存在 + String deptName = user.getDeptName(); + if (StringUtils.isEmpty(deptName)) { + failureNum++; + failureMsg.append("
" + failureNum + "、部门信息为空"); + continue; + } else { + SysDept dept = new SysDept(); + dept.setDeptName(deptName.trim()); + List sysDepts = deptMapper.selectDeptList(dept); + if (CollectionUtils.isEmpty(sysDepts)) { + failureNum++; + failureMsg.append("
" + failureNum + "、部门不存在"); + continue; + } else { + Long deptId = sysDepts.get(0).getDeptId(); + user.setDeptId(deptId); + user.setDept(sysDepts.get(0)); + } + } // 验证是否存在这个用户 SysUser u = userMapper.selectUserByUserName(user.getUserName()); if (StringUtils.isNull(u)) @@ -525,6 +552,7 @@ public class SysUserServiceImpl implements ISysUserService failureNum++; failureMsg.append("
" + failureNum + "、账号 " + user.getUserName() + " 已存在"); } + } catch (Exception e) { @@ -536,12 +564,12 @@ public class SysUserServiceImpl implements ISysUserService } if (failureNum > 0) { - failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确"); throw new ServiceException(failureMsg.toString()); } else { - successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条:"); } if (StringUtils.isNotEmpty(successMsg.toString()) && !"null".equals(successMsg.toString())) { return successMsg.toString(); diff --git a/flossom-ui/src/views/system/firing/index.vue b/flossom-ui/src/views/system/firing/index.vue index d8ba92e..a99bc7a 100644 --- a/flossom-ui/src/views/system/firing/index.vue +++ b/flossom-ui/src/views/system/firing/index.vue @@ -31,7 +31,7 @@
请上传视频,用于启动页显示,比例建议为16: 9
@@ -76,7 +76,7 @@ @@ -177,12 +177,12 @@ export default { form: {}, // 表单校验 rules: { - title: [ - { required: true, message: '请输入标题', trigger: 'blur' }, - ], - content: [ - { required: true, message: '请输入内容', trigger: 'blur' }, - ] + // title: [ + // { required: true, message: '请输入标题', trigger: 'blur' }, + // ], + // content: [ + // { required: true, message: '请输入内容', trigger: 'blur' }, + // ] } }; }, @@ -357,16 +357,22 @@ export default { } }, /** 删除按钮操作 */ - handleDelete(row) { + handleDelete(row,flag) { + let content = ""; if(!row && this.videoForm) { row = this.videoForm; } + if (flag == 1) { + content += '启动页视频'; + } else { + content += '介绍页标题为'+row.title+'的数据项'; + } if (!row.id) { this.$modal.msgError('目前数据状态不允许删除'); return; } const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除登录页信息编号为"' + ids + '"的数据项?').then(function() { + this.$modal.confirm('是否确认删除"' + content + '"?').then(function() { return delInfo(ids); }).then(() => { this.getList(); diff --git a/flossom-ui/src/views/system/scriptTag/index.vue b/flossom-ui/src/views/system/scriptTag/index.vue index 3eb16ab..43dfa35 100644 --- a/flossom-ui/src/views/system/scriptTag/index.vue +++ b/flossom-ui/src/views/system/scriptTag/index.vue @@ -126,7 +126,7 @@ - + @@ -307,6 +307,13 @@ export default { this.loading = false; }); }, + // tagChange(){ + // if (this.form.id) { + // // this.form.tagIdArray = []; + // } else { + // // this.form.tagIdArray = []; + // } + // }, /** 转换标签数据结构 */ normalizer(node) { if (node.children && !node.children.length) { diff --git a/flossom-ui/src/views/system/siteCarouselInfo/index.vue b/flossom-ui/src/views/system/siteCarouselInfo/index.vue index c616234..f2f4974 100644 --- a/flossom-ui/src/views/system/siteCarouselInfo/index.vue +++ b/flossom-ui/src/views/system/siteCarouselInfo/index.vue @@ -201,7 +201,7 @@
- +
- - + + @@ -502,7 +502,7 @@ export default { // 表单校验 rules: { fileUrl: [ - { required: true, message: "弹窗封面不能为空", trigger: "blur" } + { required: true, message: "轮播封面不能为空", trigger: "blur" } ], pushType: [ { required: true, message: "推送频次不能为空", trigger: "blur" } @@ -653,7 +653,7 @@ export default { handleAdd() { this.reset(); this.open = true; - this.title = "添加轮播图"; + this.title = "添加轮播列表"; this.form.orderNumber = 1000; this.form.userType = 2; }, @@ -695,7 +695,7 @@ export default { this.$refs["form"].validate(valid => { if (valid) { if (!this.form.fileUrl) { - this.$modal.msgError("弹窗封面不能为空"); + this.$modal.msgError("轮播封面不能为空"); return; } // 处理时间 diff --git a/flossom-ui/src/views/system/siteInfo/index.vue b/flossom-ui/src/views/system/siteInfo/index.vue index b42bf2a..19a575f 100644 --- a/flossom-ui/src/views/system/siteInfo/index.vue +++ b/flossom-ui/src/views/system/siteInfo/index.vue @@ -211,7 +211,7 @@
将文件拖到此处,或点击上传
-
请上传启动页介绍图片,建议尺寸为330px*460p
+
只能上传jpg/png图片,建议尺寸300px*400px
@@ -270,7 +270,7 @@
- + @@ -296,21 +296,21 @@ - - - - - - - - - + + + + + + + + + + + + + - +