|
|
@ -1,103 +1,105 @@ |
|
|
|
package com.gxwebsoft.shop.controller; |
|
|
|
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 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; |
|
|
|
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 { |
|
|
|
/** |
|
|
|
* 分销商提现银行卡控制器 |
|
|
|
* |
|
|
|
* @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) { |
|
|
|
final User loginUser = getLoginUser(); |
|
|
|
if(loginUser == null){ |
|
|
|
return fail("请先登录",null); |
|
|
|
if (loginUser == null) { |
|
|
|
return fail("请先登录", null); |
|
|
|
} |
|
|
|
param.setUserId(loginUser.getUserId()); |
|
|
|
return success(shopDealerBankService.pageRel(param)); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:list')") |
|
|
|
@Operation(summary = "查询全部分销商提现银行卡") |
|
|
|
@GetMapping() |
|
|
|
public ApiResult<List<ShopDealerBank>> list(ShopDealerBankParam param) { |
|
|
|
final User loginUser = getLoginUser(); |
|
|
|
if(loginUser == null){ |
|
|
|
return fail("请先登录",null); |
|
|
|
} |
|
|
|
param.setUserId(loginUser.getUserId()); |
|
|
|
return success(shopDealerBankService.listRel(param)); |
|
|
|
final User loginUser = getLoginUser(); |
|
|
|
if (loginUser == null) { |
|
|
|
return fail("请先登录", null); |
|
|
|
} |
|
|
|
param.setUserId(loginUser.getUserId()); |
|
|
|
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)); |
|
|
|
// 使用关联查询
|
|
|
|
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("添加失败"); |
|
|
|
// 记录当前登录用户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) { |
|
|
|
// 记录当前登录用户id
|
|
|
|
User loginUser = getLoginUser(); |
|
|
|
if (loginUser != null) { |
|
|
|
shopDealerBank.setUserId(loginUser.getUserId()); |
|
|
|
if (shopDealerBankService.updateById(shopDealerBank)) { |
|
|
|
return success("修改成功"); |
|
|
|
return success("修改成功"); |
|
|
|
} |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
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("删除失败"); |
|
|
|
final User loginUser = getLoginUser(); |
|
|
|
if (loginUser == null) { |
|
|
|
return fail("请先登录", null); |
|
|
|
} |
|
|
|
if (shopDealerBankService.removeById(id)) { |
|
|
|
return success("删除成功"); |
|
|
|
} |
|
|
|
return fail("删除失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:save')") |
|
|
@ -105,10 +107,10 @@ public class ShopDealerBankController extends BaseController { |
|
|
|
@Operation(summary = "批量添加分销商提现银行卡") |
|
|
|
@PostMapping("/batch") |
|
|
|
public ApiResult<?> saveBatch(@RequestBody List<ShopDealerBank> list) { |
|
|
|
if (shopDealerBankService.saveBatch(list)) { |
|
|
|
return success("添加成功"); |
|
|
|
} |
|
|
|
return fail("添加失败"); |
|
|
|
if (shopDealerBankService.saveBatch(list)) { |
|
|
|
return success("添加成功"); |
|
|
|
} |
|
|
|
return fail("添加失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:update')") |
|
|
@ -116,10 +118,10 @@ public class ShopDealerBankController extends BaseController { |
|
|
|
@Operation(summary = "批量修改分销商提现银行卡") |
|
|
|
@PutMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopDealerBank> batchParam) { |
|
|
|
if (batchParam.update(shopDealerBankService, "id")) { |
|
|
|
return success("修改成功"); |
|
|
|
} |
|
|
|
return fail("修改失败"); |
|
|
|
if (batchParam.update(shopDealerBankService, "id")) { |
|
|
|
return success("修改成功"); |
|
|
|
} |
|
|
|
return fail("修改失败"); |
|
|
|
} |
|
|
|
|
|
|
|
@PreAuthorize("hasAuthority('shop:shopDealerBank:remove')") |
|
|
@ -127,10 +129,10 @@ public class ShopDealerBankController extends BaseController { |
|
|
|
@Operation(summary = "批量删除分销商提现银行卡") |
|
|
|
@DeleteMapping("/batch") |
|
|
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) { |
|
|
|
if (shopDealerBankService.removeByIds(ids)) { |
|
|
|
return success("删除成功"); |
|
|
|
} |
|
|
|
return fail("删除失败"); |
|
|
|
if (shopDealerBankService.removeByIds(ids)) { |
|
|
|
return success("删除成功"); |
|
|
|
} |
|
|
|
return fail("删除失败"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|