RuletoUserServiceImpl.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package cn.com.lzt.common.service.impl;
  2. import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
  3. import org.jeecgframework.core.util.oConvertUtils;
  4. import org.jeecgframework.web.system.service.SystemService;
  5. import org.jeecgframework.workflow.service.RuletoUserServiceI;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import org.springframework.transaction.annotation.Transactional;
  9. import java.util.ArrayList;
  10. import java.util.List;
  11. import java.util.Map;
  12. @Service("ruletoUserServiceI")
  13. @Transactional
  14. public class RuletoUserServiceImpl extends CommonServiceImpl implements RuletoUserServiceI {
  15. /**
  16. * 通过角色code自定义查询获取用户信息
  17. *
  18. * @param tableName
  19. * 业务表单表名
  20. * @param id
  21. * 业务主键id
  22. * @param rolecodeList
  23. * 当前节点的角色code 集合
  24. * @return 需要处理该流程的人员的userName 的集合
  25. */
  26. @Autowired
  27. private SystemService systemService;
  28. @Override
  29. public List<String> getUsernameListByrolecodes(String tableName, String id, List<String> rolecodeList) {
  30. List<String> userlist = new ArrayList<>();
  31. if (!org.jeecgframework.core.util.ListUtils.isNullOrEmpty(rolecodeList)) {
  32. for (String rolecode : rolecodeList) {
  33. List<Map<String, Object>> roleUserlist = systemService.findForJdbc("SELECT"+
  34. " us.username"+
  35. " FROM"+
  36. " t_s_role_user ru"+
  37. " LEFT JOIN t_s_role r ON ru.roleid = r.id"+
  38. " LEFT JOIN t_s_base_user us ON ru.userid = us.id"+
  39. " WHERE"+
  40. " r.rolecode =? " , rolecode);
  41. if (!org.jeecgframework.core.util.ListUtils.isNullOrEmpty(roleUserlist)) {
  42. for (int i = 0; i < roleUserlist.size(); i++) {
  43. userlist.add(oConvertUtils.getString(roleUserlist.get(i).get("username")));
  44. }
  45. }
  46. }
  47. }
  48. return userlist;
  49. }
  50. }