Quellcode durchsuchen

作者:张哲
时间:2023/05/24
类型:需求变更
描述:里程碑(1) 知识作者转交

zizg vor 1 Jahr
Ursprung
Commit
d75f1a4e21

+ 1 - 1
src/main/java/com/redxun/knowledge/analysis/entity/dto/PersonVisitDto.java

@@ -24,7 +24,7 @@ public class PersonVisitDto implements Serializable {
     @ApiModelProperty("维度 月month 年year 全部total")
     private String type;
 
-    @NotEmpty(message = "组织Id不能为空")
+    //@NotEmpty(message = "组织Id不能为空")
     @ApiModelProperty("组织id,只支持选择一个组织")
     private String organizationId;
 

+ 40 - 4
src/main/java/com/redxun/knowledge/controller/KnowledgeController.java

@@ -3,23 +3,25 @@ package com.redxun.knowledge.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.redxun.common.annotation.ClassDefine;
+import com.redxun.common.annotation.MethodDefine;
 import com.redxun.common.base.db.BaseService;
 import com.redxun.common.base.entity.JsonPageResult;
 import com.redxun.common.base.entity.JsonResult;
 import com.redxun.common.base.entity.QueryData;
 import com.redxun.common.base.search.QueryFilter;
 import com.redxun.common.base.search.QueryFilterBuilder;
+import com.redxun.common.constant.HttpMethodConstants;
+import com.redxun.common.utils.ContextUtil;
 import com.redxun.common.utils.ExceptionUtil;
 import com.redxun.knowledge.entity.dao.Knowledge;
 import com.redxun.knowledge.entity.dto.KnowledgeDto;
+import com.redxun.knowledge.entity.dto.TransferAuthorDto;
 import com.redxun.knowledge.entity.validate.AddGroup;
 import com.redxun.knowledge.entity.vo.KnowledgeVo;
+import com.redxun.knowledge.entity.vo.OsUser;
 import com.redxun.knowledge.service.KnowledgeServiceImpl;
 import com.redxun.web.controller.BaseController;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
@@ -30,6 +32,7 @@ import javax.validation.ConstraintViolation;
 import javax.validation.Validator;
 import javax.validation.groups.Default;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 @Slf4j
@@ -218,5 +221,38 @@ public class KnowledgeController extends BaseController<Knowledge> {
         Integer sum = knowledgeService.getKnowledgeSum();
         return jsonResult.setData(sum);
     }
+
+    @ApiOperation("转移作者")
+    @PostMapping("transferAuthor")
+    public JsonResult transferAuthor(@RequestBody TransferAuthorDto transferAuthorDto) {
+        JsonResult jsonResult = JsonResult.Success();
+        knowledgeService.transferAuthor(transferAuthorDto);
+        return jsonResult.setMessage("转移成功!");
+    }
+
+    @MethodDefine(
+            title = "查看该用户组及子组的用户",
+            path = "/getAllUserByGroupId",
+            method = HttpMethodConstants.POST
+    )
+    @ApiOperation("查看该用户组及子组的用户")
+    @PostMapping({"getAllUserByGroupId"})
+    public JsonPageResult getAllUserByGroupId(@ApiParam @RequestBody QueryData queryData) {
+        JsonPageResult jsonResult = JsonPageResult.getSuccess("返回数据成功!");
+
+        try {
+            Map<String, String> params = queryData.getParams();
+            QueryFilter filter = QueryFilterBuilder.createQueryFilter(queryData);
+            params.put("tenantId", ContextUtil.getCurrentTenantId());
+            IPage<OsUser> osUserIPage = knowledgeService.getAllUsersByGroupId(filter, params);
+            jsonResult.setPageData(osUserIPage);
+        } catch (Exception var6) {
+            jsonResult.setSuccess(false);
+            this.logger.error(ExceptionUtil.getExceptionMessage(var6));
+            jsonResult.setMessage(ExceptionUtil.getExceptionMessage(var6));
+        }
+
+        return jsonResult;
+    }
 }
 

+ 27 - 0
src/main/java/com/redxun/knowledge/entity/dto/TransferAuthorDto.java

@@ -0,0 +1,27 @@
+package com.redxun.knowledge.entity.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 文件名: TransferAuthorDto
+ * 作者: zizg
+ * 时间: 2023/5/25
+ * 描述:
+ * 修改人:
+ * 修改时间:
+ * 修改内容:
+ */
+@Data
+public class TransferAuthorDto implements Serializable {
+
+    @ApiModelProperty("被转移的作者")
+    private List<String> authors;
+
+    @ApiModelProperty("转移到的作者")
+    private String arriveAuthor;
+}

+ 149 - 0
src/main/java/com/redxun/knowledge/entity/vo/OsPropertiesDef.java

@@ -0,0 +1,149 @@
+package com.redxun.knowledge.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.redxun.common.base.entity.BaseExtEntity;
+
+
+public class OsPropertiesDef extends BaseExtEntity<String> {
+
+    private String id;
+
+    private String ctltype;
+
+    private String dataType;
+
+    private String dimId;
+
+    private String extJson;
+
+    private String groupId;
+
+    private String name;
+
+    private String groupName = "";
+
+    private String propertyId = "";
+
+    private Object propertyValue = "";
+
+    private boolean isDim = false;
+
+    @JsonCreator
+    public OsPropertiesDef() {
+    }
+
+    public String getPkId() {
+        return this.id;
+    }
+
+    public void setPkId(String pkId) {
+        this.id = pkId;
+    }
+
+    public boolean getIsDim() {
+        return !"-1".equals(this.dimId);
+    }
+
+    public void setIsDim() {
+        if ("-1".equals(this.dimId)) {
+            this.isDim = false;
+        }
+
+        this.isDim = true;
+    }
+
+    public OsPropertiesDef setId(final String id) {
+        this.id = id;
+        return this;
+    }
+
+    public OsPropertiesDef setCtltype(final String ctltype) {
+        this.ctltype = ctltype;
+        return this;
+    }
+
+    public OsPropertiesDef setDataType(final String dataType) {
+        this.dataType = dataType;
+        return this;
+    }
+
+    public OsPropertiesDef setDimId(final String dimId) {
+        this.dimId = dimId;
+        return this;
+    }
+
+    public OsPropertiesDef setExtJson(final String extJson) {
+        this.extJson = extJson;
+        return this;
+    }
+
+    public OsPropertiesDef setGroupId(final String groupId) {
+        this.groupId = groupId;
+        return this;
+    }
+
+    public OsPropertiesDef setName(final String name) {
+        this.name = name;
+        return this;
+    }
+
+    public OsPropertiesDef setGroupName(final String groupName) {
+        this.groupName = groupName;
+        return this;
+    }
+
+    public OsPropertiesDef setPropertyId(final String propertyId) {
+        this.propertyId = propertyId;
+        return this;
+    }
+
+    public OsPropertiesDef setPropertyValue(final Object propertyValue) {
+        this.propertyValue = propertyValue;
+        return this;
+    }
+
+    public OsPropertiesDef setDim(final boolean isDim) {
+        this.isDim = isDim;
+        return this;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+
+    public String getCtltype() {
+        return this.ctltype;
+    }
+
+    public String getDataType() {
+        return this.dataType;
+    }
+
+    public String getDimId() {
+        return this.dimId;
+    }
+
+    public String getExtJson() {
+        return this.extJson;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public String getGroupName() {
+        return this.groupName;
+    }
+
+    public String getPropertyId() {
+        return this.propertyId;
+    }
+
+    public Object getPropertyValue() {
+        return this.propertyValue;
+    }
+}

+ 89 - 0
src/main/java/com/redxun/knowledge/entity/vo/OsPropertiesGroup.java

@@ -0,0 +1,89 @@
+package com.redxun.knowledge.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.redxun.common.base.entity.BaseExtEntity;
+
+import java.util.List;
+
+@TableName("os_properties_group")
+public class OsPropertiesGroup extends BaseExtEntity<String> {
+
+    private String id;
+
+    private String dimId;
+
+    private String enabled;
+
+    private String name;
+
+    private String dimName = "无";
+
+    private List<OsPropertiesDef> osPropertiesDefList;
+
+    @JsonCreator
+    public OsPropertiesGroup() {
+    }
+
+    public String getPkId() {
+        return this.id;
+    }
+
+    public void setPkId(String pkId) {
+        this.id = pkId;
+    }
+
+    public OsPropertiesGroup setId(final String id) {
+        this.id = id;
+        return this;
+    }
+
+    public OsPropertiesGroup setDimId(final String dimId) {
+        this.dimId = dimId;
+        return this;
+    }
+
+    public OsPropertiesGroup setEnabled(final String enabled) {
+        this.enabled = enabled;
+        return this;
+    }
+
+    public OsPropertiesGroup setName(final String name) {
+        this.name = name;
+        return this;
+    }
+
+    public OsPropertiesGroup setDimName(final String dimName) {
+        this.dimName = dimName;
+        return this;
+    }
+
+    public OsPropertiesGroup setOsPropertiesDefList(final List<OsPropertiesDef> osPropertiesDefList) {
+        this.osPropertiesDefList = osPropertiesDefList;
+        return this;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+
+    public String getDimId() {
+        return this.dimId;
+    }
+
+    public String getEnabled() {
+        return this.enabled;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public String getDimName() {
+        return this.dimName;
+    }
+
+    public List<OsPropertiesDef> getOsPropertiesDefList() {
+        return this.osPropertiesDefList;
+    }
+}

+ 659 - 0
src/main/java/com/redxun/knowledge/entity/vo/OsUser.java

@@ -0,0 +1,659 @@
+package com.redxun.knowledge.entity.vo;
+
+import com.alibaba.fastjson.JSONArray;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.redxun.common.base.entity.BaseExtEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+public class OsUser extends BaseExtEntity<String> {
+    public static final String FORM_INTERFACE = "INTERFACE";
+    public static final String ADMIN_ACCOUNT = "admin";
+    public static final String FROM_SYS = "system";
+    public static final String STATUS_IN_JOB = "1";
+    public static final String STATUS_OUT_JOB = "0";
+    public static final String MALE = "male";
+    public static final String FMALE = "fmale";
+    public static final String WEIXIN = "weixin";
+    public static final String DD = "dd";
+    public static final String ADMIN = "1";
+    private static final long serialVersionUID = -5886012896705137070L;
+
+    private String userId;
+
+    private String fullName;
+
+    private String userNo;
+
+    private String pwd;
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date entryTime;
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date quitTime;
+
+    private String userType;
+
+    private String from;
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date birthday;
+
+    private String sex;
+
+    private String mobile;
+
+    private String email;
+
+    private String address;
+
+    private String urgent;
+
+    private Integer syncWx;
+
+    private String urgentMobile;
+
+    private String qq;
+
+    private String photo;
+
+    private String status;
+
+    private String enable;
+
+    private String wxOpenId;
+
+    private String ddId;
+
+    private String curTenantId;
+
+    private String userGroupName;
+
+    private String userGroupId;
+
+    private List<OsUserType> roles;
+
+    private String roleId;
+
+    private String oldPassword;
+
+    private String newPassword;
+
+    private String relTypeId;
+
+    private String relInstId;
+
+    private String mainDepId;
+
+    private String deptName;
+
+    private String canGroupIds;
+
+    private String userTypeName;
+
+    private int admin = 0;
+
+    private JSONArray relations;
+
+    private List<OsPropertiesGroup> propertiesGroups;
+
+    private Boolean isAddAdmin = false;
+
+    private String isLock;
+
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date pwdUpdateTime;
+
+    private String isFirstLogin;
+
+    private int sn;
+
+    private String positionGrade;
+
+    private String sequenceCode;
+
+    private String slyGrade;
+
+    private String sequenceName;
+
+    @DateTimeFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss"
+    )
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    private Date zzDate;
+
+    private String duty;
+
+    private String empType;
+
+    private String pId;
+
+    public OsUser() {
+    }
+
+    public String getPkId() {
+        return this.userId;
+    }
+
+    public void setPkId(String pkId) {
+        this.userId = pkId;
+    }
+
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        } else if (o != null && this.getClass() == o.getClass()) {
+            if (!super.equals(o)) {
+                return false;
+            } else {
+                OsUser osUser = (OsUser)o;
+                return this.admin == osUser.admin && Objects.equals(this.userId, osUser.userId) && Objects.equals(this.fullName, osUser.fullName) && Objects.equals(this.userNo, osUser.userNo) && Objects.equals(this.pwd, osUser.pwd) && Objects.equals(this.entryTime, osUser.entryTime) && Objects.equals(this.quitTime, osUser.quitTime) && Objects.equals(this.userType, osUser.userType) && Objects.equals(this.from, osUser.from) && Objects.equals(this.birthday, osUser.birthday) && Objects.equals(this.sex, osUser.sex) && Objects.equals(this.mobile, osUser.mobile) && Objects.equals(this.email, osUser.email) && Objects.equals(this.address, osUser.address) && Objects.equals(this.urgent, osUser.urgent) && Objects.equals(this.syncWx, osUser.syncWx) && Objects.equals(this.urgentMobile, osUser.urgentMobile) && Objects.equals(this.qq, osUser.qq) && Objects.equals(this.photo, osUser.photo) && Objects.equals(this.status, osUser.status) && Objects.equals(this.enable, osUser.enable) && Objects.equals(this.wxOpenId, osUser.wxOpenId) && Objects.equals(this.ddId, osUser.ddId) && Objects.equals(this.roles, osUser.roles) && Objects.equals(this.roleId, osUser.roleId) && Objects.equals(this.oldPassword, osUser.oldPassword) && Objects.equals(this.newPassword, osUser.newPassword) && Objects.equals(this.relTypeId, osUser.relTypeId) && Objects.equals(this.relInstId, osUser.relInstId) && Objects.equals(this.mainDepId, osUser.mainDepId) && Objects.equals(this.canGroupIds, osUser.canGroupIds) && Objects.equals(this.userTypeName, osUser.userTypeName) && Objects.equals(this.relations, osUser.relations) && Objects.equals(this.propertiesGroups, osUser.propertiesGroups) && Objects.equals(this.positionGrade, osUser.positionGrade) && Objects.equals(this.sequenceCode, osUser.sequenceCode) && Objects.equals(this.slyGrade, osUser.slyGrade);
+            }
+        } else {
+            return false;
+        }
+    }
+
+    public int hashCode() {
+        return Objects.hash(new Object[]{super.hashCode(), this.userId, this.fullName, this.userNo, this.pwd, this.entryTime, this.quitTime, this.userType, this.from, this.birthday, this.sex, this.mobile, this.email, this.address, this.urgent, this.syncWx, this.urgentMobile, this.qq, this.photo, this.status, this.enable, this.wxOpenId, this.ddId, this.roles, this.roleId, this.oldPassword, this.newPassword, this.relTypeId, this.relInstId, this.mainDepId, this.canGroupIds, this.userTypeName, this.admin, this.relations, this.propertiesGroups, this.positionGrade, this.sequenceCode, this.slyGrade});
+    }
+
+    public String getUserId() {
+        return this.userId;
+    }
+
+    public String getFullName() {
+        return this.fullName;
+    }
+
+    public String getUserNo() {
+        return this.userNo;
+    }
+
+    public String getPwd() {
+        return this.pwd;
+    }
+
+    public Date getEntryTime() {
+        return this.entryTime;
+    }
+
+    public Date getQuitTime() {
+        return this.quitTime;
+    }
+
+    public String getUserType() {
+        return this.userType;
+    }
+
+    public String getFrom() {
+        return this.from;
+    }
+
+    public Date getBirthday() {
+        return this.birthday;
+    }
+
+    public String getSex() {
+        return this.sex;
+    }
+
+    public String getMobile() {
+        return this.mobile;
+    }
+
+    public String getEmail() {
+        return this.email;
+    }
+
+    public String getAddress() {
+        return this.address;
+    }
+
+    public String getUrgent() {
+        return this.urgent;
+    }
+
+    public Integer getSyncWx() {
+        return this.syncWx;
+    }
+
+    public String getUrgentMobile() {
+        return this.urgentMobile;
+    }
+
+    public String getQq() {
+        return this.qq;
+    }
+
+    public String getPhoto() {
+        return this.photo;
+    }
+
+    public String getStatus() {
+        return this.status;
+    }
+
+    public String getEnable() {
+        return this.enable;
+    }
+
+    public String getWxOpenId() {
+        return this.wxOpenId;
+    }
+
+    public String getDdId() {
+        return this.ddId;
+    }
+
+    public String getCurTenantId() {
+        return this.curTenantId;
+    }
+
+    public String getUserGroupName() {
+        return this.userGroupName;
+    }
+
+    public String getUserGroupId() {
+        return this.userGroupId;
+    }
+
+    public List<OsUserType> getRoles() {
+        return this.roles;
+    }
+
+    public String getRoleId() {
+        return this.roleId;
+    }
+
+    public String getOldPassword() {
+        return this.oldPassword;
+    }
+
+    public String getNewPassword() {
+        return this.newPassword;
+    }
+
+    public String getRelTypeId() {
+        return this.relTypeId;
+    }
+
+    public String getRelInstId() {
+        return this.relInstId;
+    }
+
+    public String getMainDepId() {
+        return this.mainDepId;
+    }
+
+    public String getDeptName() {
+        return this.deptName;
+    }
+
+    public String getCanGroupIds() {
+        return this.canGroupIds;
+    }
+
+    public String getUserTypeName() {
+        return this.userTypeName;
+    }
+
+    public int getAdmin() {
+        return this.admin;
+    }
+
+    public JSONArray getRelations() {
+        return this.relations;
+    }
+
+    public List<OsPropertiesGroup> getPropertiesGroups() {
+        return this.propertiesGroups;
+    }
+
+    public Boolean getIsAddAdmin() {
+        return this.isAddAdmin;
+    }
+
+    public String getIsLock() {
+        return this.isLock;
+    }
+
+    public Date getPwdUpdateTime() {
+        return this.pwdUpdateTime;
+    }
+
+    public String getIsFirstLogin() {
+        return this.isFirstLogin;
+    }
+
+    public int getSn() {
+        return this.sn;
+    }
+
+    public String getPositionGrade() {
+        return this.positionGrade;
+    }
+
+    public String getSequenceCode() {
+        return this.sequenceCode;
+    }
+
+    public String getSlyGrade() {
+        return this.slyGrade;
+    }
+
+    public String getSequenceName() {
+        return this.sequenceName;
+    }
+
+    public Date getZzDate() {
+        return this.zzDate;
+    }
+
+    public String getDuty() {
+        return this.duty;
+    }
+
+    public String getEmpType() {
+        return this.empType;
+    }
+
+    public String getPId() {
+        return this.pId;
+    }
+
+    public OsUser setUserId(final String userId) {
+        this.userId = userId;
+        return this;
+    }
+
+    public OsUser setFullName(final String fullName) {
+        this.fullName = fullName;
+        return this;
+    }
+
+    public OsUser setUserNo(final String userNo) {
+        this.userNo = userNo;
+        return this;
+    }
+
+    public OsUser setPwd(final String pwd) {
+        this.pwd = pwd;
+        return this;
+    }
+
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    public OsUser setEntryTime(final Date entryTime) {
+        this.entryTime = entryTime;
+        return this;
+    }
+
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    public OsUser setQuitTime(final Date quitTime) {
+        this.quitTime = quitTime;
+        return this;
+    }
+
+    public OsUser setUserType(final String userType) {
+        this.userType = userType;
+        return this;
+    }
+
+    public OsUser setFrom(final String from) {
+        this.from = from;
+        return this;
+    }
+
+    @JsonFormat(
+            pattern = "yyyy-MM-dd HH:mm:ss",
+            timezone = "GMT+8"
+    )
+    public OsUser setBirthday(final Date birthday) {
+        this.birthday = birthday;
+        return this;
+    }
+
+    public OsUser setSex(final String sex) {
+        this.sex = sex;
+        return this;
+    }
+
+    public OsUser setMobile(final String mobile) {
+        this.mobile = mobile;
+        return this;
+    }
+
+    public OsUser setEmail(final String email) {
+        this.email = email;
+        return this;
+    }
+
+    public OsUser setAddress(final String address) {
+        this.address = address;
+        return this;
+    }
+
+    public OsUser setUrgent(final String urgent) {
+        this.urgent = urgent;
+        return this;
+    }
+
+    public OsUser setSyncWx(final Integer syncWx) {
+        this.syncWx = syncWx;
+        return this;
+    }
+
+    public OsUser setUrgentMobile(final String urgentMobile) {
+        this.urgentMobile = urgentMobile;
+        return this;
+    }
+
+    public OsUser setQq(final String qq) {
+        this.qq = qq;
+        return this;
+    }
+
+    public OsUser setPhoto(final String photo) {
+        this.photo = photo;
+        return this;
+    }
+
+    public OsUser setStatus(final String status) {
+        this.status = status;
+        return this;
+    }
+
+    public OsUser setEnable(final String enable) {
+        this.enable = enable;
+        return this;
+    }
+
+    public OsUser setWxOpenId(final String wxOpenId) {
+        this.wxOpenId = wxOpenId;
+        return this;
+    }
+
+    public OsUser setDdId(final String ddId) {
+        this.ddId = ddId;
+        return this;
+    }
+
+    public OsUser setCurTenantId(final String curTenantId) {
+        this.curTenantId = curTenantId;
+        return this;
+    }
+
+    public OsUser setUserGroupName(final String userGroupName) {
+        this.userGroupName = userGroupName;
+        return this;
+    }
+
+    public OsUser setUserGroupId(final String userGroupId) {
+        this.userGroupId = userGroupId;
+        return this;
+    }
+
+    public OsUser setRoles(final List<OsUserType> roles) {
+        this.roles = roles;
+        return this;
+    }
+
+    public OsUser setRoleId(final String roleId) {
+        this.roleId = roleId;
+        return this;
+    }
+
+    public OsUser setOldPassword(final String oldPassword) {
+        this.oldPassword = oldPassword;
+        return this;
+    }
+
+    public OsUser setNewPassword(final String newPassword) {
+        this.newPassword = newPassword;
+        return this;
+    }
+
+    public OsUser setRelTypeId(final String relTypeId) {
+        this.relTypeId = relTypeId;
+        return this;
+    }
+
+    public OsUser setRelInstId(final String relInstId) {
+        this.relInstId = relInstId;
+        return this;
+    }
+
+    public OsUser setMainDepId(final String mainDepId) {
+        this.mainDepId = mainDepId;
+        return this;
+    }
+
+    public OsUser setDeptName(final String deptName) {
+        this.deptName = deptName;
+        return this;
+    }
+
+    public OsUser setCanGroupIds(final String canGroupIds) {
+        this.canGroupIds = canGroupIds;
+        return this;
+    }
+
+    public OsUser setUserTypeName(final String userTypeName) {
+        this.userTypeName = userTypeName;
+        return this;
+    }
+
+    public OsUser setAdmin(final int admin) {
+        this.admin = admin;
+        return this;
+    }
+
+    public OsUser setRelations(final JSONArray relations) {
+        this.relations = relations;
+        return this;
+    }
+
+    public OsUser setPropertiesGroups(final List<OsPropertiesGroup> propertiesGroups) {
+        this.propertiesGroups = propertiesGroups;
+        return this;
+    }
+
+    public OsUser setIsAddAdmin(final Boolean isAddAdmin) {
+        this.isAddAdmin = isAddAdmin;
+        return this;
+    }
+
+    public OsUser setIsLock(final String isLock) {
+        this.isLock = isLock;
+        return this;
+    }
+
+    public OsUser setPwdUpdateTime(final Date pwdUpdateTime) {
+        this.pwdUpdateTime = pwdUpdateTime;
+        return this;
+    }
+
+    public OsUser setIsFirstLogin(final String isFirstLogin) {
+        this.isFirstLogin = isFirstLogin;
+        return this;
+    }
+
+    public OsUser setSn(final int sn) {
+        this.sn = sn;
+        return this;
+    }
+
+    public OsUser setPositionGrade(final String positionGrade) {
+        this.positionGrade = positionGrade;
+        return this;
+    }
+
+    public OsUser setSequenceCode(final String sequenceCode) {
+        this.sequenceCode = sequenceCode;
+        return this;
+    }
+
+    public OsUser setSlyGrade(final String slyGrade) {
+        this.slyGrade = slyGrade;
+        return this;
+    }
+
+    public OsUser setSequenceName(final String sequenceName) {
+        this.sequenceName = sequenceName;
+        return this;
+    }
+
+    public OsUser setZzDate(final Date zzDate) {
+        this.zzDate = zzDate;
+        return this;
+    }
+
+    public OsUser setDuty(final String duty) {
+        this.duty = duty;
+        return this;
+    }
+
+    public OsUser setEmpType(final String empType) {
+        this.empType = empType;
+        return this;
+    }
+
+    public OsUser setPId(final String pId) {
+        this.pId = pId;
+        return this;
+    }
+}

+ 86 - 0
src/main/java/com/redxun/knowledge/entity/vo/OsUserType.java

@@ -0,0 +1,86 @@
+package com.redxun.knowledge.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.redxun.common.base.entity.BaseExtEntity;
+
+
+public class OsUserType extends BaseExtEntity<String> {
+
+    private String id;
+
+    private String code;
+
+    private String name;
+
+    private String descp;
+
+    private String groupId;
+
+    private boolean grant = false;
+
+    @JsonCreator
+    public OsUserType() {
+    }
+
+    public String getPkId() {
+        return this.id;
+    }
+
+    public void setPkId(String pkId) {
+        this.id = pkId;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+
+    public String getCode() {
+        return this.code;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public String getDescp() {
+        return this.descp;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public boolean isGrant() {
+        return this.grant;
+    }
+
+    public OsUserType setId(final String id) {
+        this.id = id;
+        return this;
+    }
+
+    public OsUserType setCode(final String code) {
+        this.code = code;
+        return this;
+    }
+
+    public OsUserType setName(final String name) {
+        this.name = name;
+        return this;
+    }
+
+    public OsUserType setDescp(final String descp) {
+        this.descp = descp;
+        return this;
+    }
+
+    public OsUserType setGroupId(final String groupId) {
+        this.groupId = groupId;
+        return this;
+    }
+
+    public OsUserType setGrant(final boolean grant) {
+        this.grant = grant;
+        return this;
+    }
+}

+ 16 - 0
src/main/java/com/redxun/knowledge/mapper/KnowledgeMapper.java

@@ -3,8 +3,11 @@ package com.redxun.knowledge.mapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.redxun.knowledge.entity.dao.Knowledge;
+import com.redxun.knowledge.entity.dao.OsGroup;
+import com.redxun.knowledge.entity.dto.TransferAuthorDto;
 import com.redxun.knowledge.entity.vo.KnowledgeApprovalVo;
 import com.redxun.knowledge.entity.vo.KnowledgeVo;
+import com.redxun.knowledge.entity.vo.OsUser;
 import org.apache.ibatis.annotations.Mapper;
 import com.redxun.common.base.db.BaseDao;
 import org.apache.ibatis.annotations.Param;
@@ -39,4 +42,17 @@ public interface KnowledgeMapper extends BaseDao<Knowledge> {
 
     // 查看全部已通过的维基知识
     List<Knowledge> findAllWiki(String categoryId);
+
+    /**
+     * 转移作者
+     * @param authors
+     * @param arriveAuthor
+     */
+    void transferAuthor(@Param("authorList") List<String> authors,@Param("arriveAuthor") String arriveAuthor,
+                        @Param("arriveAuthorName") String arriveAuthorName);
+
+    IPage<OsUser> getAllUsersByGroupId(IPage page, @Param("w") Map<String, String> params);
+
+    List<OsGroup> getByDimIdUserIdRelTypeIdIsMain(@Param("dimId") String dimId, @Param("userId") String userId, @Param("relTypeId") String relTypeId, @Param("isMain") String isMain, @Param("tenantId") String tenantId);
+
 }

+ 59 - 0
src/main/java/com/redxun/knowledge/service/KnowledgeServiceImpl.java

@@ -12,6 +12,7 @@ import com.redxun.common.base.db.BaseService;
 import com.redxun.common.base.db.PageHelper;
 import com.redxun.common.base.entity.IUser;
 import com.redxun.common.base.search.QueryFilter;
+import com.redxun.common.constant.MBoolean;
 import com.redxun.common.model.JPaasUser;
 import com.redxun.common.service.impl.SuperServiceImpl;
 import com.redxun.common.tool.IdGenerator;
@@ -25,6 +26,7 @@ import com.redxun.knowledge.common.UserService;
 import com.redxun.knowledge.entity.dao.*;
 import com.redxun.knowledge.entity.dto.KnowledgeDto;
 import com.redxun.knowledge.entity.dto.OrganizationDto;
+import com.redxun.knowledge.entity.dto.TransferAuthorDto;
 import com.redxun.knowledge.entity.vo.*;
 import com.redxun.knowledge.map.entity.dao.MapContent;
 import com.redxun.knowledge.map.mapper.MapContentMapper;
@@ -817,5 +819,62 @@ public class KnowledgeServiceImpl extends SuperServiceImpl<KnowledgeMapper, Know
     }
 
 
+    /**
+     * 转移作者
+     * @param transferAuthorDto
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public void transferAuthor(TransferAuthorDto transferAuthorDto) {
+        //被转移人
+        List<String> authors = transferAuthorDto.getAuthors();
+        //准备转移的人
+        String arriveAuthor = transferAuthorDto.getArriveAuthor();
+        String arriveAuthorName = userService.queryOsUserDto(arriveAuthor).getFullName();
+        //转移
+        knowledgeMapper.transferAuthor(authors,arriveAuthor,arriveAuthorName);
+    }
+
+    /**
+     * 被转移人树
+     * @param filter
+     * @param params
+     * @return
+     */
+    public IPage<OsUser> getAllUsersByGroupId(QueryFilter filter, Map params) {
+        String groupId = (String)params.get("groupId");
+        if (StringUtils.isNotEmpty(groupId)) {
+            if ("curOrg".equals(groupId)) {
+                IUser user = ContextUtil.getCurrentUser();
+                if (user != null) {
+                    groupId = user.getDeptId();
+                }
+            }
+
+            String[] groupIds = groupId.split(",");
+            params.put("groupIds", Arrays.asList(groupIds));
+        }
+
+        IPage<OsUser> osUserIPage = knowledgeMapper.getAllUsersByGroupId(filter.getPage(), params);
+        String tenantId = ContextUtil.getCurrentTenantId();
+        List<OsUser> osList = new ArrayList();
+        List<OsUser> osUsers = osUserIPage.getRecords();
+
+        OsUser user;
+        for(Iterator var8 = osUsers.iterator(); var8.hasNext(); osList.add(user)) {
+            user = (OsUser)var8.next();
+            OsGroup deps = this.getMainDeps(user.getUserId(), tenantId);
+            if (deps != null) {
+                user.setDeptName(deps.getName());
+                user.setMainDepId(deps.getGroupId());
+            }
+        }
 
+        osUserIPage.setRecords(osList);
+        return osUserIPage;
+    }
+
+    public OsGroup getMainDeps(String userId, String tenantId) {
+        List<OsGroup> groups = knowledgeMapper.getByDimIdUserIdRelTypeIdIsMain("1", userId, "1", MBoolean.YES.name(), tenantId);
+        return groups.size() > 0 ? (OsGroup)groups.get(0) : null;
+    }
 }

+ 81 - 0
src/main/resources/mapper/knowledge/KnowledgeMapper.xml

@@ -242,6 +242,87 @@
         )
     </select>
 
+    <update id="transferAuthor">
+        update KM_KNOWLEDGE
+        set CREATE_BY_ = #{arriveAuthor},AUTHOR = #{arriveAuthorName},UPDATE_TIME_ = sysdate
+        where CREATE_BY_ in
+        <foreach collection="authorList" open="(" close=")" item="authorId" separator=",">
+            #{authorId}
+        </foreach>
+        and IS_DEL = 0 and IS_DRAFT = 1 and APPROVAL_STATUS = 5
+    </update>
+
+    <select id="getAllUsersByGroupId" parameterType="java.util.Map" resultType="com.redxun.knowledge.entity.vo.OsUser">
+        <if test="@rx.Ognl@isNotEmpty(w.groupIds)">
+            select DISTINCT u.* from LEARNING_USER_DEV.os_user u
+            inner join LEARNING_USER_DEV.os_inst_users os on os.USER_ID_=u.USER_ID_
+            left join LEARNING_USER_DEV.os_rel_inst i on u.user_id_=i.PARTY2_
+            join KM_KNOWLEDGE kk on kk.CREATE_BY_ = u.USER_ID_
+            where os.user_id_ in (
+            select party2_ from LEARNING_USER_DEV.os_rel_inst where party1_ in (
+            <foreach collection="w.groupIds" index="index" item="groupId" open="" close="" separator="union">
+                select group_id_ from LEARNING_USER_DEV.os_group where path_ like CONCAT((
+                select path_ from LEARNING_USER_DEV.os_group where group_id_ =
+                #{groupId}
+                ),'%')
+            </foreach>
+            ) and dim1_ = #{w.dim} ) and os.tenant_id_=#{w.tenantId} and kk.IS_DEL = 0 and kk.IS_DRAFT = 1 and kk.APPROVAL_STATUS = 5
+            <if test="@rx.Ognl@isNotEmpty(w.name)">
+                and u.fullname_ like '%${w.name}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.userNo)">
+                and u.user_no_ like '${w.userNo}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.email)">
+                and u.email_ like '${w.email}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.mobile)">
+                and u.MOBILE_ like '${w.mobile}%'
+            </if>
+        </if>
+        <if test="!@rx.Ognl@isNotEmpty(w.groupIds)">
+            <if test="@rx.Ognl@isNotEmpty(w.dim)">
+                select DISTINCT u.* from LEARNING_USER_DEV.os_user u
+                inner join LEARNING_USER_DEV.os_inst_users os on os.USER_ID_=u.USER_ID_
+                left join LEARNING_USER_DEV.os_rel_inst i on u.user_id_=i.PARTY2_
+                join KM_KNOWLEDGE kk on kk.CREATE_BY_ = u.USER_ID_
+                where os.user_id_ in (
+                select party2_ from LEARNING_USER_DEV.os_rel_inst where dim1_ = #{w.dim}
+                <if test="@rx.Ognl@isNotEmpty(w.rankLevel)">
+                    and PARTY1_ in (select group_id_ from LEARNING_USER_DEV.os_group where RANK_LEVEL_=#{w.rankLevel})
+                </if>
+                ) and os.tenant_id_=#{w.tenantId} and kk.IS_DEL = 0 and kk.IS_DRAFT = 1 and kk.APPROVAL_STATUS = 5
+            </if>
+            <if test="w.dim == null or w.dim == ''">
+                select DISTINCT u.* from LEARNING_USER_DEV.os_user u
+                inner join LEARNING_USER_DEV.os_inst_users os on os.USER_ID_=u.USER_ID_
+                left join LEARNING_USER_DEV.os_rel_inst i on u.user_id_=i.PARTY2_ where
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.name)">
+                and u.fullname_ like '%${w.name}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.userNo)">
+                and u.user_no_ like '${w.userNo}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.email)">
+                and u.email_ like '${w.email}%'
+            </if>
+            <if test="@rx.Ognl@isNotEmpty(w.mobile)">
+                and u.MOBILE_ like '${w.mobile}%'
+            </if>
+        </if>
+    </select>
+
+    <select id="getByDimIdUserIdRelTypeIdIsMain" resultType="com.redxun.knowledge.entity.dao.OsGroup" parameterType="java.util.Map">
+        select ou.*,asou.IS_MAIN_ from LEARNING_USER_DEV.OS_GROUP ou
+                                           JOIN (
+            select oi.PARTY1_,oi.IS_MAIN_ from LEARNING_USER_DEV.OS_REL_INST oi
+            WHERE oi.DIM1_=#{dimId} AND oi.REL_TYPE_ID_ = #{relTypeId} AND oi.PARTY2_ = #{userId}
+              AND oi.IS_MAIN_ = #{isMain} AND oi.TENANT_ID_ = #{tenantId}
+        ) asou ON ou.GROUP_ID_ = asou.PARTY1_
+
+    </select>
+
 
 </mapper>