代码提交
This commit is contained in:
parent
69a2e0a9f5
commit
1fdc18dfc0
|
|
@ -10,6 +10,7 @@ import com.bonus.common.utils.poi.ExcelUtil;
|
|||
import com.bonus.waterdesign.controller.utils.FileUtils;
|
||||
import com.bonus.waterdesign.domain.FileDto;
|
||||
import com.bonus.waterdesign.domain.Survey;
|
||||
import com.bonus.waterdesign.domain.SurveyDto;
|
||||
import com.bonus.waterdesign.service.SurveyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
|
@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 勘查信息操作处理
|
||||
|
|
@ -82,23 +84,26 @@ public class SurveyController extends BaseController {
|
|||
@PreAuthorize("@ss.hasPermi('basic:survey:add')")
|
||||
@Log(title = "勘查管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam("projectId") String projectId,
|
||||
@RequestParam("type") String type,
|
||||
@RequestParam("selectedNodeId") String selectedNodeId,
|
||||
@RequestParam("selectedNodeName") String selectedNodeName) throws IOException {
|
||||
FileDto upload = fileUtils.upload(file);
|
||||
public AjaxResult add(@RequestBody SurveyDto dto) throws IOException {
|
||||
Survey survey = new Survey();
|
||||
survey.setCreateBy(getUsername());
|
||||
survey.setSurveyUser(getUsername());
|
||||
survey.setSurveyTime(DateUtils.getDate());
|
||||
survey.setProId(Long.parseLong(projectId));
|
||||
survey.setModelId(selectedNodeId);
|
||||
survey.setModelName(selectedNodeName);
|
||||
survey.setSurveyAttach(upload.getFilePath());
|
||||
survey.setProId(Long.parseLong(dto.getProjectId()));
|
||||
survey.setModelId(dto.getSelectedNodeId());
|
||||
survey.setModelName(dto.getSelectedNodeName());
|
||||
survey.setSurveyAttach(dto.getSurveyAttach());
|
||||
survey.setSurveyResult(dto.getSurveyResult());
|
||||
return toAjax(surveyService.insertSurvey(survey));
|
||||
}
|
||||
|
||||
@PostMapping("/uploadSurveyFile")
|
||||
public AjaxResult uploadSurveyFile(MultipartFile file) throws IOException {
|
||||
String filePath = fileUtils.upload(file).getFilePath();
|
||||
return AjaxResult.success("", filePath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改勘查
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.bonus.waterdesign.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2025/11/20 - 15:40
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class SurveyDto {
|
||||
private String surveyAttach;
|
||||
private String projectId;
|
||||
private String type;
|
||||
private String selectedNodeId;
|
||||
private String selectedNodeName;
|
||||
private String surveyResult;
|
||||
/** 创建者 */
|
||||
private String createBy;
|
||||
|
||||
/** 堪察人 */
|
||||
|
||||
private String surveyUser;
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue