移除多余的BeanUtils.copyProperties调用

This commit is contained in:
linck 2023-03-10 17:50:19 +08:00
parent c1759fa199
commit b7d1f7eccf

View File

@ -29,7 +29,6 @@ import com.pig4cloud.pig.admin.service.SysDeptRelationService;
import com.pig4cloud.pig.admin.service.SysDeptService;
import com.pig4cloud.pig.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -58,10 +57,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveDept(SysDept dept) {
SysDept sysDept = new SysDept();
BeanUtils.copyProperties(dept, sysDept);
this.save(sysDept);
sysDeptRelationService.saveDeptRelation(sysDept);
this.save(dept);
sysDeptRelationService.saveDeptRelation(dept);
return Boolean.TRUE;
}