cjl
2023-09-28 e94e5dbbfc544c558a09fb388e7f4d4341fe8ec4
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -472,8 +472,19 @@
    @Override
    public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
        List<Integer> unitList = unitResult();
        Integer codeId =  unitAreaCode();
        allocationPageCond.setUnitList(unitList);
        return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
        Page<AllocationPageExt> page =  this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
        if(CollectionUtils.isNotEmpty(page.getRecords())){
            page.getRecords().forEach(it->{
                if((CollectionUtils.isEmpty(unitList)&&codeId.equals(1))||codeId.equals(2)){
                    it.setIsApprove(1);
                }else {
                    it.setIsApprove(0);
                }
            });
        }
        return page;
    }
    @Override
@@ -610,4 +621,22 @@
        }
        return Arrays.asList(0);
    }
    @Override
    public Integer unitAreaCode() {
        QxUser user = UserHelper.getCurrentUser();
        List<Integer> userList = responsibilityUnitMapper.selectCodeList("JBD",user.getUserId());
        if(CollectionUtils.isNotEmpty(userList)){
            return 1;
        }
        if(Objects.nonNull(user.getUnitId())){
            String code = responsibilityUnitMapper.selectAreaCode(user.getUnitId());
            if(code.length()>6){
                return 0;
            }else {
                return 2;
            }
        }
        return 1;
    }
}