Commit debf4784 authored by zhangyingbin's avatar zhangyingbin

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents afc4b181 eed9a730
...@@ -235,4 +235,12 @@ public class WeldController extends BaseController { ...@@ -235,4 +235,12 @@ public class WeldController extends BaseController {
public ResponseModel<List<List<Double>>> getWeldCode(@PathVariable String projectId){ public ResponseModel<List<List<Double>>> getWeldCode(@PathVariable String projectId){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldCode(projectId)); return ResponseHelper.buildResponse(weldServiceImpl.getWeldCode(projectId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getWeldListByLocation/{northeast}/{southwest}")
@ApiOperation(httpMethod = "GET", value = "", notes = "")
public ResponseModel<List<String>> getWeldListByLocation(@PathVariable( value = "northeast")Object object,@PathVariable( value = "southwest")Object obj){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldListByLocation(object,obj));
}
} }
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -12,29 +13,21 @@ import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum; ...@@ -12,29 +13,21 @@ import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.StageEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum; import com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum;
import com.yeejoin.amos.boot.module.ugp.api.dto.OrgUsrDto; import com.yeejoin.amos.boot.module.ugp.api.dto.*;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectInitiationDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.WeldVerifyDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.*; import com.yeejoin.amos.boot.module.ugp.api.entity.*;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService;
import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService; import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.thymeleaf.expression.Ids;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -43,7 +36,6 @@ import java.io.IOException; ...@@ -43,7 +36,6 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/** /**
* 焊口信息表服务实现类 * 焊口信息表服务实现类
...@@ -73,6 +65,9 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -73,6 +65,9 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
@Autowired @Autowired
OrgUsrServiceImpl orgUsrServiceImpl; OrgUsrServiceImpl orgUsrServiceImpl;
@Autowired
ProjectServiceImpl projectService;
// Logger logger = LoggerFactory.getLogger(WeldServiceImpl.class); // Logger logger = LoggerFactory.getLogger(WeldServiceImpl.class);
...@@ -374,4 +369,32 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements ...@@ -374,4 +369,32 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
return list; return list;
} }
/**
* 根据地图经纬度信息获取项目id
* @param object
* @param obj
* @return
*/
public List<String> getWeldListByLocation(Object object,Object obj){
JSONObject jsonObject = JSON.parseObject(String.valueOf(object));
Double leftLongitude = jsonObject.getDouble("longitude");
Double leftLatitude = jsonObject.getDouble("latitude");
JSONObject json = JSON.parseObject(String.valueOf(obj));
Double rightLongitude = json.getDouble("longitude");
Double rightLatitude = json.getDouble("latitude");
List<ProjectDto> projectList = projectService.getProjectLocation();
List<String> projectIds = new ArrayList<>();
for(ProjectDto projectDto:projectList){
if(!ValidationUtil.isEmpty(projectDto.getLatitude()) && !ValidationUtil.isEmpty(projectDto.getLongitude())) {
Double longitude = Double.valueOf(projectDto.getLongitude());
Double latitude = Double.valueOf(projectDto.getLatitude());
if (rightLongitude < longitude && longitude < leftLongitude && rightLatitude < latitude && latitude < leftLatitude) {
projectIds.add(String.valueOf(projectDto.getSequenceNbr()));
}
}
}
return projectIds;
}
} }
\ No newline at end of file
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