5-22 - 检查清单删除 增加主账号删除权限
parent
d8a6ae547d
commit
4eccf92d11
|
|
@ -1,7 +1,12 @@
|
|||
package com.zcloud.key.project.command.inspection;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.gbscommon.zcloudimgfiles.facade.ZcloudImgFilesFacade;
|
||||
import com.zcloud.gbscommon.zcloudsystem.user.SystemUserUtils;
|
||||
import com.zcloud.gbscommon.zclouduser.facade.ZcloudUserFacade;
|
||||
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
|
||||
import com.zcloud.key.project.domain.gateway.inspection.SafetyEnvironmentalInspectionGateway;
|
||||
import com.zcloud.key.project.persistence.dataobject.hidden.HiddenDO;
|
||||
import com.zcloud.key.project.persistence.dataobject.inspection.SafetyEnvironmentalInspectionContentDO;
|
||||
|
|
@ -13,6 +18,7 @@ import com.zcloud.key.project.persistence.repository.inspection.SafetyEnvironmen
|
|||
import com.zcloud.key.project.persistence.repository.inspection.SafetyEnvironmentalInspectionUserRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -37,11 +43,25 @@ public class SafetyEnvironmentalInspectionRemoveExe {
|
|||
private final SafetyEnvironmentalInspectionContentRepository safetyEnvironmentalInspectionContentRepository;
|
||||
private final HiddenRepository hiddenRepository;
|
||||
private final HiddenFindUserRepository hiddenFindUserRepository;
|
||||
private final UserDetailsService userDetailsService;
|
||||
private final SystemUserUtils systemUserUtils;
|
||||
|
||||
@DubboReference
|
||||
private ZcloudImgFilesFacade zcloudImgFilesFacade;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
|
||||
//只有主账号才有删除权限
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
ZcloudUserCo zcloudUserCo = systemUserUtils.getZcloudUserInfoById(ssoUser.getUserId());
|
||||
if (zcloudUserCo == null) {
|
||||
throw new BizException("删除权限校验失败");
|
||||
}
|
||||
if (zcloudUserCo.getMainCorpFlag() != 1) {
|
||||
throw new BizException("您没有删除权限");
|
||||
}
|
||||
|
||||
SafetyEnvironmentalInspectionDO inspectionDO = safetyEnvironmentalInspectionRepository.getById(id);
|
||||
boolean res = safetyEnvironmentalInspectionGateway.deletedSafetyEnvironmentalInspectionById(id);
|
||||
// 删除检查核实人数据
|
||||
|
|
|
|||
Loading…
Reference in New Issue