//Get Department IDString orgId =Resourceutil.getusersystemdata (databaseconstant.sys_org_id); List<Map<String,String>> deptsids=Systemservice.getdeptids (orgId); StringBuffer Codes=NewStringBuffer (); for(map<string,string>map:deptsids) {String Orgcode= Map.get ("Org_code"); Codes.append (Orgcode). Append (","); } if(Stringutil.isnotempty (codes)) {Codes.deletecharat (Codes.length ()-1); } String Usersql= "SELECT * from T_s_base_user where ID in (select user_id from t_s_user_org tsuo,t_s_depart TSD where Tsuo.org_id=tsd.id a nd tsd.org_code in ("+codes+")) "; List<Object> users=Systemservice.findlistbysql (Usersql); Map<String,String> Salesmans =NewHashmap<string,string>(); for(inti = 0; I < users.size (); i++) {object[] DC=(object[]) users.get (i); String name= Dc[4].tostring (); String ID=dc[0].tostring (); Salesmans.put (ID, name); } req.setattribute ("Salesmans", Salesmans);
Get all the people in the current department