Browse Source
- 新增 ShopDealerBank 实体类 - 新增 ShopDealerBankMapper 和 XML映射文件 - 新增 ShopDealerBankService 接口及实现类 - 新增 ShopDealerBankController 控制器 - 新增 ShopDealerBankParam 查询参数类pan
7 changed files with 423 additions and 0 deletions
@ -0,0 +1,128 @@ |
|||||
|
package com.gxwebsoft.shop.controller; |
||||
|
|
||||
|
import com.gxwebsoft.common.core.annotation.OperationLog; |
||||
|
import com.gxwebsoft.common.core.web.ApiResult; |
||||
|
import com.gxwebsoft.common.core.web.BaseController; |
||||
|
import com.gxwebsoft.common.core.web.BatchParam; |
||||
|
import com.gxwebsoft.common.core.web.PageResult; |
||||
|
import com.gxwebsoft.common.system.entity.User; |
||||
|
import com.gxwebsoft.shop.entity.ShopDealerBank; |
||||
|
import com.gxwebsoft.shop.param.ShopDealerBankParam; |
||||
|
import com.gxwebsoft.shop.service.ShopDealerBankService; |
||||
|
import io.swagger.v3.oas.annotations.Operation; |
||||
|
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡控制器 |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
@Tag(name = "分销商提现银行卡管理") |
||||
|
@RestController |
||||
|
@RequestMapping("/api/shop/shop-dealer-bank") |
||||
|
public class ShopDealerBankController extends BaseController { |
||||
|
@Resource |
||||
|
private ShopDealerBankService shopDealerBankService; |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')") |
||||
|
@Operation(summary = "分页查询分销商提现银行卡") |
||||
|
@GetMapping("/page") |
||||
|
public ApiResult<PageResult<ShopDealerBank>> page(ShopDealerBankParam param) { |
||||
|
// 使用关联查询
|
||||
|
return success(shopDealerBankService.pageRel(param)); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')") |
||||
|
@Operation(summary = "查询全部分销商提现银行卡") |
||||
|
@GetMapping() |
||||
|
public ApiResult<List<ShopDealerBank>> list(ShopDealerBankParam param) { |
||||
|
// 使用关联查询
|
||||
|
return success(shopDealerBankService.listRel(param)); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')") |
||||
|
@Operation(summary = "根据id查询分销商提现银行卡") |
||||
|
@GetMapping("/{id}") |
||||
|
public ApiResult<ShopDealerBank> get(@PathVariable("id") Integer id) { |
||||
|
// 使用关联查询
|
||||
|
return success(shopDealerBankService.getByIdRel(id)); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:save')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "添加分销商提现银行卡") |
||||
|
@PostMapping() |
||||
|
public ApiResult<?> save(@RequestBody ShopDealerBank shopDealerBank) { |
||||
|
// 记录当前登录用户id
|
||||
|
User loginUser = getLoginUser(); |
||||
|
if (loginUser != null) { |
||||
|
shopDealerBank.setUserId(loginUser.getUserId()); |
||||
|
} |
||||
|
if (shopDealerBankService.save(shopDealerBank)) { |
||||
|
return success("添加成功"); |
||||
|
} |
||||
|
return fail("添加失败"); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:update')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "修改分销商提现银行卡") |
||||
|
@PutMapping() |
||||
|
public ApiResult<?> update(@RequestBody ShopDealerBank shopDealerBank) { |
||||
|
if (shopDealerBankService.updateById(shopDealerBank)) { |
||||
|
return success("修改成功"); |
||||
|
} |
||||
|
return fail("修改失败"); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:remove')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "删除分销商提现银行卡") |
||||
|
@DeleteMapping("/{id}") |
||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) { |
||||
|
if (shopDealerBankService.removeById(id)) { |
||||
|
return success("删除成功"); |
||||
|
} |
||||
|
return fail("删除失败"); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:save')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "批量添加分销商提现银行卡") |
||||
|
@PostMapping("/batch") |
||||
|
public ApiResult<?> saveBatch(@RequestBody List<ShopDealerBank> list) { |
||||
|
if (shopDealerBankService.saveBatch(list)) { |
||||
|
return success("添加成功"); |
||||
|
} |
||||
|
return fail("添加失败"); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:update')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "批量修改分销商提现银行卡") |
||||
|
@PutMapping("/batch") |
||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopDealerBank> batchParam) { |
||||
|
if (batchParam.update(shopDealerBankService, "id")) { |
||||
|
return success("修改成功"); |
||||
|
} |
||||
|
return fail("修改失败"); |
||||
|
} |
||||
|
|
||||
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:remove')") |
||||
|
@OperationLog |
||||
|
@Operation(summary = "批量删除分销商提现银行卡") |
||||
|
@DeleteMapping("/batch") |
||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) { |
||||
|
if (shopDealerBankService.removeByIds(ids)) { |
||||
|
return success("删除成功"); |
||||
|
} |
||||
|
return fail("删除失败"); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package com.gxwebsoft.shop.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡 |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Schema(name = "ShopDealerBank对象", description = "分销商提现银行卡") |
||||
|
public class ShopDealerBank implements Serializable { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Schema(description = "主键ID") |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
@Schema(description = "分销商用户ID") |
||||
|
private Integer userId; |
||||
|
|
||||
|
@Schema(description = "开户行名称") |
||||
|
private String bankName; |
||||
|
|
||||
|
@Schema(description = "银行开户名") |
||||
|
private String bankAccount; |
||||
|
|
||||
|
@Schema(description = "银行卡号") |
||||
|
private String bankCard; |
||||
|
|
||||
|
@Schema(description = "申请状态 (10待审核 20审核通过 30驳回)") |
||||
|
private Integer applyStatus; |
||||
|
|
||||
|
@Schema(description = "驳回原因") |
||||
|
private String rejectReason; |
||||
|
|
||||
|
@Schema(description = "租户id") |
||||
|
private Integer tenantId; |
||||
|
|
||||
|
@Schema(description = "创建时间") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
@Schema(description = "修改时间") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.gxwebsoft.shop.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.gxwebsoft.shop.entity.ShopDealerBank; |
||||
|
import com.gxwebsoft.shop.param.ShopDealerBankParam; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡Mapper |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
public interface ShopDealerBankMapper extends BaseMapper<ShopDealerBank> { |
||||
|
|
||||
|
/** |
||||
|
* 分页查询 |
||||
|
* |
||||
|
* @param page 分页对象 |
||||
|
* @param param 查询参数 |
||||
|
* @return List<ShopDealerBank> |
||||
|
*/ |
||||
|
List<ShopDealerBank> selectPageRel(@Param("page") IPage<ShopDealerBank> page, |
||||
|
@Param("param") ShopDealerBankParam param); |
||||
|
|
||||
|
/** |
||||
|
* 查询全部 |
||||
|
* |
||||
|
* @param param 查询参数 |
||||
|
* @return List<User> |
||||
|
*/ |
||||
|
List<ShopDealerBank> selectListRel(@Param("param") ShopDealerBankParam param); |
||||
|
|
||||
|
} |
@ -0,0 +1,57 @@ |
|||||
|
<?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.gxwebsoft.shop.mapper.ShopDealerBankMapper"> |
||||
|
|
||||
|
<!-- 关联查询sql --> |
||||
|
<sql id="selectSql"> |
||||
|
SELECT a.* |
||||
|
FROM shop_dealer_bank a |
||||
|
<where> |
||||
|
<if test="param.id != null"> |
||||
|
AND a.id = #{param.id} |
||||
|
</if> |
||||
|
<if test="param.userId != null"> |
||||
|
AND a.user_id = #{param.userId} |
||||
|
</if> |
||||
|
<if test="param.bankName != null"> |
||||
|
AND a.bank_name LIKE CONCAT('%', #{param.bankName}, '%') |
||||
|
</if> |
||||
|
<if test="param.bankAccount != null"> |
||||
|
AND a.bank_account LIKE CONCAT('%', #{param.bankAccount}, '%') |
||||
|
</if> |
||||
|
<if test="param.bankCard != null"> |
||||
|
AND a.bank_card LIKE CONCAT('%', #{param.bankCard}, '%') |
||||
|
</if> |
||||
|
<if test="param.applyStatus != null"> |
||||
|
AND a.apply_status = #{param.applyStatus} |
||||
|
</if> |
||||
|
<if test="param.auditTime != null"> |
||||
|
AND a.audit_time = #{param.auditTime} |
||||
|
</if> |
||||
|
<if test="param.rejectReason != null"> |
||||
|
AND a.reject_reason LIKE CONCAT('%', #{param.rejectReason}, '%') |
||||
|
</if> |
||||
|
<if test="param.createTimeStart != null"> |
||||
|
AND a.create_time >= #{param.createTimeStart} |
||||
|
</if> |
||||
|
<if test="param.createTimeEnd != null"> |
||||
|
AND a.create_time <= #{param.createTimeEnd} |
||||
|
</if> |
||||
|
<if test="param.keywords != null"> |
||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') |
||||
|
) |
||||
|
</if> |
||||
|
</where> |
||||
|
</sql> |
||||
|
|
||||
|
<!-- 分页查询 --> |
||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopDealerBank"> |
||||
|
<include refid="selectSql"></include> |
||||
|
</select> |
||||
|
|
||||
|
<!-- 查询全部 --> |
||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopDealerBank"> |
||||
|
<include refid="selectSql"></include> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,54 @@ |
|||||
|
package com.gxwebsoft.shop.param; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||
|
import com.gxwebsoft.common.core.annotation.QueryField; |
||||
|
import com.gxwebsoft.common.core.annotation.QueryType; |
||||
|
import com.gxwebsoft.common.core.web.BaseParam; |
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡查询参数 |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||
|
@Schema(name = "ShopDealerBankParam对象", description = "分销商提现银行卡查询参数") |
||||
|
public class ShopDealerBankParam extends BaseParam { |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@Schema(description = "主键ID") |
||||
|
@QueryField(type = QueryType.EQ) |
||||
|
private Integer id; |
||||
|
|
||||
|
@Schema(description = "分销商用户ID") |
||||
|
@QueryField(type = QueryType.EQ) |
||||
|
private Integer userId; |
||||
|
|
||||
|
@Schema(description = "开户行名称") |
||||
|
private String bankName; |
||||
|
|
||||
|
@Schema(description = "银行开户名") |
||||
|
private String bankAccount; |
||||
|
|
||||
|
@Schema(description = "银行卡号") |
||||
|
private String bankCard; |
||||
|
|
||||
|
@Schema(description = "申请状态 (10待审核 20审核通过 30驳回)") |
||||
|
@QueryField(type = QueryType.EQ) |
||||
|
private Integer applyStatus; |
||||
|
|
||||
|
@Schema(description = "审核时间") |
||||
|
@QueryField(type = QueryType.EQ) |
||||
|
private Integer auditTime; |
||||
|
|
||||
|
@Schema(description = "驳回原因") |
||||
|
private String rejectReason; |
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package com.gxwebsoft.shop.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.gxwebsoft.common.core.web.PageResult; |
||||
|
import com.gxwebsoft.shop.entity.ShopDealerBank; |
||||
|
import com.gxwebsoft.shop.param.ShopDealerBankParam; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡Service |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
public interface ShopDealerBankService extends IService<ShopDealerBank> { |
||||
|
|
||||
|
/** |
||||
|
* 分页关联查询 |
||||
|
* |
||||
|
* @param param 查询参数 |
||||
|
* @return PageResult<ShopDealerBank> |
||||
|
*/ |
||||
|
PageResult<ShopDealerBank> pageRel(ShopDealerBankParam param); |
||||
|
|
||||
|
/** |
||||
|
* 关联查询全部 |
||||
|
* |
||||
|
* @param param 查询参数 |
||||
|
* @return List<ShopDealerBank> |
||||
|
*/ |
||||
|
List<ShopDealerBank> listRel(ShopDealerBankParam param); |
||||
|
|
||||
|
/** |
||||
|
* 根据id查询 |
||||
|
* |
||||
|
* @param id 主键ID |
||||
|
* @return ShopDealerBank |
||||
|
*/ |
||||
|
ShopDealerBank getByIdRel(Integer id); |
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package com.gxwebsoft.shop.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.gxwebsoft.common.core.web.PageParam; |
||||
|
import com.gxwebsoft.common.core.web.PageResult; |
||||
|
import com.gxwebsoft.shop.entity.ShopDealerBank; |
||||
|
import com.gxwebsoft.shop.mapper.ShopDealerBankMapper; |
||||
|
import com.gxwebsoft.shop.param.ShopDealerBankParam; |
||||
|
import com.gxwebsoft.shop.service.ShopDealerBankService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 分销商提现银行卡Service实现 |
||||
|
* |
||||
|
* @author 科技小王子 |
||||
|
* @since 2025-08-11 23:51:41 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class ShopDealerBankServiceImpl extends ServiceImpl<ShopDealerBankMapper, ShopDealerBank> implements ShopDealerBankService { |
||||
|
|
||||
|
@Override |
||||
|
public PageResult<ShopDealerBank> pageRel(ShopDealerBankParam param) { |
||||
|
PageParam<ShopDealerBank, ShopDealerBankParam> page = new PageParam<>(param); |
||||
|
page.setDefaultOrder("create_time desc"); |
||||
|
List<ShopDealerBank> list = baseMapper.selectPageRel(page, param); |
||||
|
return new PageResult<>(list, page.getTotal()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ShopDealerBank> listRel(ShopDealerBankParam param) { |
||||
|
List<ShopDealerBank> list = baseMapper.selectListRel(param); |
||||
|
// 排序
|
||||
|
PageParam<ShopDealerBank, ShopDealerBankParam> page = new PageParam<>(); |
||||
|
page.setDefaultOrder("create_time desc"); |
||||
|
return page.sortRecords(list); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ShopDealerBank getByIdRel(Integer id) { |
||||
|
ShopDealerBankParam param = new ShopDealerBankParam(); |
||||
|
param.setId(id); |
||||
|
return param.getOne(baseMapper.selectListRel(param)); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue