加 rz_flag 字段到用户查询结果
parent
8a3302637b
commit
48189e0d80
|
|
@ -14,6 +14,7 @@ import com.zcloud.basic.info.dto.clientobject.ImgFilesInfoCO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
||||||
import com.zcloud.basic.info.persistence.repository.ImgFilesRepository;
|
import com.zcloud.basic.info.persistence.repository.ImgFilesRepository;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.math3.analysis.function.Sin;
|
import org.apache.commons.math3.analysis.function.Sin;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -31,15 +32,18 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
public class ImgFilesAddExe {
|
public class ImgFilesAddExe {
|
||||||
private final ImgFilesGateway imgFilesGateway;
|
private final ImgFilesGateway imgFilesGateway;
|
||||||
private final ImgFilesCoConvertor imgFilesCoConvertor;
|
private final ImgFilesCoConvertor imgFilesCoConvertor;
|
||||||
private final ImgFilesRepository imgFilesRepository;
|
private final ImgFilesRepository imgFilesRepository;
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public SingleResponse<ImgFilesCO> execute(ImgFilesAddCmd cmd) {
|
public SingleResponse<ImgFilesCO> execute(ImgFilesAddCmd cmd) {
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
Long tenantId = ssoUser.getTenantId();
|
Long tenantId = 1L;
|
||||||
|
if (ssoUser != null && ssoUser.getTenantId() != null){
|
||||||
|
tenantId = ssoUser.getTenantId();
|
||||||
|
}
|
||||||
ImgFilesE imgFilesE = new ImgFilesE();
|
ImgFilesE imgFilesE = new ImgFilesE();
|
||||||
BeanUtils.copyProperties(cmd, imgFilesE);
|
BeanUtils.copyProperties(cmd, imgFilesE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
|
|
@ -49,6 +53,7 @@ public class ImgFilesAddExe {
|
||||||
imgFilesCO.setFilePath(filePath);
|
imgFilesCO.setFilePath(filePath);
|
||||||
res = true;
|
res = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("保存失败", e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
|
@ -60,7 +65,10 @@ public class ImgFilesAddExe {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public SingleResponse<ImgFilesInfoCO> batchExecute(ImgFilesAddCmd cmd) {
|
public SingleResponse<ImgFilesInfoCO> batchExecute(ImgFilesAddCmd cmd) {
|
||||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||||
Long tenantId = ssoUser.getTenantId();
|
Long tenantId = 1L;
|
||||||
|
if (ssoUser != null && ssoUser.getTenantId() != null){
|
||||||
|
tenantId = ssoUser.getTenantId();
|
||||||
|
}
|
||||||
ImgFilesE imgFilesE = new ImgFilesE();
|
ImgFilesE imgFilesE = new ImgFilesE();
|
||||||
BeanUtils.copyProperties(cmd, imgFilesE);
|
BeanUtils.copyProperties(cmd, imgFilesE);
|
||||||
boolean res = false;
|
boolean res = false;
|
||||||
|
|
@ -74,6 +82,7 @@ public class ImgFilesAddExe {
|
||||||
imgFilesCO.setForeignKey(imgFilesE.getForeignKey());
|
imgFilesCO.setForeignKey(imgFilesE.getForeignKey());
|
||||||
res = true;
|
res = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error("保存失败", e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue