Commit 040712b0 authored by zhangyingbin's avatar zhangyingbin

开发根据项目ID获取项目详情接口

parent e2a5e401
......@@ -198,4 +198,6 @@ public class ProjectDto extends BaseDto {
* 组织机构代码
*/
private String creditCode;
private String completionEstimateString;
}
......@@ -134,9 +134,7 @@ public class ProjectController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个项目信息表", notes = "根据sequenceNbr查询单个项目信息表")
public ResponseModel<ProjectDto> selectOne(@PathVariable Long sequenceNbr) {
ProjectDto projectDto = projectServiceImpl.queryBySeq(sequenceNbr);
projectDto.setStartDateString(new SimpleDateFormat("yyy-MM-dd HH:mm:ss").format(projectDto.getStartDate()));
return ResponseHelper.buildResponse(projectServiceImpl.queryBySeq(sequenceNbr));
return ResponseHelper.buildResponse(projectServiceImpl.selectById(sequenceNbr));
}
/**
......
......@@ -35,7 +35,9 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp
pipeMapper.delete(lambda);
userList.forEach(item -> {
item.setStartPosition(item.getStartPositionObject().getString("latitude")+","+item.getStartPositionObject().getString("longitude"));
item.setStartName(item.getStartPositionObject().getString("address"));
item.setEndPosition(item.getEndPositionObject().getString("latitude")+","+item.getEndPositionObject().getString("longitude"));
item.setEndName(item.getEndPositionObject().getString("address"));
item.setProjectId(projectId);
this.createWithModel(item);
});
......
......@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum;
import com.yeejoin.amos.boot.module.ugp.api.Enum.WhetherItPassEnum;
import com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant;
import com.yeejoin.amos.boot.module.ugp.api.dto.PipeDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectProcessDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.*;
......@@ -147,6 +148,40 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
}
}
/**
* 根据项目id获取项目详情
*/
public ProjectDto selectById(Long sequenceNbr){
ProjectDto projectDto = this.queryBySeq(sequenceNbr);
LambdaQueryWrapper<Pipe> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Pipe::getProjectId,sequenceNbr);
List<Pipe> pipeList = pipeService.list(wrapper);
List<PipeDto> pipeDtoList = new ArrayList<>();
for(Pipe pipe:pipeList){
PipeDto pipeDto = new PipeDto();
BeanUtils.copyProperties(pipe,pipeDto);
if(pipe.getStartPosition().contains(",")) {
String[] position = pipe.getStartPosition().split(",");
JSONObject jsonObject = new JSONObject();
jsonObject.put("latitude",position[0]);
jsonObject.put("longitude",position[1]);
jsonObject.put("address",pipe.getStartName());
pipeDto.setStartPositionObject(jsonObject);
}
if(pipe.getEndPosition().contains(",")) {
String[] position = pipe.getEndPosition().split(",");
JSONObject jsonObject = new JSONObject();
jsonObject.put("latitude",position[0]);
jsonObject.put("longitude",position[1]);
jsonObject.put("address",pipe.getEndName());
pipeDto.setEndPositionObject(jsonObject);
}
pipeDtoList.add(pipeDto);
}
projectDto.setPipeSubForm(pipeDtoList);
return projectDto;
}
// 静态变量存储最大值
private static final AtomicInteger atomicNum = new AtomicInteger();
private static final Integer INIT_CODE_NUM = 0;
......
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