Lius
2025-08-22 d74ad3fdaf67038cecfcadc5cb1800985224a2a6
用户管理导出导入功能改造
已修改3个文件
41 ■■■■ 文件已修改
lxzn-module-system/lxzn-system-api/lxzn-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-api/lxzn-system-local-api/src/main/java/org/jeecg/common/system/api/ISysBaseAPI.java
@@ -1,6 +1,5 @@
package org.jeecg.common.system.api;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.CommonAPI;
import org.jeecg.common.api.dto.DataLogDTO;
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
@@ -565,6 +565,9 @@
                    sysUserExcel.setSalt(salt);
                    String passwordEncode = PasswordUtil.encrypt(sysUserExcel.getUsername(), sysUserExcel.getPassword(), salt);
                    sysUserExcel.setPassword(passwordEncode);
                    sysUserExcel.setDelFlag(CommonConstant.DEL_FLAG_0);
                    sysUserExcel.setPasswordFlag(CommonConstant.DEL_FLAG_1);
                    sysUserExcel.setPasswordTime(new Date());
                    try {
                        sysUserService.save(sysUserExcel);
                        successLines++;
@@ -599,6 +602,17 @@
                        }
                        sysUserDepartService.saveBatch(userDepartList);
                    }
                    // 批量将产线和用户信息建立关联关系
                    String productionIds = sysUserExcel.getProductionIds();
                    if (StringUtils.isNotBlank(productionIds)) {
                        String userId = sysUserExcel.getId();
                        String[] productionIdArray = productionIds.split(",");
                        List<MdcUserProduction> userProductionList = new ArrayList<>(productionIdArray.length);
                        for (String productionId : productionIdArray) {
                            userProductionList.add(new MdcUserProduction(userId, productionId));
                        }
                        userProductionService.saveBatch(userProductionList);
                    }
                }
            } catch (Exception e) {
lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
@@ -64,13 +64,11 @@
    /**
     * 头像
     */
    @Excel(name = "头像", width = 15,type = 2)
    private String avatar;
    /**
     * 生日
     */
    @Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
@@ -78,20 +76,17 @@
    /**
     * 性别(1:男 2:女)
     */
    @Excel(name = "性别", width = 15,dicCode="sex")
    @Dict(dicCode = "sex")
    private Integer sex;
    /**
     * 电子邮件
     */
    @Excel(name = "电子邮件", width = 15)
    private String email;
    /**
     * 电话
     */
    @Excel(name = "电话", width = 15)
    private String phone;
    /**
@@ -106,6 +101,12 @@
    private transient String productionName;
    /**
     * 工号,唯一键
     */
    @Excel(name = "工号", width = 15)
    private String workNo;
    /**
     * 状态(1:正常  2:冻结 )
     */
    @Excel(name = "状态", width = 15,dicCode="user_status")
@@ -115,27 +116,18 @@
    /**
     * 删除状态(0,正常,1已删除)
     */
    @Excel(name = "删除状态", width = 15,dicCode="del_flag")
    @TableLogic
    private Integer delFlag;
    /**
     * 工号,唯一键
     */
    @Excel(name = "工号", width = 15)
    private String workNo;
    /**
     * 职务,关联职务表
     */
    @Excel(name = "职务", width = 15)
    @Dict(dictTable ="sys_position",dicText = "name",dicCode = "code")
    private String post;
    /**
     * 座机号
     */
    @Excel(name = "座机号", width = 15)
    private String telephone;
    /**
@@ -165,26 +157,24 @@
    /**
     * 身份(0 普通成员 1 上级)
     */
    @Excel(name="(1普通成员 2上级)",width = 15)
    private Integer userIdentity;
    /**
     * 用户类型(1 普通成员 2 工段 3 车间 4 公司)
     */
    @Excel(name="(1普通成员 2工段 3车间 4公司)",width = 15)
    private Integer userType;
    /**
     * 负责部门
     */
    @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
//    @Excel(name="负责部门",width = 15,dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
    @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
    private String departIds;
    /**
     * 负责产线
     */
    @Excel(name="负责产线",width = 15,dictTable ="mdc_production",dicText = "production_name",dicCode = "id")
    @Excel(name="负责产线",width = 45,dictTable ="mdc_production",dicText = "production_name",dicCode = "id")
    @Dict(dictTable ="mdc_production",dicText = "production_name",dicCode = "id")
    private String productionIds;