feat:超市管理员搜索订单

This commit is contained in:
dzc committed 2025-03-27 14:29:35 +08:00
1 parent cee050edb9
commit cf1c5beff6
13 files changed
+146 -9

No files matched your search

+2 -1
View File
@@ -114,7 +114,8 @@ CREATE TABLE wallet_rule_mch_config
(
id bigint NOT NULL COMMENT '主键',
source_mch_id bigint NOT NULL COMMENT '源商户id',
traget_mch_id bigint NOT NULL COMMENT '目标商户id',
target_mch_id bigint NOT NULL COMMENT '目标商户id',
target_dept_id bigint NOT NULL COMMENT '目标部门id',
rule_price_config_id bigint NOT NULL COMMENT '规则配置id',
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
create_time datetime DEFAULT NULL COMMENT '创建时间',
@@ -157,12 +157,10 @@ public class HardOrderController {
@GetMapping("/page-join")
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
public R pageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
DataScope dataScope = DataScope.of();
dataScope.setScopeDeptName("hardTypeDeptId");
PjcloudUser user = SecurityUtils.getUser();
CurrentUserHardTypeInfoDto hardTypeInfo = hardManagerService.getCurrentUserHardTypeInfo(user);
dto.setMchTypeCodes(hardTypeInfo.getHardTypeList());
return R.ok(hardwareOrderService.scopePageList(page, dto, dataScope));
return R.ok(hardwareOrderService.scopePageList(page, dto));
}
@Operation(summary = "通过id查询", description = "通过id查询")
@@ -84,7 +84,7 @@ public interface HardOrderMapper extends PjcloudBaseMapper<HardOrderEntity> {
return selectListByScope(commonWrapper(dto), DataScope.of());
}
Page<HardOrderVo> scopePageList(Page page, @Param("dto") HardOrderDto dto, DataScope dataScope);
Page<HardOrderVo> scopePageList(Page page, @Param("dto") HardOrderDto dto);
List<HardOrderSbVo> listSb(@Param("dto") HardOrderDto dto, DataScope dataScope);
@@ -24,7 +24,7 @@ public interface HardOrderService extends IService<HardOrderEntity> {
*/
Page<HardOrderVo> appMchPageJoin(Page page, HardOrderDto dto, PjcloudUser user);
Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto, DataScope dataScope);
Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto);
List<HardOrderVo> scopeList(HardOrderDto dto);
@@ -132,8 +132,8 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
}
@Override
public Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto, DataScope dataScope) {
Page<HardOrderVo> list = baseMapper.scopePageList(page, dto, dataScope);
public Page<HardOrderVo> scopePageList(Page page, HardOrderDto dto) {
Page<HardOrderVo> list = baseMapper.scopePageList(page, dto);
if (ObjectUtil.isNotEmpty(list.getRecords())) {
// 用户
List<Long> userIds = list.getRecords().stream().map(HardOrderVo::getUserId).filter(ObjectUtil::isNotEmpty).distinct().toList();
@@ -40,7 +40,12 @@ public class WalletRuleMchConfigEntity extends Model<WalletRuleMchConfigEntity>
* 目标商户id
*/
@Schema(description = "目标商户id")
private Long tragetMchId;
private Long targetMchId;
/**
* 目标部门id
*/
private Long tragetDeptId;
/**
* 规则配置id
@@ -5,4 +5,25 @@ import lombok.Data;
@Data
public class WalletRuleMchConfigVo extends WalletRuleMchConfigEntity {
/**
* 钱包规则id
*/
private Long rulePirceConfigId;
/**
* 钱包规则类型
*/
private String rulePriceType;
/**
* 基础价格
*/
private Long basePrice;
/**
* 额外需要支付的倍数
*/
private Long multiple;
}
@@ -6,7 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.core.util.R;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.log.annotation.SysLog;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleMchConfigDto;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleMchConfigEntity;
import com.bsd.pjcloud.wallet.service.WalletRuleMchConfigService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -39,6 +41,13 @@ public class WalletRuleMchConfigController {
return R.ok(walletRuleMchConfigService.page(page, wrapper));
}
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
@GetMapping("/page-join")
@PreAuthorize("@pms.hasPermission('dzc_walletRuleMchConfig_view')")
public R pageJoin(@ParameterObject Page page, @ParameterObject WalletRuleMchConfigDto dto) {
return R.ok(walletRuleMchConfigService.pageScopeList(page, dto, DataScope.of()));
}
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('dzc_walletRuleMchConfig_view')")
@@ -1,11 +1,17 @@
package com.bsd.pjcloud.wallet.mapper.rule;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleMchConfigDto;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleMchConfigEntity;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleMchConfigVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface WalletRuleMchConfigMapper extends PjcloudBaseMapper<WalletRuleMchConfigEntity> {
Page<WalletRuleMchConfigVo> pageScopeList(Page page, @Param("dto") WalletRuleMchConfigDto dto, DataScope dataScope);
}
@@ -1,8 +1,17 @@
package com.bsd.pjcloud.wallet.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleMchConfigDto;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleMchConfigEntity;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleMchConfigVo;
public interface WalletRuleMchConfigService extends IService<WalletRuleMchConfigEntity> {
/**
* 权限分页查询
*/
Page<WalletRuleMchConfigVo> pageScopeList(Page page, WalletRuleMchConfigDto dto, DataScope dataScope);
}
@@ -1,7 +1,11 @@
package com.bsd.pjcloud.wallet.service.impl.rule;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bsd.pjcloud.common.data.datascope.DataScope;
import com.bsd.pjcloud.wallet.api.dto.rule.WalletRuleMchConfigDto;
import com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleMchConfigEntity;
import com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleMchConfigVo;
import com.bsd.pjcloud.wallet.mapper.rule.WalletRuleMchConfigMapper;
import com.bsd.pjcloud.wallet.service.WalletRuleMchConfigService;
import org.springframework.stereotype.Service;
@@ -14,4 +18,12 @@ import org.springframework.stereotype.Service;
*/
@Service
public class WalletRuleMchConfigServiceImpl extends ServiceImpl<WalletRuleMchConfigMapper, WalletRuleMchConfigEntity> implements WalletRuleMchConfigService {
/**
* 权限分页查询
*/
@Override
public Page<WalletRuleMchConfigVo> pageScopeList(Page page, WalletRuleMchConfigDto dto, DataScope dataScope) {
return baseMapper.pageScopeList(page, dto, dataScope);
}
}
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsd.pjcloud.wallet.mapper.rule.WalletRuleMchConfigMapper">
<resultMap id="walletRuleMchConfigMap" type="com.bsd.pjcloud.wallet.api.entity.rule.WalletRuleMchConfigEntity">
<result property="id" column="id"/>
<result property="sourceMchId" column="source_mch_id"/>
<result property="targetMchId" column="target_mch_id"/>
<result property="tragetDeptId" column="traget_dept_id"/>
<result property="rulePriceConfigId" column="rule_price_config_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
<sql id="selectA">
select a.id,
a.source_mch_id,
a.target_mch_id,
a.rule_price_config_id,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
a.tenant_id,
</sql>
<sql id="whereA">
a.del_flag = 0
<if test="dto.sourceMchId != null">
and a.source_mch_id = #{dto.sourceMchId}
</if>
<if test="dto.targetMchId != null">
and a.target_mch_id = #{dto.targetMchId}
</if>
<if test="dto.rulePriceConfigId != null">
and a.rule_price_config_id = #{dto.rulePriceConfigId}
</if>
</sql>
<select id="pageScopeList" resultType="com.bsd.pjcloud.wallet.api.vo.rule.WalletRuleMchConfigVo">
<include refid="selectA"/>
p.id as rulePirceConfigId,
p.rule_price_type,
p.base_price,
p.multiple
from wallet_rule_mch_config a
left join wallet_rule_price_config p on a.rule_price_config_id = p.id
<where>
<include refid="whereA"/>
</where>
order by a.create_time desc , a.id desc
</select>
</mapper>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsd.pjcloud.wallet.mapper.rule.WalletRulePriceConfigMapper">
<resultMap id="walletRulePriceConfigMap" type="com.bsd.pjcloud.wallet.api.entity.rule.WalletRulePriceConfigEntity">
<result property="id" column="id"/>
<result property="rulePriceType" column="rule_price_type"/>
<result property="basePrice" column="base_price"/>
<result property="multiple" column="multiple"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</mapper>