Commit 4503fc28 authored by srx's avatar srx

项目焊工管理查看方法

parent 574d0a01
package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectResourceEnum;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class WelderServiceImpl {
@Autowired
OrgServiceImpl orgService;
@Autowired
ProjectServiceImpl projectService;
@Autowired
ProjectResourceServiceImpl projectResourceService;
@BusinessIdentify
public List<Map> getInfo(){
ReginParams reginParams = orgService.getReginParams();
ReginParams.BusinessInfo businessInfo = reginParams.getBusinessInfo();
Long companySequenceNbr = businessInfo.getCompanySequenceNbr();
//默认建设单位
LambdaQueryWrapper<Project> projectWrapper = new LambdaQueryWrapper<>();
projectWrapper.eq(Project::getConstructionUnitId,companySequenceNbr);
List<Project> projectList = projectService.list(projectWrapper);
List<Long> projectIdList = new ArrayList<>();
List<Long> welderIdList = new ArrayList<>();
for(Project project:projectList){
projectIdList.add(project.getSequenceNbr());
}
for(Long projectId:projectIdList){
LambdaQueryWrapper<ProjectResource> projectResourceWrapper = new LambdaQueryWrapper<>();
projectResourceWrapper.eq(ProjectResource::getType, ProjectResourceEnum.焊工资源.getCode())
.eq(ProjectResource::getProjectId,projectId);
List<ProjectResource> projectResourceList = projectResourceService.list(projectResourceWrapper);
for(ProjectResource projectResource : projectResourceList){
welderIdList.add(projectResource.getResourceId());
}
}
List<Map> mapList = new ArrayList<>();
for(Long welderId:welderIdList){
mapList.add(orgService.getdetialInfo(String.valueOf(welderId)));
}
return mapList;
}
public IPage<Map> getpageInfo(){
IPage<Map> page = new Page<>();
page.setSize(getInfo().size());
page.setCurrent(1L);
page.setRecords(getInfo());
page.setTotal(getInfo().size());
return page;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment