|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.persagy.adm.server.custom.entity.CadFileQueryParam;
|
|
import com.persagy.adm.server.custom.entity.CadFileQueryParam;
|
|
import com.persagy.adm.server.custom.entity.db.AdmCad;
|
|
import com.persagy.adm.server.custom.entity.db.AdmCad;
|
|
import com.persagy.adm.server.custom.service.IAdmCadService;
|
|
import com.persagy.adm.server.custom.service.IAdmCadService;
|
|
|
|
+import com.persagy.dmp.common.context.AppContext;
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
import com.persagy.dmp.common.utils.ResultHelper;
|
|
import com.persagy.dmp.common.utils.ResultHelper;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -32,8 +33,10 @@ public class AdmFileController {
|
|
|
|
|
|
@PostMapping("/queryCadFiles")
|
|
@PostMapping("/queryCadFiles")
|
|
public CommonResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
|
|
public CommonResult<List<AdmCad>> queryCadFiles(@RequestBody CadFileQueryParam queryParam){
|
|
|
|
+ AppContext context = AppContext.getContext();
|
|
Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
|
|
Wrapper<AdmCad> eq = new LambdaQueryWrapper<AdmCad>()
|
|
- .eq(StringUtils.isNotBlank(queryParam.getProjectId()), AdmCad::getProjectId, queryParam.getProjectId())
|
|
|
|
|
|
+ .eq(StringUtils.isNotBlank(context.getGroupCode()), AdmCad::getGroupCode, context.getProjectId())
|
|
|
|
+ .eq(StringUtils.isNotBlank(context.getProjectId()), AdmCad::getProjectId, context.getProjectId())
|
|
.eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
|
|
.eq(StringUtils.isNotBlank(queryParam.getBuildingId()),AdmCad::getBuildingId,queryParam.getBuildingId())
|
|
.eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
|
|
.eq(StringUtils.isNotBlank(queryParam.getFloorId()),AdmCad::getFloorId,queryParam.getFloorId())
|
|
.eq(StringUtils.isNotBlank(queryParam.getFileKey()),AdmCad::getFileKey,queryParam.getFileKey())
|
|
.eq(StringUtils.isNotBlank(queryParam.getFileKey()),AdmCad::getFileKey,queryParam.getFileKey())
|
|
@@ -46,6 +49,11 @@ public class AdmFileController {
|
|
*/
|
|
*/
|
|
@PostMapping("/saveCadFileInfo")
|
|
@PostMapping("/saveCadFileInfo")
|
|
public CommonResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
|
|
public CommonResult<Void> saveCadFileInfo(@RequestBody List<AdmCad> admFiles){
|
|
|
|
+ AppContext context = AppContext.getContext();
|
|
|
|
+ admFiles.forEach(admCad -> {
|
|
|
|
+ admCad.setGroupCode(context.getGroupCode());
|
|
|
|
+ admCad.setProjectId(context.getProjectId());
|
|
|
|
+ });
|
|
iAdmCadService.saveOrUpdateBatch(admFiles);
|
|
iAdmCadService.saveOrUpdateBatch(admFiles);
|
|
return ResultHelper.success();
|
|
return ResultHelper.success();
|
|
}
|
|
}
|