瀏覽代碼

用户代码修改

user5 2 年之前
父節點
當前提交
b320d9d1fa

+ 9 - 11
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/controller/UserController.java

@@ -210,8 +210,6 @@ public class UserController {
         EasyPoiUtil.exportExcel ( result, "用户数据",  options.getSheetName ( ), UserDTO.class, fileName, response );
     }
 
-    private int successNum;
-    private int failureNum;
 
     /**
      * 导入用户数据
@@ -224,8 +222,8 @@ public class UserController {
     @ApiOperation(value = "导入用户excel")
     public ResponseEntity importFile(MultipartFile file) {
         try {
-            this.successNum = 0;
-            this.failureNum = 0;
+            Integer successNum = 0;
+            Integer failureNum = 0;
             StringBuilder failureMsg = new StringBuilder ( );
             List <UserDTO> list = EasyPoiUtil.importExcel ( file, 1, 2, UserDTO.class );
             for (UserDTO user : list) {
@@ -263,27 +261,27 @@ public class UserController {
                         UserDTO userDTO = UserWrapper.INSTANCE.toDTO(user1);
                         userDTO.setRoleDTOList(roleDTOList);
                         userService.saveOrUpdate(userDTO);
-                        this.successNum++;
+                        successNum++;
                     } else {
                         failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 已存在; " );
-                        this.failureNum++;
+                        failureNum++;
                     }
                 } catch (ConstraintViolationException ex) {
                     failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 导入失败:" );
                     List <String> messageList = BeanValidators.extractPropertyAndMessageAsList ( ex, ": " );
                     for (String message : messageList) {
                         failureMsg.append ( message + "; " );
-                        this.failureNum++;
+                        failureNum++;
                     }
                 } catch (Exception ex) {
-                    this.failureNum++;
+                    failureNum++;
                     failureMsg.append ( "<br/>登录名 " + user.getLoginName ( ) + " 导入失败:" + ex.getMessage ( ) );
                 }
             }
-            if ( this.failureNum > 0 ) {
-                failureMsg.insert ( 0, ",失败 " + this.failureNum + " 条用户,导入信息如下:" );
+            if ( failureNum > 0 ) {
+                failureMsg.insert ( 0, ",失败 " + failureNum + " 条用户,导入信息如下:" );
             }
-            return ResponseEntity.ok ( "已成功导入 " + this.successNum + " 条用户" + failureMsg );
+            return ResponseEntity.ok ( "已成功导入 " + successNum + " 条用户" + failureMsg );
         } catch (Exception e) {
             return ResponseEntity.badRequest().body ( "导入用户失败!失败信息:" + e.getMessage ( ) );
         }

+ 0 - 82
jeeplus-platform/jeeplus-admin/src/main/java/com/jeeplus/sys/service/dto/OfficeDTO.java

@@ -110,14 +110,6 @@ public class OfficeDTO extends TreeDTO <OfficeDTO> {
 	private boolean disabled = false;
 
 	/**
-	 * 登录名
-	 */
-	@Length(min = 1, max = 100)
-	@Excel (name = "登录名")
-	@Query
-	private String loginName;
-
-	/**
 	 * 父级部门
 	 */
 	@Length(min = 1, max = 100)
@@ -125,78 +117,4 @@ public class OfficeDTO extends TreeDTO <OfficeDTO> {
 	@Query
 	private String parentName;
 
-	/**
-	 * 密码
-	 */
-	@JsonIgnore
-	@Length(min = 1, max = 100)
-	private String password;
-
-
-	/**
-	 * 工号
-	 */
-	@Length(min = 1, max = 100)
-	@Excel (name = "工号")
-	private String no;
-
-	/**
-	 * 手机
-	 */
-	@Length(min = 0, max = 100)
-	@Excel(name = "手机")
-	private String mobile;
-
-	/**
-	 * 最后登录IP
-	 */
-	@ApiModelProperty(hidden = true)
-	private String loginIp;
-
-	/**
-	 * 最后登录日期
-	 */
-	@ApiModelProperty(hidden = true)
-	private Date loginDate;
-
-	/**
-	 * 是否允许登录
-	 */
-	private String loginFlag;
-
-	/**
-	 * 头像
-	 */
-	private String photo;
-
-	/**
-	 * 二维码
-	 */
-	private String qrCode;
-
-	/**
-	 * 原登录名
-	 */
-	private String oldLoginName;
-
-	/**
-	 * 新密码
-	 */
-	private String newPassword;
-
-	/**
-	 * 签名
-	 */
-	private String sign;
-
-	/**
-	 * 超级管理员标志
-	 */
-	private boolean isAdmin;
-
-	/**
-	 * 是否可用
-	 */
-	private boolean typeFlag = false;
-
 }