| | |
| | | */ |
| | | package org.sxkj.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService { |
| | | |
| | |
| | | |
| | | @Override |
| | | public boolean submit(Dept dept) { |
| | | log.info("提交数据:{}", JSON.toJSONString(dept)); |
| | | if (Func.isEmpty(dept.getParentId())) { |
| | | dept.setTenantId(AuthUtil.getTenantId()); |
| | | dept.setParentId(BladeConstant.TOP_PARENT_ID); |
| | |
| | | dept.setAncestors(ancestors); |
| | | } |
| | | dept.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
| | | if (dept.getId() > 0) { |
| | | if (dept.getId() != null && dept.getId() > 0) { |
| | | return updateById(dept); |
| | | } |
| | | return save(dept); |