| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package cn.com.lzt.common.service.impl;
- import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
- import org.jeecgframework.core.util.oConvertUtils;
- import org.jeecgframework.web.system.service.SystemService;
- import org.jeecgframework.workflow.service.RuletoUserServiceI;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Map;
- @Service("ruletoUserServiceI")
- @Transactional
- public class RuletoUserServiceImpl extends CommonServiceImpl implements RuletoUserServiceI {
- /**
- * 通过角色code自定义查询获取用户信息
- *
- * @param tableName
- * 业务表单表名
- * @param id
- * 业务主键id
- * @param rolecodeList
- * 当前节点的角色code 集合
- * @return 需要处理该流程的人员的userName 的集合
- */
- @Autowired
- private SystemService systemService;
- @Override
- public List<String> getUsernameListByrolecodes(String tableName, String id, List<String> rolecodeList) {
- List<String> userlist = new ArrayList<>();
- if (!org.jeecgframework.core.util.ListUtils.isNullOrEmpty(rolecodeList)) {
- for (String rolecode : rolecodeList) {
- List<Map<String, Object>> roleUserlist = systemService.findForJdbc("SELECT"+
- " us.username"+
- " FROM"+
- " t_s_role_user ru"+
- " LEFT JOIN t_s_role r ON ru.roleid = r.id"+
- " LEFT JOIN t_s_base_user us ON ru.userid = us.id"+
- " WHERE"+
- " r.rolecode =? " , rolecode);
-
- if (!org.jeecgframework.core.util.ListUtils.isNullOrEmpty(roleUserlist)) {
- for (int i = 0; i < roleUserlist.size(); i++) {
- userlist.add(oConvertUtils.getString(roleUserlist.get(i).get("username")));
- }
- }
- }
- }
- return userlist;
- }
- }
|