|
@@ -3,6 +3,7 @@ package com.persagy.adm.server.custom.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.persagy.adm.server.custom.dto.CadFiles;
|
|
|
import com.persagy.adm.server.custom.entity.CadFileQueryParam;
|
|
|
import com.persagy.adm.server.custom.entity.db.AdmCad;
|
|
|
import com.persagy.adm.server.custom.service.IAdmCadService;
|
|
@@ -10,9 +11,12 @@ import com.persagy.dmp.common.context.AppContext;
|
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
|
import com.persagy.dmp.common.utils.ResultHelper;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -48,11 +52,21 @@ public class AdmFileController {
|
|
|
* 保存CAD文件信息
|
|
|
*/
|
|
|
@PostMapping("/saveCadFileInfo")
|
|
|
- public CommonResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
|
|
|
+ public CommonResult<Void> saveCadFileInfo(@RequestBody @Validated CadFiles cadFiles){
|
|
|
+ List<AdmCad> admFiles = new ArrayList<>();
|
|
|
AppContext context = AppContext.getContext();
|
|
|
- admFiles.forEach(admCad -> {
|
|
|
+ cadFiles.getFiles().forEach(file -> {
|
|
|
+ AdmCad admCad = new AdmCad();
|
|
|
admCad.setGroupCode(context.getGroupCode());
|
|
|
admCad.setProjectId(context.getProjectId());
|
|
|
+ admCad.setBuildingId(cadFiles.getBuildingId());
|
|
|
+ admCad.setFloorId(cadFiles.getFloorId());
|
|
|
+ admCad.setMajorCode(cadFiles.getMajorCode());
|
|
|
+ admCad.setMajorName(cadFiles.getMajorName());
|
|
|
+ admCad.setCheckStatus(false);
|
|
|
+ admCad.setFileKey(file.getFileKey());
|
|
|
+ admCad.setFileName(file.getFileName());
|
|
|
+ admFiles.add(admCad);
|
|
|
});
|
|
|
iAdmCadService.saveOrUpdateBatch(admFiles);
|
|
|
return ResultHelper.success();
|