fix:推广员导出

feature/mall_product
tangqian 2023-06-16 11:29:14 +08:00
parent c923cc93f0
commit f0d3b5a72d
3 changed files with 21 additions and 1 deletions

View File

@ -118,4 +118,11 @@ public interface DeptService {
void validateDeptList(Collection<Long> ids);
void batchImport(MultipartFile file);
/**
* tenantId
* @param tenantId
* @return
*/
DeptDO getById(Long tenantId);
}

View File

@ -147,7 +147,7 @@ public class DeptServiceImpl implements DeptService {
deptDOS.forEach(x -> {
x.setParentOrganizationName(x.getParentOrganizationName().replace(deptDO.getName(), reqVO.getName()));
});
deptMapper.updateBatch(deptDOS,deptDOS.size());
deptMapper.updateBatch(deptDOS, deptDOS.size());
deptDO.setName(reqVO.getName());
deptMapper.updateById(deptDO);
// 发送刷新消息
@ -397,4 +397,9 @@ public class DeptServiceImpl implements DeptService {
}
}
@Override
public DeptDO getById(Long tenantId) {
return deptMapper.selectOne(Wrappers.<DeptDO>lambdaQuery().eq(DeptDO::getTenantId, tenantId).eq(DeptDO::getParentId, 0L).last("limit 1"));
}
}

View File

@ -11,9 +11,11 @@ import cn.iocoder.yudao.framework.tenant.config.TenantProperties;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
import cn.iocoder.yudao.module.system.convert.tenant.TenantConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
@ -168,6 +170,12 @@ public class TenantServiceImpl implements TenantService {
if (ObjectUtil.notEqual(tenant.getPackageId(), updateReqVO.getPackageId())) {
updateTenantRoleMenu(tenant.getId(), tenantPackage.getMenuIds());
}
// 同步修改部门信息
DeptUpdateReqVO reqVO = new DeptUpdateReqVO();
DeptDO dept = deptService.getDept(updateReqVO.getId());
reqVO.setName(updateReqVO.getName());
reqVO.setId(dept.getId());
deptService.updateDept(reqVO);
}
/**