cjl
2023-09-27 b8fe4c7b5f4f03dcfadff95702a07040ab9a1b57
screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java
@@ -18,6 +18,7 @@
import com.moral.api.service.AllocationExtensionService;
import com.moral.api.service.ApproveTableService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
@@ -69,9 +70,9 @@
    @Autowired
    private SysDictTypeMapper sysDictTypeMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private ResponsibilityUnitMapper responsibilityUnitMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
@@ -455,6 +456,8 @@
    @Override
    public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) {
        List<Integer> unitList = unitResult();
        allocationPageCond.setUnitList(unitList);
        return this.baseMapper.extPage(allocationPageCond.getPage().convertPage(), allocationPageCond);
    }
@@ -576,4 +579,19 @@
        fileTableService.upDateResult(allocationExtensionAddCond.getFileList(),allocationExtension.getId(), FileTableEnum.ALLOCATION_EXTENSION.value);
        return true;
    }
    @Override
    public List<Integer>  unitResult() {
        QxUser user = UserHelper.getCurrentUser();
        Integer unitId = Objects.nonNull(user.getUnitId())?user.getUnitId():0;
        List<Integer> userList = responsibilityUnitMapper.selectCodeList("JBD",user.getUserId());
        if(CollectionUtils.isNotEmpty(userList)){
            return new ArrayList<>();
        }
        userList = responsibilityUnitMapper.selectResultList(unitId);
        if(CollectionUtils.isNotEmpty(userList)){
            return userList;
        }
        return Arrays.asList(0);
    }
}