新增商户模块
This commit is contained in:
@@ -73,10 +73,10 @@ public class SocketIOConfig implements InitializingBean {
|
||||
config.setKeyStorePassword("123456"); // 设置证书密码
|
||||
|
||||
// 启动socket服务
|
||||
SocketIOServer server = new SocketIOServer(config);
|
||||
server.addListeners(socketIOHandler);
|
||||
server.start();
|
||||
ClientCache.setSocketIOServer(server);
|
||||
logger.debug("Netty SocketIO启动:{}:{}",host,port);
|
||||
// SocketIOServer server = new SocketIOServer(config);
|
||||
// server.addListeners(socketIOHandler);
|
||||
// server.start();
|
||||
// ClientCache.setSocketIOServer(server);
|
||||
// logger.debug("Netty SocketIO启动:{}:{}",host,port);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,18 @@ package com.gxwebsoft.common.core.utils;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.gxwebsoft.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.entity.UserRole;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Component
|
||||
public class RequestUtil {
|
||||
private static final String host = "https://modules.gxwebsoft.com/api";
|
||||
private static final String SERVER_HOST = "https://server.gxwebsoft.com/api";
|
||||
private static final String MODULES_HOST = "https://modules.gxwebsoft.com/api";
|
||||
private static String ACCESS_TOKEN;
|
||||
private static String TENANT_ID;
|
||||
|
||||
@@ -23,7 +29,7 @@ public class RequestUtil {
|
||||
String path = "/shop/merchant-account/getMerchantAccountByPhone/" + phone;
|
||||
try {
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.get(host.concat(path))
|
||||
String result = HttpRequest.get(MODULES_HOST.concat(path))
|
||||
.header("Authorization", ACCESS_TOKEN)
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.timeout(20000)//超时,毫秒
|
||||
@@ -42,7 +48,7 @@ public class RequestUtil {
|
||||
String path = "/system/user/" + userId;
|
||||
try {
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.get(host.concat(path))
|
||||
String result = HttpRequest.get(MODULES_HOST.concat(path))
|
||||
.header("Authorization", ACCESS_TOKEN)
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.timeout(20000)//超时,毫秒
|
||||
@@ -58,4 +64,52 @@ public class RequestUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
public User getUserByPhone(String phone){
|
||||
String path = "/system/user/getByPhone/" + phone;
|
||||
try {
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.get(SERVER_HOST.concat(path))
|
||||
.header("Authorization", ACCESS_TOKEN)
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
final String data = jsonObject.getString("data");
|
||||
return JSONObject.parseObject(data, User.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// 新增用户
|
||||
public boolean saveUserByPhone(MerchantAccount merchantAccount) {
|
||||
String path = "/system/user/";
|
||||
try {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("nickname",merchantAccount.getRealName());
|
||||
map.put("username", merchantAccount.getPhone());
|
||||
map.put("realName",merchantAccount.getRealName());
|
||||
map.put("phone", merchantAccount.getPhone());
|
||||
map.put("password",merchantAccount.getPassword());
|
||||
final ArrayList<Object> roles = new ArrayList<>();
|
||||
final UserRole userRole = new UserRole();
|
||||
userRole.setUserId(merchantAccount.getUserId());
|
||||
userRole.setRoleId(merchantAccount.getRoleId());
|
||||
userRole.setTenantId(merchantAccount.getTenantId());
|
||||
roles.add(userRole);
|
||||
map.put("roles",roles);
|
||||
map.put("tenantId", TENANT_ID);
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.post(SERVER_HOST.concat(path))
|
||||
.header("Authorization", ACCESS_TOKEN)
|
||||
.header("Tenantid", TENANT_ID)
|
||||
.body(JSONUtil.toJSONString(map))//表单内容
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,14 @@ public class BaseParam implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String sceneType;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
@TableField(exist = false)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty("租户ID")
|
||||
@TableField(exist = false)
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty("模糊搜素")
|
||||
@TableField(exist = false)
|
||||
private String keywords;
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.CommonRequest;
|
||||
import com.aliyuncs.CommonResponse;
|
||||
@@ -134,6 +135,19 @@ public class MainController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
String path = "/shop/merchant-account?=phone" + username;
|
||||
// 链式构建请求
|
||||
String result = HttpRequest.get("https://modules.gxwebsoft.com/api".concat(path))
|
||||
.header("Authorization", JwtUtil.getAccessToken(request))
|
||||
.header("Tenantid", "10154")
|
||||
.timeout(20000)//超时,毫秒
|
||||
.execute().body();
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
final String data = jsonObject.getString("data");
|
||||
final MerchantAccount merchantAccount = JSONObject.parseObject(data, MerchantAccount.class);
|
||||
user.setMerchantAccount(merchantAccount);
|
||||
|
||||
// 签发token
|
||||
String access_token = JwtUtil.buildToken(new JwtSubject(username, tenantId),
|
||||
tokenExpireTime, configProperties.getTokenKey());
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||
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.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.mapper.MerchantAccountMapper;
|
||||
import com.gxwebsoft.common.system.param.MerchantAccountParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantAccountService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Api(tags = "商户账号管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant-account")
|
||||
public class MerchantAccountController extends BaseController {
|
||||
@Resource
|
||||
private MerchantAccountService merchantAccountService;
|
||||
@Resource
|
||||
private MerchantAccountMapper merchantAccountMapper;
|
||||
|
||||
@ApiOperation("分页查询商户账号")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<MerchantAccount>> page(MerchantAccountParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户账号")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MerchantAccount>> list(MerchantAccountParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户账号")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<MerchantAccount> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantAccountService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商户账号")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody MerchantAccount merchantAccount, HttpServletRequest request) {
|
||||
if (merchantAccountService.count(new LambdaQueryWrapper<MerchantAccount>().eq(MerchantAccount::getPhone,merchantAccount.getPhone())) > 0) {
|
||||
return fail("手机号码已存在");
|
||||
}
|
||||
// 获取远程用户信息
|
||||
final RequestUtil requestUtil = new RequestUtil();
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
requestUtil.setAccessToken(access_token);
|
||||
requestUtil.setTenantId(getTenantId().toString());
|
||||
User userByPhone = requestUtil.getUserByPhone(merchantAccount.getPhone());
|
||||
// 新增注册
|
||||
if (userByPhone == null) {
|
||||
if (requestUtil.saveUserByPhone(merchantAccount)) {
|
||||
userByPhone = requestUtil.getUserByPhone(merchantAccount.getPhone());
|
||||
}
|
||||
}
|
||||
merchantAccount.setUserId(userByPhone.getUserId());
|
||||
if (merchantAccountService.save(merchantAccount)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商户账号")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody MerchantAccount merchantAccount) {
|
||||
if (merchantAccountService.updateById(merchantAccount)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商户账号")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantAccountService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商户账号")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<MerchantAccount> list) {
|
||||
if (merchantAccountService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商户账号")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantAccount> batchParam) {
|
||||
if (batchParam.update(merchantAccountService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商户账号")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantAccountService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("根据手机号码查询商户账号信息")
|
||||
@GetMapping("/getMerchantAccountByPhone")
|
||||
public ApiResult<MerchantAccount> getMerchantAccountByPhone(MerchantAccountParam param){
|
||||
param.setTenantId(getTenantId());
|
||||
final MerchantAccount merchantAccount = merchantAccountMapper.getMerchantAccountByPhone(param);
|
||||
if(merchantAccount == null){
|
||||
return fail("账号不存在",null);
|
||||
}
|
||||
return success(merchantAccount);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
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.MerchantApply;
|
||||
import com.gxwebsoft.common.system.param.MerchantApplyParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
@Api(tags = "商户入驻申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant-apply")
|
||||
public class MerchantApplyController extends BaseController {
|
||||
@Resource
|
||||
private MerchantApplyService merchantApplyService;
|
||||
|
||||
@ApiOperation("分页查询商户入驻申请")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<MerchantApply>> page(MerchantApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户入驻申请")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MerchantApply>> list(MerchantApplyParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户入驻申请")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<MerchantApply> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantApplyService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加商户入驻申请")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody MerchantApply merchantApply) {
|
||||
if (merchantApplyService.save(merchantApply)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改商户入驻申请")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody MerchantApply merchantApply) {
|
||||
if (merchantApplyService.updateById(merchantApply)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除商户入驻申请")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantApplyService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加商户入驻申请")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<MerchantApply> list) {
|
||||
if (merchantApplyService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改商户入驻申请")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<MerchantApply> batchParam) {
|
||||
if (batchParam.update(merchantApplyService, "apply_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除商户入驻申请")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantApplyService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||
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.Merchant;
|
||||
import com.gxwebsoft.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.param.MerchantParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantAccountService;
|
||||
import com.gxwebsoft.common.system.service.MerchantService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
@Api(tags = "商户管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/merchant")
|
||||
public class MerchantController extends BaseController {
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
@Resource
|
||||
private MerchantAccountService merchantAccountService;
|
||||
|
||||
@ApiOperation("分页查询商户")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Merchant>> page(MerchantParam param) {
|
||||
// 使用关联查询
|
||||
System.out.println("param = " + param);
|
||||
return success(merchantService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部商户")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Merchant>> list(MerchantParam param) {
|
||||
// 使用关联查询
|
||||
return success(merchantService.listRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("根据id查询商户")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Merchant> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(merchantService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:save')")
|
||||
@ApiOperation("添加商户")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Merchant merchant, HttpServletRequest request) {
|
||||
if (merchantService.count(new LambdaQueryWrapper<Merchant>().eq(Merchant::getPhone,merchant.getPhone())) > 0) {
|
||||
return fail("商户手机号码" + merchant.getPhone() + "已存在");
|
||||
}
|
||||
if (merchantService.save(merchant)) {
|
||||
// 设置商家后台入口
|
||||
merchant.setAdminUrl(merchant.getTenantId() + ".m.wsdns.cn");
|
||||
merchantService.updateById(merchant);
|
||||
// 获取用户信息
|
||||
final RequestUtil requestUtil = new RequestUtil();
|
||||
String access_token = JwtUtil.getAccessToken(request);
|
||||
requestUtil.setAccessToken(access_token);
|
||||
requestUtil.setTenantId(getTenantId().toString());
|
||||
final MerchantAccount merchantAccount = new MerchantAccount();
|
||||
merchantAccount.setMerchantId(merchant.getMerchantId());
|
||||
merchantAccount.setPhone(merchant.getPhone());
|
||||
merchantAccount.setPassword(merchant.getPhone().substring(merchant.getPhone().length() - 6));
|
||||
merchantAccount.setRealName(merchant.getRealName());
|
||||
merchantAccount.setRoleId(merchant.getRoleId());
|
||||
merchantAccount.setRoleName(merchant.getRoleName());
|
||||
requestUtil.saveUserByPhone(merchantAccount);
|
||||
merchantAccountService.save(merchantAccount);
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:update')")
|
||||
@ApiOperation("修改商户")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Merchant merchant) {
|
||||
if (merchantService.updateById(merchant)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:remove')")
|
||||
@ApiOperation("删除商户")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (merchantService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:save')")
|
||||
@ApiOperation("批量添加商户")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Merchant> list) {
|
||||
if (merchantService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:update')")
|
||||
@ApiOperation("批量修改商户")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Merchant> batchParam) {
|
||||
if (batchParam.update(merchantService, "merchant_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:remove')")
|
||||
@ApiOperation("批量删除商户")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (merchantService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
113
src/main/java/com/gxwebsoft/common/system/entity/Merchant.java
Normal file
113
src/main/java/com/gxwebsoft/common/system/entity/Merchant.java
Normal file
@@ -0,0 +1,113 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商户
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Merchant对象", description = "商户")
|
||||
@TableName("sys_merchant")
|
||||
public class Merchant implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "merchant_id", type = IdType.AUTO)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "经纬度")
|
||||
private String lngAndLat;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "详细地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
private Boolean goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "管理入口")
|
||||
private String adminUrl;
|
||||
|
||||
@ApiModelProperty(value = "所有人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "默认商户管理员角色ID")
|
||||
@TableField(exist = false)
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
@TableField(exist = false)
|
||||
private String roleName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import cn.hutool.core.util.DesensitizedUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantAccount对象", description = "商户账号")
|
||||
@TableName("sys_merchant_account")
|
||||
public class MerchantAccount implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "账号密码")
|
||||
@TableField(exist = false)
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "角色ID")
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty(value = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
@TableField(exist = false)
|
||||
private Boolean goodsReview;
|
||||
|
||||
@ApiModelProperty("手机号(脱敏)")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
public String getMobile(){
|
||||
return DesensitizedUtil.mobilePhone(this.phone);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商户入驻申请
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantApply对象", description = "商户入驻申请")
|
||||
@TableName("sys_merchant_apply")
|
||||
public class MerchantApply implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "apply_id", type = IdType.AUTO)
|
||||
private Integer applyId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
private Integer goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "MerchantType对象", description = "商户类型")
|
||||
@TableName("sys_merchant_type")
|
||||
public class MerchantType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "店铺入驻条件")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -265,6 +265,10 @@ public class User implements UserDetails {
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty("当期登录的商户账号")
|
||||
@TableField(exist = false)
|
||||
private MerchantAccount merchantAccount;
|
||||
|
||||
// @ApiModelProperty("企业信息")
|
||||
// @TableField(exist = false)
|
||||
// private Company companyInfo;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.param.MerchantAccountParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
public interface MerchantAccountMapper extends BaseMapper<MerchantAccount> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantAccount>
|
||||
*/
|
||||
List<MerchantAccount> selectPageRel(@Param("page") IPage<MerchantAccount> page,
|
||||
@Param("param") MerchantAccountParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantAccount> selectListRel(@Param("param") MerchantAccountParam param);
|
||||
|
||||
@InterceptorIgnore(tenantLine = "true")
|
||||
MerchantAccount getMerchantAccountByPhone(@Param("param") MerchantAccountParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.MerchantApply;
|
||||
import com.gxwebsoft.common.system.param.MerchantApplyParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
public interface MerchantApplyMapper extends BaseMapper<MerchantApply> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantApply>
|
||||
*/
|
||||
List<MerchantApply> selectPageRel(@Param("page") IPage<MerchantApply> page,
|
||||
@Param("param") MerchantApplyParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantApply> selectListRel(@Param("param") MerchantApplyParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.Merchant;
|
||||
import com.gxwebsoft.common.system.param.MerchantParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
public interface MerchantMapper extends BaseMapper<Merchant> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Merchant>
|
||||
*/
|
||||
List<Merchant> selectPageRel(@Param("page") IPage<Merchant> page,
|
||||
@Param("param") MerchantParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Merchant> selectListRel(@Param("param") MerchantParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.MerchantType;
|
||||
import com.gxwebsoft.common.system.param.MerchantTypeParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户类型Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
public interface MerchantTypeMapper extends BaseMapper<MerchantType> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantType>
|
||||
*/
|
||||
List<MerchantType> selectPageRel(@Param("page") IPage<MerchantType> page,
|
||||
@Param("param") MerchantTypeParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<MerchantType> selectListRel(@Param("param") MerchantTypeParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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.common.system.mapper.MerchantAccountMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.merchant_name,b.goods_review
|
||||
FROM sys_merchant_account a
|
||||
LEFT JOIN sys_merchant b ON a.merchant_id = b.merchant_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone = #{param.phone}
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantId != null">
|
||||
AND a.merchant_id = #{param.merchantId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</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.common.system.entity.MerchantAccount">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.MerchantAccount">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<select id="getMerchantAccountByPhone" resultType="com.gxwebsoft.common.system.entity.MerchantAccount">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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.common.system.mapper.MerchantApplyMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_merchant_apply a
|
||||
<where>
|
||||
<if test="param.applyId != null">
|
||||
AND a.apply_id = #{param.applyId}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.shopType != null">
|
||||
AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%')
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||
</if>
|
||||
<if test="param.commission != null">
|
||||
AND a.commission = #{param.commission}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
</if>
|
||||
<if test="param.files != null">
|
||||
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||
</if>
|
||||
<if test="param.ownStore != null">
|
||||
AND a.own_store = #{param.ownStore}
|
||||
</if>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</if>
|
||||
<if test="param.goodsReview != null">
|
||||
AND a.goods_review = #{param.goodsReview}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</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.common.system.entity.MerchantApply">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.MerchantApply">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?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.common.system.mapper.MerchantMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_merchant a
|
||||
<where>
|
||||
<if test="param.merchantId != null">
|
||||
AND a.merchant_id = #{param.merchantId}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
</if>
|
||||
<if test="param.realName != null">
|
||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||
</if>
|
||||
<if test="param.shopType != null">
|
||||
AND a.shop_type LIKE CONCAT('%', #{param.shopType}, '%')
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND a.category LIKE CONCAT('%', #{param.category}, '%')
|
||||
</if>
|
||||
<if test="param.commission != null">
|
||||
AND a.commission = #{param.commission}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND a.keywords LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
</if>
|
||||
<if test="param.files != null">
|
||||
AND a.files LIKE CONCAT('%', #{param.files}, '%')
|
||||
</if>
|
||||
<if test="param.ownStore != null">
|
||||
AND a.own_store = #{param.ownStore}
|
||||
</if>
|
||||
<if test="param.recommend != null">
|
||||
AND a.recommend = #{param.recommend}
|
||||
</if>
|
||||
<if test="param.goodsReview != null">
|
||||
AND a.goods_review = #{param.goodsReview}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</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.merchant_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.real_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.Merchant">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.Merchant">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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.common.system.mapper.MerchantTypeMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM sys_merchant_type a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</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.common.system.entity.MerchantType">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.MerchantType">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.gxwebsoft.common.system.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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商户账号查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "MerchantAccountParam对象", description = "商户账号查询参数")
|
||||
public class MerchantAccountParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.gxwebsoft.common.system.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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商户入驻申请查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "MerchantApplyParam对象", description = "商户入驻申请查询参数")
|
||||
public class MerchantApplyParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer applyId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.gxwebsoft.common.system.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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商户查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "MerchantParam对象", description = "商户查询参数")
|
||||
public class MerchantParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商户手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "商户姓名")
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String shopType;
|
||||
|
||||
@ApiModelProperty(value = "商户分类")
|
||||
private String category;
|
||||
|
||||
@ApiModelProperty(value = "所在省份")
|
||||
private String province;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String city;
|
||||
|
||||
@ApiModelProperty(value = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal commission;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(value = "资质图片")
|
||||
private String files;
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer ownStore;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer recommend;
|
||||
|
||||
@ApiModelProperty(value = "是否需要审核")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer goodsReview;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.gxwebsoft.common.system.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.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 商户类型查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "MerchantTypeParam对象", description = "商户类型查询参数")
|
||||
public class MerchantTypeParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "店铺类型")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "店铺入驻条件")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.param.MerchantAccountParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
public interface MerchantAccountService extends IService<MerchantAccount> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<MerchantAccount>
|
||||
*/
|
||||
PageResult<MerchantAccount> pageRel(MerchantAccountParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantAccount>
|
||||
*/
|
||||
List<MerchantAccount> listRel(MerchantAccountParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return MerchantAccount
|
||||
*/
|
||||
MerchantAccount getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.MerchantApply;
|
||||
import com.gxwebsoft.common.system.param.MerchantApplyParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
public interface MerchantApplyService extends IService<MerchantApply> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<MerchantApply>
|
||||
*/
|
||||
PageResult<MerchantApply> pageRel(MerchantApplyParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantApply>
|
||||
*/
|
||||
List<MerchantApply> listRel(MerchantApplyParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param applyId ID
|
||||
* @return MerchantApply
|
||||
*/
|
||||
MerchantApply getByIdRel(Integer applyId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.Merchant;
|
||||
import com.gxwebsoft.common.system.param.MerchantParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
public interface MerchantService extends IService<Merchant> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<Merchant>
|
||||
*/
|
||||
PageResult<Merchant> pageRel(MerchantParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<Merchant>
|
||||
*/
|
||||
List<Merchant> listRel(MerchantParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param merchantId ID
|
||||
* @return Merchant
|
||||
*/
|
||||
Merchant getByIdRel(Integer merchantId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.MerchantType;
|
||||
import com.gxwebsoft.common.system.param.MerchantTypeParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户类型Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
public interface MerchantTypeService extends IService<MerchantType> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<MerchantType>
|
||||
*/
|
||||
PageResult<MerchantType> pageRel(MerchantTypeParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<MerchantType>
|
||||
*/
|
||||
List<MerchantType> listRel(MerchantTypeParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return MerchantType
|
||||
*/
|
||||
MerchantType getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.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.common.system.entity.MerchantAccount;
|
||||
import com.gxwebsoft.common.system.mapper.MerchantAccountMapper;
|
||||
import com.gxwebsoft.common.system.param.MerchantAccountParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantAccountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户账号Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-19 12:02:24
|
||||
*/
|
||||
@Service
|
||||
public class MerchantAccountServiceImpl extends ServiceImpl<MerchantAccountMapper, MerchantAccount> implements MerchantAccountService {
|
||||
|
||||
@Override
|
||||
public PageResult<MerchantAccount> pageRel(MerchantAccountParam param) {
|
||||
PageParam<MerchantAccount, MerchantAccountParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<MerchantAccount> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MerchantAccount> listRel(MerchantAccountParam param) {
|
||||
List<MerchantAccount> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<MerchantAccount, MerchantAccountParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantAccount getByIdRel(Integer id) {
|
||||
MerchantAccountParam param = new MerchantAccountParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.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.common.system.entity.MerchantApply;
|
||||
import com.gxwebsoft.common.system.mapper.MerchantApplyMapper;
|
||||
import com.gxwebsoft.common.system.param.MerchantApplyParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantApplyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户入驻申请Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 01:24:36
|
||||
*/
|
||||
@Service
|
||||
public class MerchantApplyServiceImpl extends ServiceImpl<MerchantApplyMapper, MerchantApply> implements MerchantApplyService {
|
||||
|
||||
@Override
|
||||
public PageResult<MerchantApply> pageRel(MerchantApplyParam param) {
|
||||
PageParam<MerchantApply, MerchantApplyParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<MerchantApply> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MerchantApply> listRel(MerchantApplyParam param) {
|
||||
List<MerchantApply> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<MerchantApply, MerchantApplyParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantApply getByIdRel(Integer applyId) {
|
||||
MerchantApplyParam param = new MerchantApplyParam();
|
||||
param.setApplyId(applyId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.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.common.system.entity.Merchant;
|
||||
import com.gxwebsoft.common.system.mapper.MerchantMapper;
|
||||
import com.gxwebsoft.common.system.param.MerchantParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:03:54
|
||||
*/
|
||||
@Service
|
||||
public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> implements MerchantService {
|
||||
|
||||
@Override
|
||||
public PageResult<Merchant> pageRel(MerchantParam param) {
|
||||
PageParam<Merchant, MerchantParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<Merchant> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Merchant> listRel(MerchantParam param) {
|
||||
List<Merchant> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<Merchant, MerchantParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Merchant getByIdRel(Integer merchantId) {
|
||||
MerchantParam param = new MerchantParam();
|
||||
param.setMerchantId(merchantId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.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.common.system.entity.MerchantType;
|
||||
import com.gxwebsoft.common.system.mapper.MerchantTypeMapper;
|
||||
import com.gxwebsoft.common.system.param.MerchantTypeParam;
|
||||
import com.gxwebsoft.common.system.service.MerchantTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商户类型Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-04-05 00:08:51
|
||||
*/
|
||||
@Service
|
||||
public class MerchantTypeServiceImpl extends ServiceImpl<MerchantTypeMapper, MerchantType> implements MerchantTypeService {
|
||||
|
||||
@Override
|
||||
public PageResult<MerchantType> pageRel(MerchantTypeParam param) {
|
||||
PageParam<MerchantType, MerchantTypeParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<MerchantType> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MerchantType> listRel(MerchantTypeParam param) {
|
||||
List<MerchantType> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<MerchantType, MerchantTypeParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantType getByIdRel(Integer id) {
|
||||
MerchantTypeParam param = new MerchantTypeParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user