|
|
@@ -12,8 +12,12 @@ import com.hotent.baseInfo.manager.CostCatalogManager;
|
|
|
import com.hotent.baseInfo.req.CostCatalogPageReq;
|
|
|
import com.hotent.base.manager.impl.BaseManagerImpl;
|
|
|
import com.hotent.constant.BaseConstant;
|
|
|
+import com.hotent.uc.api.model.IUser;
|
|
|
+import com.hotent.uc.manager.UserManager;
|
|
|
+import com.hotent.uc.model.User;
|
|
|
import com.hotent.uc.util.ContextUtil;
|
|
|
import com.hotent.util.CopyUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -35,6 +39,10 @@ import com.hotent.base.util.StringUtil;
|
|
|
@Service
|
|
|
public class CostCatalogManagerImpl extends BaseManagerImpl<CostCatalogDao, CostCatalog> implements CostCatalogManager {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserManager userService;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public CostCatalog getDetail(String id) {
|
|
|
CostCatalog costCatalog = this.get(id);
|
|
|
@@ -64,7 +72,7 @@ public class CostCatalogManagerImpl extends BaseManagerImpl<CostCatalogDao, Cost
|
|
|
// }
|
|
|
|
|
|
@Override
|
|
|
- public List<CostCatalog> getCatalogList(CostCatalogPageReq req) {
|
|
|
+ public List<CostCatalog> getCatalogList(CostCatalogPageReq req) throws Exception {
|
|
|
// 获取所有未删除的数据
|
|
|
LambdaQueryWrapper<CostCatalog> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(CostCatalog::getIsDeleted, "0");
|
|
|
@@ -77,6 +85,12 @@ public class CostCatalogManagerImpl extends BaseManagerImpl<CostCatalogDao, Cost
|
|
|
if (StringUtil.isNotEmpty(req.getCatalogName())) {
|
|
|
queryWrapper.like(CostCatalog::getCatalogName, req.getCatalogName());
|
|
|
}
|
|
|
+
|
|
|
+ IUser iUser = ContextUtil.getCurrentUser();
|
|
|
+ User user = userService.getByAccount(iUser.getAccount());
|
|
|
+ if (user!=null) {
|
|
|
+ queryWrapper.like(CostCatalog::getPriceLevel,user.getDataScope());
|
|
|
+ }
|
|
|
List<CostCatalog> allCatalogs = this.list(queryWrapper);
|
|
|
//
|
|
|
// // 如果没有查询条件,返回所有数据
|