feat:非食堂用户不能看到所有食堂
This commit is contained in:
1 parent
bcb4b20744
commit
64cf62b7af
4 files changed
+22
-1
No files matched your search
+6
@@ -60,6 +60,12 @@ public class MchManageEntity extends Model<MchManageEntity> {
|
||||
@Schema(description = "店铺类型,逗号分隔")
|
||||
private String types;
|
||||
|
||||
/**
|
||||
* 食堂是否对外营业
|
||||
*/
|
||||
@Schema(description = "食堂是否对外营业")
|
||||
private String canteenIsOpen;
|
||||
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
|
||||
+11
-1
@@ -108,9 +108,19 @@ public class MchManageController {
|
||||
/* ************************************* start app start ************************************* */
|
||||
@Operation(summary = "app查询商铺", description = "app查询商铺")
|
||||
@GetMapping("/app/page-join")
|
||||
@Inner(value = false)
|
||||
// @Inner(value = false)
|
||||
public R<Page<MchManageVo>> appPageJoin(@ParameterObject Page page, @ParameterObject MchManageDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
dto.setVisibleMobile(YesNoEnum.YES.getCode());
|
||||
// 如果是食堂判断用户是否能查看到所有食堂
|
||||
if (ObjectUtil.isNotEmpty(user) && ObjectUtil.isNotEmpty(user.getDeptId())) {
|
||||
if (ObjectUtil.equals(dto.getType(), MerchantTypeEnum.CANTEEN.getType())) {
|
||||
MchManageVo userCanteen = mchManageService.getFirstMchByDeptId(user.getDeptId(), MerchantTypeEnum.CANTEEN);
|
||||
if (ObjectUtil.isEmpty(userCanteen)) {
|
||||
dto.setCanteenIsOpen(YesNoEnum.YES.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(mchManageService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ public interface MchManageMapper extends PjcloudBaseMapper<MchManageEntity> {
|
||||
.eqIfExists(MchManageEntity::getVisibleMobile, dto.getVisibleMobile())
|
||||
.eqIfExists(MchManageEntity::getParentId, dto.getParentId())
|
||||
.eqIfExists(MchManageEntity::getCatgoryId, dto.getCatgoryId())
|
||||
.eqIfExists(MchManageEntity::getCanteenIsOpen, dto.getCanteenIsOpen())
|
||||
.eq(dto.getParentIsNull(), MchManageEntity::getParentId, -1L)
|
||||
.likeIfExists(MchManageEntity::getName, dto.getName())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), MchManageEntity::getDeptId, dto.getDeptIds())
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
a.default_wallet_type_id,
|
||||
a.name,
|
||||
a.types,
|
||||
a.canteen_is_open,
|
||||
a.catgory_id,
|
||||
a.logo_pic,
|
||||
a.collection_code,
|
||||
@@ -61,6 +62,9 @@
|
||||
<if test="dto.types != null">
|
||||
and a.types = #{dto.types}
|
||||
</if>
|
||||
<if test="dto.canteenIsOpen != null">
|
||||
and a.canteen_is_open = #{dto.canteenIsOpen}
|
||||
</if>
|
||||
<if test="dto.catgoryId != null">
|
||||
and a.catgory_id = #{dto.catgoryId}
|
||||
</if>
|
||||
|
||||
Reference in new issue
Block a user