无关风月
昨天 995293880f5ca5c05ca94e53f5dac213b0155e3a
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OaApprovalServiceImpl.java
@@ -2,13 +2,12 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.constant.DictConstants;
import com.ruoyi.common.core.domain.entity.TDept;
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.system.mapper.OaApprovalMapper;
import com.ruoyi.system.mapper.TDeptMapper;
import com.ruoyi.system.model.OaApproval;
import com.ruoyi.system.query.ApprovalListQuery;
import com.ruoyi.system.query.ApprovalNodeListQuery;
import com.ruoyi.system.service.OaApprovalService;
import com.ruoyi.system.vo.system.ApprovalVO;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,11 +39,15 @@
        List<ApprovalVO> list = this.baseMapper.pageList(query,pageInfo);
        for (ApprovalVO approvalVO : list) {
            StringBuilder deptName = new StringBuilder();
            for (String deptId : approvalVO.getDeptIds().split(",")) {
                String orDefault = deptMaps.getOrDefault(Integer.parseInt(deptId), "");
                deptName.append(orDefault).append(",");
            if(StringUtils.hasLength(approvalVO.getDeptIds())&&approvalVO.getDeptIds().equals("-1")){
                approvalVO.setDeptName("所有部门");
            }else{
                for (String deptId : approvalVO.getDeptIds().split(",")) {
                    String orDefault = deptMaps.getOrDefault(Integer.parseInt(deptId), "");
                    deptName.append(orDefault).append(",");
                }
                approvalVO.setDeptName(deptName.substring(0,deptName.length()-1));
            }
            approvalVO.setDeptName(deptName.substring(0,deptName.length()-1));
        }
        pageInfo.setRecords(list);
        return pageInfo;