|
|
|
@ -36,7 +36,6 @@ import com.logpm.basicdata.mapper.BasicdataWarehouseMapper;
|
|
|
|
|
import com.logpm.basicdata.service.IBasicdataWarehouseService; |
|
|
|
|
import com.logpm.basicdata.vo.BasicdataWarehouseVO; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.checkerframework.checker.units.qual.A; |
|
|
|
|
import org.springblade.common.cache.CacheNames; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
@ -206,7 +205,15 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
|
|
|
|
|
String deptId = user.getDeptId(); |
|
|
|
|
log.info(">>> 部门 {}",deptId); |
|
|
|
|
String[] split = deptId.split(","); |
|
|
|
|
boolean flag = false; |
|
|
|
|
for (String s : split) { |
|
|
|
|
Dept d = deptClient.findEntityById(Long.parseLong(s)); |
|
|
|
|
Integer deptCategory = d.getDeptCategory(); |
|
|
|
|
if(deptCategory.equals(5)){ |
|
|
|
|
flag = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s)); |
|
|
|
|
if (Func.isEmpty(userDeptNode)) { |
|
|
|
|
continue; |
|
|
|
@ -218,12 +225,14 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
|
|
|
|
|
deptIds.add(Long.parseLong(s)); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (deptIds.isEmpty()) { |
|
|
|
|
return null; |
|
|
|
|
if(flag){ |
|
|
|
|
results = baseMapper.getWarehouseList(); |
|
|
|
|
}else{ |
|
|
|
|
if (deptIds.isEmpty()) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
results=baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds)) ; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
results=baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds)) ; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_OWN, user.getUserId()),results,3600L); |
|
|
|
|