|
@@ -63,60 +63,9 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
@Log(title = ModularConstans.monthly, businessType = BusinessType.QUERY)
|
|
|
public AjaxResult page(@NotEmpty(message = "数据为空")
|
|
|
@RequestBody MonthlyReconciliationPageReqVo vo) {
|
|
|
- LambdaQueryWrapper<MonthlyReconciliation> lw = new LambdaQueryWrapper<>();
|
|
|
- if (!StringUtils.isBlank(vo.getProjectName())) {
|
|
|
- lw.like(MonthlyReconciliation::getProjectName, vo.getProjectName());
|
|
|
- }
|
|
|
- if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
|
|
|
- lw.eq(MonthlyReconciliation::getProjectStatus, vo.getProjectStatus());
|
|
|
- }
|
|
|
- if (!StringUtils.isBlank(vo.getPurchaseServices())) {
|
|
|
- lw.eq(MonthlyReconciliation::getPurchaseServices, vo.getPurchaseServices());
|
|
|
- }
|
|
|
- if (!ObjectUtils.isEmpty(vo.getStartTime())) {
|
|
|
- lw.ge(MonthlyReconciliation::getPlanDemandSubTime, vo.getStartTime());
|
|
|
- }
|
|
|
- if (!ObjectUtils.isEmpty(vo.getStartTime())) {
|
|
|
- lw.le(MonthlyReconciliation::getPlanDemandSubTime, vo.getEntTime());
|
|
|
- }
|
|
|
- if (!StringUtils.isBlank(vo.getWarnStatus())) {
|
|
|
- lw.eq(MonthlyReconciliation::getWarnStatus, vo.getWarnStatus());
|
|
|
- }
|
|
|
- // 添加数据权限
|
|
|
- List<String> roleKeys = getLoginUser().getUser().getRoles().stream().map(SysRole::getRoleKey).collect(Collectors.toList());
|
|
|
- if (roleKeys.contains(Constants.DEMAND_UNIT)) {
|
|
|
- // 需求单位
|
|
|
- /*(purchase_dept_id = 当前用户deptID) */
|
|
|
- lw.eq(MonthlyReconciliation::getPurchaseDeptId, getDeptId());
|
|
|
- } else if (roleKeys.contains(Constants.PURCHASING_MANAGEMENT)
|
|
|
- || roleKeys.contains(Constants.PURCHASE_SERVICES)) {
|
|
|
- // 采购管理部门 或 采购办
|
|
|
- SysDept sysDept = new SysDept();
|
|
|
- sysDept.setParentId(getDeptId());
|
|
|
- sysDept.setStatus("0");
|
|
|
- List<Long> childDeptIds = iSysDeptService.selectDeptList(sysDept)
|
|
|
- .stream()
|
|
|
- .map(SysDept::getDeptId)
|
|
|
- .collect(Collectors.toList());
|
|
|
- if(ObjectUtils.isEmpty(childDeptIds)){
|
|
|
- lw.and((wrapper) -> {
|
|
|
- wrapper.eq(MonthlyReconciliation::getIsExcess, 0);
|
|
|
- wrapper.eq(MonthlyReconciliation::getPurchaseDeptId, getDeptId());
|
|
|
- });
|
|
|
- }else {
|
|
|
- lw.and((wrapper) -> {
|
|
|
- wrapper.eq(MonthlyReconciliation::getIsExcess, 0);
|
|
|
- wrapper.eq(MonthlyReconciliation::getPurchaseDeptId, getDeptId());
|
|
|
- })
|
|
|
- .or((wrapper) -> {
|
|
|
- wrapper.eq(MonthlyReconciliation::getIsExcess, 1);
|
|
|
- wrapper.in(MonthlyReconciliation::getPurchaseDeptId, childDeptIds);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ vo.setDeptId(getDeptId());
|
|
|
// 分页查询
|
|
|
- IPage<MonthlyReconciliation> page = monthlyReconciliationService.page(new Page<>(vo.getPageNum(), vo.getPageSize()), lw);
|
|
|
+ IPage<MonthlyReconciliation> page = monthlyReconciliationService.queryPage(vo);
|
|
|
if (!ObjectUtils.isEmpty(page.getRecords()) && page.getRecords().size() > 0) {
|
|
|
page.setRecords(page.getRecords().stream().map(dto -> {
|
|
|
// 采购单位名称
|
|
@@ -125,15 +74,6 @@ public class MonthlyReconciliationController extends BaseController {
|
|
|
SysDeptResponseVo sysDept = (SysDeptResponseVo) stringObjectMap.get("sysDept");
|
|
|
dto.setPurchaseDeptName(sysDept.getDeptName());
|
|
|
}
|
|
|
- // todo 采购服务站名称 要修改为单位管理里面的
|
|
|
-// List<SysDictData> data = dictTypeService.selectDictDataByType(Constants.PURCHASE_SERVICES);
|
|
|
-// if (!ObjectUtils.isEmpty(data)) {
|
|
|
-// List<SysDictData> collect = data.stream()
|
|
|
-// .filter(d -> d.getDictValue().equals(dto.getPurchaseServices())).collect(Collectors.toList());
|
|
|
-// if (!ObjectUtils.isEmpty(collect)) {
|
|
|
-// dto.setPurchaseServicesName(collect.get(0).getDictLabel());
|
|
|
-// }
|
|
|
-// }
|
|
|
// 项目状态
|
|
|
List<SysDictData> projectStatus = dictTypeService.selectDictDataByType(Constants.SYS_PROJECT_STATUS);
|
|
|
if (!ObjectUtils.isEmpty(projectStatus)) {
|