Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-06-23 19:45:58 +08:00
commit ee63a97924
7 files changed
+41 -14

No files matched your search

@@ -25,6 +25,12 @@ public class HardOrderCsVo implements BaseMchInterface, BaseHardInterface {
@Schema(description = "商户名")
private String merchantName;
@Schema(description = "商户部门名")
private String merchantDeptName;
@Schema(description = "商户部门id")
private Long merchantDeptId;
@Schema(description = "商户logo")
private String logoPic;
@@ -51,6 +51,7 @@ import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@Validated
@@ -200,6 +201,17 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
WalletDataUtil.convertMchList(totalList, CollectionUtils.convertMap(mchList, MchManageVo::getId));
}
}
// 商户部门
List<Long> mchDeptIds = totalList.stream().map(HardOrderCsVo::getMerchantDeptId).distinct().toList();
if (ObjectUtil.isNotEmpty(mchDeptIds)) {
Map<Long, SysDept> deptMap = remoteDeptService.getDeptByDeptIds(mchDeptIds).getData();
if (ObjectUtil.isNotEmpty(deptMap)) {
for (HardOrderCsVo v : totalList) {
if (ObjectUtil.isEmpty(v.getMerchantDeptId())) continue;
v.setMerchantDeptName(deptMap.get(v.getMerchantDeptId()).getName());
}
}
}
}
return totalList;
}
@@ -26,6 +26,7 @@ import com.bsd.pjcloud.admin.api.vo.DeptExcelVO;
import com.bsd.pjcloud.admin.mapper.SysDeptMapper;
import com.bsd.pjcloud.admin.service.SysDeptService;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
import com.bsd.pjcloud.common.excel.annotation.RequestExcel;
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
@@ -88,9 +89,6 @@ public class SysDeptController {
/**
* 返回树形菜单集合
*
* @param deptName 部门名称
* @return 树形菜单
*/
@GetMapping(value = "/tree")
public R getTree(String deptName, Long parentId) {
@@ -104,7 +102,15 @@ public class SysDeptController {
if (ObjectUtil.isEmpty(parentId)) {
parentId = deptId;
}
return R.ok(sysDeptService.selectTree(deptName, parentId));
return R.ok(sysDeptService.selectTree(deptName, parentId, DataScope.of()));
}
/**
* 返回树形菜单集合
*/
@GetMapping(value = "/tree-select")
public R getTreeSelect(String deptName, Long parentId) {
return R.ok(sysDeptService.selectTree(deptName, parentId, null));
}
@@ -26,6 +26,7 @@ import com.bsd.pjcloud.admin.api.entity.SysDept;
import com.bsd.pjcloud.admin.api.vo.DeptExcelVO;
import com.bsd.pjcloud.admin.api.vo.OrgTreeVO;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import jakarta.validation.Valid;
import org.springframework.validation.BindingResult;
@@ -48,7 +49,7 @@ public interface SysDeptService extends IService<SysDept> {
* @param deptName 部门名称
* @return 树
*/
List<Tree<Long>> selectTree(String deptName, Long parentId);
List<Tree<Long>> selectTree(String deptName, Long parentId, DataScope dataScope);
List<Tree<Long>> selectSimpleTree(String deptName, Long parentId);
@@ -132,16 +132,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
* @return 树 部门名称
*/
@Override
public List<Tree<Long>> selectTree(String deptName, Long parentId) {
public List<Tree<Long>> selectTree(String deptName, Long parentId, DataScope dataScope) {
List<SysDept> deptAllList = new ArrayList<>();
if (ObjectUtil.isEmpty(parentId)) {
// 查询全部部门
deptAllList = deptMapper
.selectList(Wrappers.<SysDept>lambdaQuery().like(StrUtil.isNotBlank(deptName), SysDept::getName, deptName));
} else {
deptAllList = listDescendant(parentId);
}
// 查询全部部门
LambdaQueryWrapper<SysDept> queryWrapper = Wrappers.<SysDept>lambdaQuery().like(StrUtil.isNotBlank(deptName), SysDept::getName, deptName);
deptAllList = deptMapper.selectListByScope(queryWrapper, dataScope);
// 查询数据权限内部门
List<Long> deptOwnIdList = deptMapper
.selectListByScope(
@@ -267,6 +267,7 @@
FROM
sys_user u
LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
LEFT JOIN sys_user_role urole ON urole.user_id = u.user_id
<where>
u.del_flag = '0'
<if test="query.username != null and query.username != ''">
@@ -276,6 +277,12 @@
<if test="query.deptId != null and query.deptId != ''">
AND u.dept_id = #{query.deptId}
</if>
<if test="query.role != null and query.role.size() != 0">
and urole.role_id IN
<foreach collection="query.role" item="v" open="(" close=")" separator=",">
#{v}
</foreach>
</if>
<if test="query.deptIds != null and query.deptIds.size() != 0">
<choose>
<when test="query.isInclude != null and query.isInclude == true">