Commit 5783b983 authored by zhangyingbin's avatar zhangyingbin

ugp地图接口开发

parent e96cb6f8
......@@ -114,4 +114,16 @@ public class ProjectDto extends BaseDto {
private String companyType;
private String length;
/**
*经度
*/
@TableField("longitude")
private String longitude;
/**
*纬度
*/
@TableField("latitude")
private String latitude;
}
......@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
......@@ -21,6 +22,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Company;
import com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule;
import com.yeejoin.amos.boot.module.ugp.api.entity.UnitLicence;
import com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.*;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
......@@ -560,5 +562,17 @@ public class CompanyController extends BaseController {
orgServiceImpl.getReginParams();
}
/**
* 获取当前登陆人所在单位的区域代码
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getCompanyRegionCode")
@ApiOperation(httpMethod = "GET", value = "获取当前登陆人所在单位的区域代码", notes = "获取当前登陆人所在单位的区域代码")
@BusinessIdentify
public ResponseModel<Company> getCompanyRegionCode(){
ReginParams reginParams = orgServiceImpl.getReginParams();
return ResponseHelper.buildResponse(companyServiceImpl.getById(reginParams.getBusinessInfo().getCompanySequenceNbr()));
}
}
......@@ -432,6 +432,16 @@ public class ProjectController extends BaseController {
return ResponseHelper.buildResponse(projectServiceImpl.projectInProgress());
}
/**
* 获取当前登陆人所在单位下的项目的项目信息(包含经纬度信息)
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "获取当前登陆人所在单位下的项目的项目信息(包含经纬度信息)", notes = "获取当前登陆人所在单位下的项目的项目信息(包含经纬度信息)")
@GetMapping(value = "/getProjectLocation")
public ResponseModel<List<ProjectDto>> getProjectLocation(){
return ResponseHelper.buildResponse(projectServiceImpl.getProjectLocation());
}
}
......@@ -218,8 +218,8 @@ public class WeldController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getWeldList")
@ApiOperation(httpMethod = "GET", value = "获取焊口定位信息", notes = "获取焊口定位信息")
public ResponseModel<List<Weld>> getWeldList(@RequestParam( value = "region",required = false )String region){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldList(region));
public ResponseModel<List<Weld>> getWeldList(@RequestParam( value = "projectId",required = false )String projectId){
return ResponseHelper.buildResponse(weldServiceImpl.list(new LambdaQueryWrapper<Weld>().eq(Weld::getProjectId,projectId)));
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
......@@ -231,11 +231,8 @@ public class WeldController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getWeldCode")
@ApiOperation(httpMethod = "GET", value = "获取焊口定位信息", notes = "获取焊口定位信息")
@ApiOperation(httpMethod = "GET", value = "获取焊口定位信息List(只有经纬度信息)", notes = "获取焊口定位信息List(只有经纬度信息)")
public ResponseModel<List<List<String>>> getWeldCode(String projectId){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldCode(projectId));
}
}
......@@ -57,9 +57,11 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@Autowired
ProjectResourceMapper projectResourceMapper;
@Autowired
AttachmentServiceImpl attachmentServiceImpl;
@Autowired
WeldServiceImpl weldServiceImpl;
/**
* 分页查询
*/
......@@ -415,4 +417,33 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
}
return null;
}
/**
* 获取当前登陆人所在单位下的项目的项目信息(包含经纬度信息)
* @return
*/
public List<ProjectDto> getProjectLocation(){
List<Project> projectList = projectResourceService.getProjectList();
List<ProjectDto> projectDtoList = new ArrayList<>();
if(!ValidationUtil.isEmpty(projectList)){
for (Project project : projectList) {
ProjectDto projectDto = new ProjectDto();
BeanUtils.copyProperties(project,projectDto);
List<Weld> weldList = weldServiceImpl.list(new LambdaQueryWrapper<Weld>().eq(Weld::getProjectId,project.getSequenceNbr()));
if(!ValidationUtil.isEmpty(weldList)){
for (Weld weld : weldList) {
String longitude = weld.getLongitude();
String latitude = weld.getLatitude();
if (!ValidationUtil.isEmpty(longitude) && !ValidationUtil.isEmpty(latitude)) {
projectDto.setLongitude(longitude);
projectDto.setLatitude(latitude);
break;
}
}
}
projectDtoList.add(projectDto);
}
}
return projectDtoList;
}
}
\ No newline at end of file
......@@ -357,18 +357,6 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
page.setRecords(list);
return page;
}
/**
* 获取焊口定位信息
*/
public List<Weld> getWeldList(String region){
List<Project> projectList = projectResourceService.getProjectList();
Set<String> ids = new HashSet<>();
for (Project project : projectList) {
ids.add(String.valueOf(project.getSequenceNbr()));
}
List<Weld> weldList = weldMapper.getWeldList(region,ids);
return weldList;
}
public List<List<String>> getWeldCode(String projectId){
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper();
......
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