|
|
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.dromara.common.core.constant.DefaultConstants;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
@@ -116,11 +117,16 @@ public class DeptServiceImpl implements IDeptService {
|
|
|
@Override
|
|
|
public Boolean deleteByOtherId(String otherId, String tenantId) {
|
|
|
// TODO 2025-01-24 10:41:56 luoyibo 删除前的校验
|
|
|
+ SysDeptVo vo = TenantHelper.ignore(
|
|
|
+ () -> deptMapper.selectVoOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getOtherId, otherId).eq(SysDept::getTenantId, tenantId)));
|
|
|
int iCount = TenantHelper.ignore(
|
|
|
() -> deptMapper.delete(new LambdaQueryWrapper<SysDept>().eq(SysDept::getOtherId, otherId).eq(SysDept::getTenantId, tenantId)));
|
|
|
if (iCount > 0) {
|
|
|
- SysDeptVo vo = TenantHelper.ignore(
|
|
|
- () -> deptMapper.selectVoOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getOtherId, otherId).eq(SysDept::getTenantId, tenantId)));
|
|
|
+ vo.setDelFlag(DefaultConstants.DELETED);
|
|
|
+ //vo.setUpdateBy();
|
|
|
+ //SysDeptVo vo = TenantHelper.ignore(
|
|
|
+ // () -> deptMapper.selectVoOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getOtherId, otherId).eq(SysDept::getTenantId, tenantId)));
|
|
|
+
|
|
|
kafkaNormalProducer.sendKafkaMessage(KafkaTopicConstants.SYNC_DATA_TOPIC, EventTypeConstants.DEPT, EventSenderEnum.SYSTEM.code(), vo);
|
|
|
}
|
|
|
return iCount > 0;
|