Search in sources :

Example 1 with SysRolesJurisdictionInfo

use of tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method findzTreeRole.

@Override
public List<AuthorityzTreeVO> findzTreeRole(String id, String roleUuid) {
    List<AuthorityzTreeVO> list = null;
    List<SysMenuInfo> listt = sysMenuDao.findAllByParentsIdOrderByF_SortCode(id);
    if (listt != null && listt.size() > 0) {
        list = new ArrayList<>();
        for (SysMenuInfo sysMenuInfo : listt) {
            AuthorityzTreeVO vo = new AuthorityzTreeVO();
            vo.setId(sysMenuInfo.getUuid());
            vo.setName(sysMenuInfo.getName());
            vo.setIcon(sysMenuInfo.getIcon());
            vo.setUrl(sysMenuInfo.getUri());
            SysRolesJurisdictionInfo jurisdiction = new SysRolesJurisdictionInfo();
            SysRolesJurisdictionInfoPK pk = new SysRolesJurisdictionInfoPK(sysMenuInfo.getUuid(), roleUuid);
            jurisdiction = sysRolesJurisdictionDao.findById(SysRolesJurisdictionInfo.class, pk);
            if (jurisdiction != null) {
                vo.setChecked(jurisdiction.getChecked());
            }
            List<AuthorityzTreeVO> listt1 = findzTreeRole(sysMenuInfo.getUuid(), roleUuid);
            if (listt1 != null) {
                vo.getChildren().addAll(listt1);
            }
            list.add(vo);
        }
    }
    return list;
}
Also used : AuthorityzTreeVO(tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO) SysRolesJurisdictionInfo(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo) SysRolesJurisdictionInfoPK(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfoPK) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)

Example 2 with SysRolesJurisdictionInfo

use of tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo in project danyuan-application by 514840279.

the class SysRolesJurisdictionController method save.

@ApiOperation(value = "修改角色权限信息", notes = "")
@RequestMapping(path = "/saveAll", method = RequestMethod.POST)
@ResponseBody
public String save(@RequestBody SysRolesJurisdictionVo vo) {
    logger.info("saveAll", SysRolesJurisdictionController.class);
    try {
        for (SysRolesJurisdictionInfo info : vo.getSysRolesJurisdictionInfolist()) {
            System.out.println(info.toString());
            sysRolesJurisdictionService.save(info);
        }
        return "1";
    } catch (Exception e) {
        return "0";
    }
}
Also used : SysRolesJurisdictionInfo(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with SysRolesJurisdictionInfo

use of tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo in project danyuan-application by 514840279.

the class SysRolesJurisdictionServiceImpl method findAllBySearchText.

/**
 * 方法名 : findAllBySearchText
 * 功 能 : TODO(这里用一句话描述这个方法的作用)
 * 参 数 : @param pageNumber
 * 参 数 : @param pageSize
 * 参 数 : @param info
 * 参 数 : @return
 * 参 考 : @see
 * tk.ainiyue.danyuan.application.crm.jurisdiction.service.SysRolesJurisdictionService#findAllBySearchText(int,
 * int,
 * tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo)
 * 作 者 : Administrator
 */
@Override
public Page<SysRolesJurisdictionInfo> findAllBySearchText(int pageNumber, int pageSize, SysRolesJurisdictionInfo info) {
    Example<SysRolesJurisdictionInfo> example = Example.of(info);
    Sort sort = new Sort(new Order(Direction.DESC, "createTime"));
    PageRequest request = new PageRequest(pageNumber - 1, pageSize, sort);
    Page<SysRolesJurisdictionInfo> sourceCodes = sysRolesJurisdictionDao.findAll(example, request);
    return sourceCodes;
}
Also used : Order(org.springframework.data.domain.Sort.Order) PageRequest(org.springframework.data.domain.PageRequest) SysRolesJurisdictionInfo(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo) Sort(org.springframework.data.domain.Sort)

Aggregations

SysRolesJurisdictionInfo (tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo)3 ApiOperation (io.swagger.annotations.ApiOperation)1 PageRequest (org.springframework.data.domain.PageRequest)1 Sort (org.springframework.data.domain.Sort)1 Order (org.springframework.data.domain.Sort.Order)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1 SysRolesJurisdictionInfoPK (tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfoPK)1 SysMenuInfo (tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)1 AuthorityzTreeVO (tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO)1