fix(景区管理):二维码创建新增租户id,景区管理的时候根据当前用户设置租户
This commit is contained in:
+3
@@ -79,6 +79,9 @@ public class QrCodeController {
|
|||||||
String codeId = UUID.randomUUID().toString();
|
String codeId = UUID.randomUUID().toString();
|
||||||
Result<Map> result = fileCenterService.uploadQrCodeFile(codeId);
|
Result<Map> result = fileCenterService.uploadQrCodeFile(codeId);
|
||||||
if (result.getResp_code() == 0){
|
if (result.getResp_code() == 0){
|
||||||
|
Tourism tourism = tourismService.getTourismById(qrCode.getTourismId());
|
||||||
|
Assert.notNull(tourism, "请选择景区数据");
|
||||||
|
qrCode.setTenantId(tourism.getTenantId());
|
||||||
qrCode.setCodeId(codeId);
|
qrCode.setCodeId(codeId);
|
||||||
qrCode.setFilePath(result.getData().get("filePath").toString());
|
qrCode.setFilePath(result.getData().get("filePath").toString());
|
||||||
qrCode.setFileId(result.getData().get("fileId").toString());
|
qrCode.setFileId(result.getData().get("fileId").toString());
|
||||||
|
|||||||
+9
@@ -1,5 +1,8 @@
|
|||||||
package com.central.order.controller;
|
package com.central.order.controller;
|
||||||
|
|
||||||
|
import com.central.common.context.LoginUserContextHolder;
|
||||||
|
import com.central.common.context.TenantContextHolder;
|
||||||
|
import com.central.common.model.LoginAppUser;
|
||||||
import com.central.common.model.PageResult;
|
import com.central.common.model.PageResult;
|
||||||
import com.central.common.model.Result;
|
import com.central.common.model.Result;
|
||||||
import com.central.order.model.Tourism;
|
import com.central.order.model.Tourism;
|
||||||
@@ -12,6 +15,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -47,6 +51,11 @@ public class TourismController {
|
|||||||
|
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public Result saveOrUpdate(@RequestBody Tourism tourism) {
|
public Result saveOrUpdate(@RequestBody Tourism tourism) {
|
||||||
|
if (tourism.getTenantId() == null) {
|
||||||
|
String tenantId = TenantContextHolder.getTenant();
|
||||||
|
//新增景区所属租户ID,创建景区的时候在
|
||||||
|
tourism.setTenantId(tenantId);
|
||||||
|
}
|
||||||
return tourismService.saveOrUpdateTourism(tourism);
|
return tourismService.saveOrUpdateTourism(tourism);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user