移除 commons-collections、commons-beanutils 依赖
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
*/
|
||||
package com.jeesite.common.utils.excel.fieldtype;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
import com.jeesite.modules.sys.entity.Post;
|
||||
import com.jeesite.modules.sys.service.PostService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 字段类型转换
|
||||
* @author ThinkGem
|
||||
@@ -21,7 +21,7 @@ import com.jeesite.modules.sys.service.PostService;
|
||||
*/
|
||||
public class PostListType implements FieldType {
|
||||
|
||||
private List<Post> postList;
|
||||
private final List<Post> postList;
|
||||
|
||||
public PostListType() {
|
||||
PostService postService = SpringUtils.getBean(PostService.class);
|
||||
@@ -49,10 +49,11 @@ public class PostListType implements FieldType {
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null) {
|
||||
if (val instanceof List) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Post> postList = (List<Post>) val;
|
||||
return ListUtils.extractToString(postList, "postName", ", ");
|
||||
// return ListUtils.extractToString(postList, "postName", ", ");
|
||||
return postList.stream().map(Post::getPostName).collect(Collectors.joining(", "));
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
*/
|
||||
package com.jeesite.common.utils.excel.fieldtype;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.utils.SpringUtils;
|
||||
import com.jeesite.modules.sys.entity.Role;
|
||||
import com.jeesite.modules.sys.service.RoleService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 字段类型转换
|
||||
* @author ThinkGem
|
||||
@@ -21,7 +21,7 @@ import com.jeesite.modules.sys.service.RoleService;
|
||||
*/
|
||||
public class RoleListType implements FieldType {
|
||||
|
||||
private List<Role> roleList;
|
||||
private final List<Role> roleList;
|
||||
|
||||
public RoleListType() {
|
||||
RoleService roleService = SpringUtils.getBean(RoleService.class);
|
||||
@@ -49,10 +49,11 @@ public class RoleListType implements FieldType {
|
||||
*/
|
||||
@Override
|
||||
public String setValue(Object val) {
|
||||
if (val != null) {
|
||||
if (val instanceof List) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Role> roleList = (List<Role>) val;
|
||||
return ListUtils.extractToString(roleList, "roleName", ", ");
|
||||
// return ListUtils.extractToString(roleList, "roleName", ", ");
|
||||
return roleList.stream().map(Role::getRoleName).collect(Collectors.joining(", "));
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 员工管理Entity
|
||||
@@ -148,8 +149,9 @@ public class Employee extends DataEntity<Employee> {
|
||||
|
||||
@ApiModelProperty("员工岗位关系")
|
||||
public String getEmployeePosts() {
|
||||
List<String> list = ListUtils.extractToList(employeePostList, "postCode");
|
||||
return StringUtils.join(list, ",");
|
||||
// List<String> list = ListUtils.extractToList(employeePostList, "postCode");
|
||||
// return StringUtils.join(list, ",");
|
||||
return employeePostList.stream().map(EmployeePost::getPostCode).collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
public void setEmployeePosts(String employeePosts) {
|
||||
|
||||
@@ -4,23 +4,6 @@
|
||||
*/
|
||||
package com.jeesite.modules.sys.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
@@ -32,6 +15,21 @@ import com.jeesite.modules.sys.entity.Office;
|
||||
import com.jeesite.modules.sys.service.CompanyService;
|
||||
import com.jeesite.modules.sys.service.OfficeService;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 公司管理Controller
|
||||
@@ -113,12 +111,16 @@ public class CompanyController extends BaseController {
|
||||
company = createNextNode(company);
|
||||
// 查询公司所关联的机构信息
|
||||
if (StringUtils.isNotBlank(company.getCompanyCode())){
|
||||
Office office = new Office();
|
||||
office.setCompanyCode(company.getCompanyCode());
|
||||
List<Office> officeList = officeService.findList(office);
|
||||
model.addAttribute("officeList", officeList);
|
||||
model.addAttribute("officeCodes", ListUtils.extractToString(officeList, "officeCode", ","));
|
||||
model.addAttribute("officeNames", ListUtils.extractToString(officeList, "officeName", ","));
|
||||
Office where = new Office();
|
||||
where.setCompanyCode(company.getCompanyCode());
|
||||
List<String> officeCodes = ListUtils.newArrayList();
|
||||
List<String> officeNames = ListUtils.newArrayList();
|
||||
officeService.findList(where).forEach(e -> {
|
||||
officeCodes.add(e.getOfficeCode());
|
||||
officeNames.add(e.getOfficeCode());
|
||||
});
|
||||
model.addAttribute("officeCodes", StringUtils.join(officeCodes, ","));
|
||||
model.addAttribute("officeNames", StringUtils.join(officeNames, ","));
|
||||
}
|
||||
model.addAttribute("company", company);
|
||||
model.addAttribute("ctrlPermi", Global.getConfig("user.adminCtrlPermi", "2"));
|
||||
|
||||
Reference in New Issue
Block a user