|  | @@ -16,6 +16,7 @@ import com.jeeplus.common.utils.*;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.utils.excel.ExportExcel;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.utils.excel.ImportExcel;
 | 
	
		
			
				|  |  |  import com.jeeplus.common.web.BaseController;
 | 
	
		
			
				|  |  | +import com.jeeplus.modules.projectrecord.dao.WorkProjectUserDao;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.sys.dao.UserDao;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.sys.entity.Office;
 | 
	
		
			
				|  |  |  import com.jeeplus.modules.sys.entity.Role;
 | 
	
	
		
			
				|  | @@ -39,6 +40,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 | 
	
		
			
				|  |  |  import org.apache.shiro.subject.PrincipalCollection;
 | 
	
		
			
				|  |  |  import org.apache.shiro.subject.SimplePrincipalCollection;
 | 
	
		
			
				|  |  |  import org.apache.shiro.subject.Subject;
 | 
	
		
			
				|  |  | +import org.jcodings.util.Hash;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Controller;
 | 
	
		
			
				|  |  |  import org.springframework.ui.Model;
 | 
	
	
		
			
				|  | @@ -58,10 +60,7 @@ import java.net.HttpURLConnection;
 | 
	
		
			
				|  |  |  import java.net.MalformedURLException;
 | 
	
		
			
				|  |  |  import java.net.URL;
 | 
	
		
			
				|  |  |  import java.net.URLDecoder;
 | 
	
		
			
				|  |  | -import java.util.ArrayList;
 | 
	
		
			
				|  |  | -import java.util.HashMap;
 | 
	
		
			
				|  |  | -import java.util.List;
 | 
	
		
			
				|  |  | -import java.util.Map;
 | 
	
		
			
				|  |  | +import java.util.*;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  /**
 | 
	
		
			
				|  |  |   * 用户Controller
 | 
	
	
		
			
				|  | @@ -87,6 +86,8 @@ public class UserController extends BaseController {
 | 
	
		
			
				|  |  |      private SysImportInfoService sysImportInfoService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private WorkStaffBasicInfoService workStaffBasicInfoService;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private WorkProjectUserDao workProjectUserDao;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ModelAttribute
 | 
	
		
			
				|  |  |      public User get(@RequestParam(required=false) String id) {
 | 
	
	
		
			
				|  | @@ -914,18 +915,41 @@ public class UserController extends BaseController {
 | 
	
		
			
				|  |  |      @RequiresPermissions("user")
 | 
	
		
			
				|  |  |      @ResponseBody
 | 
	
		
			
				|  |  |      @RequestMapping(value = "treeData")
 | 
	
		
			
				|  |  | -    public List<Map<String, Object>> treeData(@RequestParam(required=false) String officeId, HttpServletResponse response) {
 | 
	
		
			
				|  |  | +    public List<Map<String, Object>> treeData(@RequestParam(required=false) String projectId,@RequestParam(required=false) String officeId, HttpServletResponse response) {
 | 
	
		
			
				|  |  |          List<Map<String, Object>> mapList = Lists.newArrayList();
 | 
	
		
			
				|  |  | -        List<User> list = systemService.findUserByOfficeId(officeId);
 | 
	
		
			
				|  |  | -        for (int i=0; i<list.size(); i++){
 | 
	
		
			
				|  |  | -            User e = list.get(i);
 | 
	
		
			
				|  |  | -            Map<String, Object> map = Maps.newHashMap();
 | 
	
		
			
				|  |  | -            map.put("id", "u_"+e.getId());
 | 
	
		
			
				|  |  | -            map.put("pId", officeId);
 | 
	
		
			
				|  |  | -            String name = StringUtils.replace(e.getName(), " ", "");
 | 
	
		
			
				|  |  | -            name = StringEscapeUtils.unescapeHtml4(name);
 | 
	
		
			
				|  |  | -            map.put("name", name);
 | 
	
		
			
				|  |  | -            mapList.add(map);
 | 
	
		
			
				|  |  | +        if(StringUtils.isBlank(projectId)){
 | 
	
		
			
				|  |  | +            List<User> list = systemService.findUserByOfficeId(officeId);
 | 
	
		
			
				|  |  | +            for (int i=0; i<list.size(); i++){
 | 
	
		
			
				|  |  | +                User e = list.get(i);
 | 
	
		
			
				|  |  | +                Map<String, Object> map = Maps.newHashMap();
 | 
	
		
			
				|  |  | +                map.put("id", "u_"+e.getId());
 | 
	
		
			
				|  |  | +                map.put("pId", officeId);
 | 
	
		
			
				|  |  | +                String name = StringUtils.replace(e.getName(), " ", "");
 | 
	
		
			
				|  |  | +                name = StringEscapeUtils.unescapeHtml4(name);
 | 
	
		
			
				|  |  | +                map.put("name", name);
 | 
	
		
			
				|  |  | +                mapList.add(map);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +            List<User> list = systemService.findUserByOfficeId(officeId);
 | 
	
		
			
				|  |  | +            //查询项目组成员信息
 | 
	
		
			
				|  |  | +            List<User> members = workProjectUserDao.isDelFalg(projectId, "");
 | 
	
		
			
				|  |  | +            Set<String> setUser = new HashSet();
 | 
	
		
			
				|  |  | +            for (User user: members) {
 | 
	
		
			
				|  |  | +                setUser.add(user.getId());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            List<String> userIdList = new ArrayList<>(setUser);
 | 
	
		
			
				|  |  | +            for (int i=0; i<list.size(); i++){
 | 
	
		
			
				|  |  | +                User e = list.get(i);
 | 
	
		
			
				|  |  | +                if(userIdList.contains(e.getId())){
 | 
	
		
			
				|  |  | +                    Map<String, Object> map = Maps.newHashMap();
 | 
	
		
			
				|  |  | +                    map.put("id", "u_"+e.getId());
 | 
	
		
			
				|  |  | +                    map.put("pId", officeId);
 | 
	
		
			
				|  |  | +                    String name = StringUtils.replace(e.getName(), " ", "");
 | 
	
		
			
				|  |  | +                    name = StringEscapeUtils.unescapeHtml4(name);
 | 
	
		
			
				|  |  | +                    map.put("name", name);
 | 
	
		
			
				|  |  | +                    mapList.add(map);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return mapList;
 | 
	
		
			
				|  |  |      }
 |