package com.javaweb.geotdp.controller;
|
|
import javax.validation.Valid;
|
|
import com.javaweb.geo.domain.HandleException;
|
import com.javaweb.geo.domain.HandleOpinion;
|
import com.javaweb.geotdp.vo.*;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.validation.BindingResult;
|
import org.springframework.web.bind.annotation.*;
|
|
import com.javaweb.common.core.controller.BaseController;
|
import com.javaweb.geotdp.domain.ResponseResult;
|
import com.javaweb.geotdp.service.impl.GeoDataServiceImpl;
|
|
@Controller
|
@RequestMapping("/geotdp")
|
public class GeoDataController extends BaseController {
|
|
@Autowired
|
private GeoDataServiceImpl geoDataServiceImpl;
|
|
@PostMapping("/test")
|
@ResponseBody
|
public ResponseResult test() {
|
return ResponseResult.success("网络通畅");
|
}
|
|
|
/**
|
* 上传公司信息
|
*
|
* @param
|
* @return
|
* @throws Exception
|
*/
|
@PostMapping("/company/uploadCompany")
|
@ResponseBody
|
public ResponseResult uploadCompany(@Valid @RequestBody CompanyVo companyVo, BindingResult bindingResult) throws Exception {
|
if (bindingResult.hasErrors()) {
|
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.uploadCompany(companyVo);
|
}
|
|
|
/**
|
* 上传人员
|
*
|
* @return
|
* @throws Exception
|
*/
|
@PostMapping("/compileUser/uploadUser")
|
@ResponseBody
|
public ResponseResult uploadUser(@Valid @RequestBody CompanyUserVo companyUserVo, BindingResult bindingResult) throws Exception {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.uploadUser(companyUserVo);
|
}
|
|
|
/**
|
* 上传项目
|
*
|
* @return
|
* @throws Exception
|
*/
|
@PostMapping("/project/uploadProject")
|
@ResponseBody
|
public ResponseResult uploadProject(@Valid @RequestBody ProjectVo projectVo, BindingResult bindingResult) throws Exception {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.uploadProject(projectVo);
|
}
|
|
|
/**
|
* 上传勘探点数据接口
|
*
|
* @return
|
*/
|
@PostMapping("/hole/uploadHole")
|
@ResponseBody
|
public ResponseResult uploadHole(@Valid @RequestBody HoleVo holeVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.uploadHole(holeVo);
|
|
}
|
|
|
/**
|
* 项目验收接口
|
*
|
* @return
|
*/
|
@PostMapping("/project/checkComplete")
|
@ResponseBody
|
public ResponseResult checkComplete(@Valid @RequestBody ProjectCheckVo projectCheckVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.checkComplete(projectCheckVo);
|
}
|
|
|
/**
|
* 项目验收状态变更接口
|
*
|
* @return
|
*/
|
@PostMapping("/project/updateStatus")
|
@ResponseBody
|
public ResponseResult updateStatus(@Valid @RequestBody ProjectCheckVo projectCheckVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.updateStatus(projectCheckVo);
|
}
|
|
|
/**
|
* 删除项目接口
|
*
|
* @return
|
*/
|
@PostMapping("/project/deleteProject")
|
@ResponseBody
|
public ResponseResult deleteProject(@RequestBody ProjectCheckVo projectCheckVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.deleteProject(projectCheckVo);
|
}
|
|
|
/**
|
* 勘探点状态变更接口
|
*
|
* @return
|
*/
|
@PostMapping("/hole/updateStatus")
|
@ResponseBody
|
public ResponseResult holeUpdateStatus(@RequestBody HoleVo holeVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.holeUpdateStatus(holeVo);
|
}
|
|
|
/**
|
* 获取劳务单位接口
|
*
|
* @return
|
*/
|
@PostMapping("/company/getLaborList")
|
@ResponseBody
|
public ResponseResult getLaborList(@Valid @RequestBody LaborUnitVo laborUnitVo, BindingResult bindingResult) throws Exception {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.getLaborList(laborUnitVo);
|
}
|
|
|
/**
|
* 获取三员信息接口
|
*
|
* @return
|
*/
|
@PostMapping("/people/detail")
|
@ResponseBody
|
public ResponseResult getPeopleDetail(@Valid @RequestBody PeopleDetailVo peopleDetailVo, BindingResult bindingResult) throws Exception {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.getPeopleDetail(peopleDetailVo);
|
}
|
|
/**
|
* 首页汇总接口
|
*
|
* @return
|
*/
|
@GetMapping("/index/indexCollect")
|
@ResponseBody
|
public ResponseResult indexCollect() {
|
return geoDataServiceImpl.indexCollect();
|
}
|
|
/**
|
* 首页项目环数量汇总接口
|
*
|
* @return
|
*/
|
@GetMapping("/index/indexProjectNumsCollect")
|
@ResponseBody
|
public ResponseResult indexProjectNumsCollect(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
|
return geoDataServiceImpl.indexProjectNumsCollect(startTime, endTime);
|
}
|
|
/**
|
* 上传异常处理意见接口
|
*/
|
@PostMapping("/uploadHandle")
|
@ResponseBody
|
public ResponseResult uploadHandle(@Valid @RequestBody HandleOpinion handleOpinion, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.uploadHandle(handleOpinion);
|
}
|
|
/**
|
* 获取项目所有异常数据接口
|
*/
|
@PostMapping("/exception/getProjectException")
|
@ResponseBody
|
public ResponseResult getProjectException(@Valid @RequestBody ExceptionVo exceptionVo, BindingResult bindingResult) {
|
if (bindingResult.hasErrors()) {
|
return ResponseResult.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
}
|
return geoDataServiceImpl.getProjectException(exceptionVo);
|
}
|
|
/**
|
* 获取异常详情接口
|
*/
|
@GetMapping("/exception/getExceptionDetail")
|
@ResponseBody
|
public ResponseResult getExceptionDetail(@RequestParam("secretKey") String secretKey, @RequestParam("exceptionID") String exceptionID) {
|
return geoDataServiceImpl.getExceptionDetail(secretKey,exceptionID);
|
}
|
|
|
|
|
}
|