|
|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.hotent.base.query.PageList;
|
|
|
import com.hotent.base.util.StringUtil;
|
|
|
import com.hotent.baseInfo.model.CostCatalog;
|
|
|
import com.hotent.baseInfo.model.CostDocumentWh;
|
|
|
@@ -16,9 +17,14 @@ import com.hotent.baseInfo.resp.AuditedUnitDetailResp;
|
|
|
import com.hotent.baseInfo.resp.CostDocumentWhDetailResp;
|
|
|
import com.hotent.constant.BaseConstant;
|
|
|
import com.hotent.req.IdReq;
|
|
|
+import com.hotent.uc.api.model.IUser;
|
|
|
import com.hotent.uc.exception.BaseException;
|
|
|
+import com.hotent.uc.manager.UserManager;
|
|
|
+import com.hotent.uc.model.User;
|
|
|
+import com.hotent.uc.util.ContextUtil;
|
|
|
import com.hotent.util.AreaCodeUtil;
|
|
|
import com.hotent.util.CopyUtil;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -43,7 +49,8 @@ import com.hotent.base.util.BeanUtils;
|
|
|
*/
|
|
|
@Service
|
|
|
public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao, CostDocumentWh> implements CostDocumentWhManager {
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private UserManager userService;
|
|
|
@Override
|
|
|
public CostDocumentWhDetailResp getDetail(String id) {
|
|
|
CostDocumentWh costDocumentWh = this.get(id);
|
|
|
@@ -169,9 +176,9 @@ public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage<CostDocumentWh> getDocumentWhList(CostDocumentWhPageReq req) {
|
|
|
+ public PageList<CostDocumentWh> getDocumentWhList(CostDocumentWhPageReq req) throws Exception {
|
|
|
// 构建查询条件
|
|
|
- LambdaQueryWrapper<CostDocumentWh> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ /*LambdaQueryWrapper<CostDocumentWh> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(CostDocumentWh::getIsDeleted, BaseConstant.NORMAL_STATUS);
|
|
|
|
|
|
// 根据查询条件过滤
|
|
|
@@ -180,11 +187,25 @@ public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao
|
|
|
}
|
|
|
if (StringUtil.isNotEmpty(req.getWhName())) {
|
|
|
queryWrapper.like(CostDocumentWh::getWhName, req.getWhName());
|
|
|
- }
|
|
|
+ }*/
|
|
|
// 创建分页对象
|
|
|
- Page<CostDocumentWh> page = new Page<>(req.getPageNum(), req.getPageSize());
|
|
|
+ Page<CostDocumentWh> page = new Page<>(req.getPage(), req.getPageSize());
|
|
|
+
|
|
|
+ //Page<CostDocumentWh> respPage = this.page(page, queryWrapper);
|
|
|
+
|
|
|
+ IUser iUser = ContextUtil.getCurrentUser();
|
|
|
+ User user = userService.getByAccount(iUser.getAccount());
|
|
|
+ req.setDataScope(user.getDataScope());
|
|
|
+ req.setProvinceCode(user.getProvinceCode());
|
|
|
+ req.setCityCode(user.getCityCode());
|
|
|
+ req.setCountyCode(user.getCountyCode());
|
|
|
+
|
|
|
+ Page<CostDocumentWh> respPage= baseMapper.getPageList(page,req.getDataScope()
|
|
|
+ ,req.getProvinceCode(),req.getCityCode()
|
|
|
+ ,req.getCountyCode()
|
|
|
+ ,req.getWhType()
|
|
|
+ ,req.getWhName());
|
|
|
|
|
|
- Page<CostDocumentWh> respPage = this.page(page, queryWrapper);
|
|
|
List<CostDocumentWh> records = respPage.getRecords();
|
|
|
for (CostDocumentWh costDocumentWh : records) {
|
|
|
|
|
|
@@ -193,8 +214,7 @@ public class CostDocumentWhManagerImpl extends BaseManagerImpl<CostDocumentWhDao
|
|
|
.replace("{year}", costDocumentWh.getYear()).replace("{currentValue}", costDocumentWh.getCurrentValue().toString());
|
|
|
costDocumentWh.setWhNo(replace);
|
|
|
}
|
|
|
-
|
|
|
- return respPage;
|
|
|
+ return new PageList<>(respPage);
|
|
|
}
|
|
|
|
|
|
|