改造订单表、导航表
This commit is contained in:
@@ -80,6 +80,12 @@ public class Navigation implements Serializable {
|
|||||||
@ApiModelProperty(value = "绑定的知识文档")
|
@ApiModelProperty(value = "绑定的知识文档")
|
||||||
private String bookCode;
|
private String bookCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品分类ID")
|
||||||
|
private Integer goodsCategoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品ID")
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户ID")
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,12 @@
|
|||||||
<if test="param.bookCode != null">
|
<if test="param.bookCode != null">
|
||||||
AND a.book_code = #{param.bookCode}
|
AND a.book_code = #{param.bookCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.goodsCategoryId != null">
|
||||||
|
AND a.goods_category_id = #{param.goodsCategoryId}
|
||||||
|
</if>
|
||||||
|
<if test="param.goods_id != null">
|
||||||
|
AND a.goods_id = #{param.goodsId}
|
||||||
|
</if>
|
||||||
<if test="param.active != null">
|
<if test="param.active != null">
|
||||||
AND a.active LIKE CONCAT('%', #{param.active}, '%')
|
AND a.active LIKE CONCAT('%', #{param.active}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -90,4 +90,12 @@ public class NavigationParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private String bookCode;
|
private String bookCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品分类ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsCategoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商品ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.gxwebsoft.common.core.utils;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class RequestUtil {
|
||||||
|
private static final String host = "https://server.gxwebsoft.com/api";
|
||||||
|
private static String ACCESS_TOKEN;
|
||||||
|
private static String TENANT_ID;
|
||||||
|
|
||||||
|
public void setTenantId(String tenantId){
|
||||||
|
TENANT_ID = tenantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessToken(String token){
|
||||||
|
ACCESS_TOKEN = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getUserByPhone(String phone){
|
||||||
|
String path = "/system/user/getByPhone/" + phone;
|
||||||
|
try {
|
||||||
|
// 链式构建请求
|
||||||
|
String result = HttpRequest.get(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,8 +68,12 @@ public class GoodsController extends BaseController {
|
|||||||
final Goods goods = goodsService.getByIdRel(id);
|
final Goods goods = goodsService.getByIdRel(id);
|
||||||
final List<GoodsSpec> goodsSpecList = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id));
|
final List<GoodsSpec> goodsSpecList = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id));
|
||||||
final List<GoodsSku> goodsSkuList = goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, id));
|
final List<GoodsSku> goodsSkuList = goodsSkuService.list(new LambdaQueryWrapper<GoodsSku>().eq(GoodsSku::getGoodsId, id));
|
||||||
goods.setGoodsSpecs(goodsSpecList);
|
if(goodsSpecList != null){
|
||||||
goods.setGoodsSkus(goodsSkuList);
|
goods.setGoodsSpecs(goodsSpecList);
|
||||||
|
}
|
||||||
|
if(goodsSkuList != null){
|
||||||
|
goods.setGoodsSkus(goodsSkuList);
|
||||||
|
}
|
||||||
return success(goods);
|
return success(goods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,26 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
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.BaseController;
|
||||||
import com.gxwebsoft.shop.service.MerchantService;
|
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.Merchant;
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
import com.gxwebsoft.shop.param.MerchantParam;
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.shop.service.MerchantService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.bouncycastle.cert.ocsp.Req;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,13 +59,19 @@ public class MerchantController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("添加商户")
|
@ApiOperation("添加商户")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Merchant merchant) {
|
public ApiResult<?> save(@RequestBody Merchant merchant, HttpServletRequest request) {
|
||||||
// 记录当前登录用户id
|
if (merchantService.count(new LambdaQueryWrapper<Merchant>().eq(Merchant::getPhone,merchant.getPhone())) > 0) {
|
||||||
// User loginUser = getLoginUser();
|
return fail("商户手机号码" + merchant.getPhone() + "已存在");
|
||||||
// if (loginUser != null) {
|
}
|
||||||
// merchant.setUserId(loginUser.getUserId());
|
// 跟进手机号获取用户信息
|
||||||
// }
|
final RequestUtil requestUtil = new RequestUtil();
|
||||||
if (merchantService.save(merchant)) {
|
requestUtil.setAccessToken(JwtUtil.getAccessToken(request));
|
||||||
|
requestUtil.setTenantId(getTenantId().toString());
|
||||||
|
final User user = requestUtil.getUserByPhone(merchant.getPhone());
|
||||||
|
if(user != null){
|
||||||
|
merchant.setUserId(user.getUserId());
|
||||||
|
}
|
||||||
|
if (merchantService.save(merchant)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
|
|||||||
+30
-30
@@ -1,72 +1,72 @@
|
|||||||
package com.gxwebsoft.oa.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.common.core.web.*;
|
import com.gxwebsoft.shop.service.OrderService;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import com.gxwebsoft.oa.entity.Order;
|
|
||||||
import com.gxwebsoft.oa.param.OrderParam;
|
|
||||||
import com.gxwebsoft.oa.service.OrderService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表控制器
|
* 订单控制器
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
@Api(tags = "订单记录表管理")
|
@Api(tags = "订单管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/oa/order")
|
@RequestMapping("/api/shop/order")
|
||||||
public class OrderController extends BaseController {
|
public class OrderController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
|
|
||||||
@ApiOperation("分页查询订单记录表")
|
@ApiOperation("分页查询订单")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Order>> page(OrderParam param) {
|
public ApiResult<PageResult<Order>> page(OrderParam param) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
return success(orderService.pageRel(param));
|
return success(orderService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询全部订单记录表")
|
@ApiOperation("查询全部订单")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Order>> list(OrderParam param) {
|
public ApiResult<List<Order>> list(OrderParam param) {
|
||||||
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(orderService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
//return success(orderService.listRel(param));
|
return success(orderService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("根据id查询订单记录表")
|
@ApiOperation("根据id查询订单")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<Order> get(@PathVariable("id") Integer id) {
|
public ApiResult<Order> get(@PathVariable("id") Integer id) {
|
||||||
return success(orderService.getById(id));
|
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
//return success(orderService.getByIdRel(id));
|
return success(orderService.getByIdRel(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("添加订单记录表")
|
@ApiOperation("添加订单")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Order order) {
|
public ApiResult<?> save(@RequestBody Order order) {
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id
|
||||||
User loginUser = getLoginUser();
|
// User loginUser = getLoginUser();
|
||||||
if (loginUser != null) {
|
// if (loginUser != null) {
|
||||||
order.setUserId(loginUser.getUserId());
|
// order.setUserId(loginUser.getUserId());
|
||||||
}
|
// }
|
||||||
order.setOrderNo(CommonUtil.createOrderNo());
|
|
||||||
if (orderService.save(order)) {
|
if (orderService.save(order)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改订单记录表")
|
@ApiOperation("修改订单")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Order order) {
|
public ApiResult<?> update(@RequestBody Order order) {
|
||||||
if (orderService.updateById(order)) {
|
if (orderService.updateById(order)) {
|
||||||
@@ -75,7 +75,7 @@ public class OrderController extends BaseController {
|
|||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除订单记录表")
|
@ApiOperation("删除订单")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
if (orderService.removeById(id)) {
|
if (orderService.removeById(id)) {
|
||||||
@@ -84,7 +84,7 @@ public class OrderController extends BaseController {
|
|||||||
return fail("删除失败");
|
return fail("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("批量添加订单记录表")
|
@ApiOperation("批量添加订单")
|
||||||
@PostMapping("/batch")
|
@PostMapping("/batch")
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
|
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
|
||||||
if (orderService.saveBatch(list)) {
|
if (orderService.saveBatch(list)) {
|
||||||
@@ -93,7 +93,7 @@ public class OrderController extends BaseController {
|
|||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("批量修改订单记录表")
|
@ApiOperation("批量修改订单")
|
||||||
@PutMapping("/batch")
|
@PutMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
|
||||||
if (batchParam.update(orderService, "order_id")) {
|
if (batchParam.update(orderService, "order_id")) {
|
||||||
@@ -102,7 +102,7 @@ public class OrderController extends BaseController {
|
|||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("批量删除订单记录表")
|
@ApiOperation("批量删除订单")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
if (orderService.removeByIds(ids)) {
|
if (orderService.removeByIds(ids)) {
|
||||||
@@ -69,6 +69,9 @@ public class Merchant implements Serializable {
|
|||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所有人")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
|||||||
+15
-14
@@ -1,29 +1,27 @@
|
|||||||
package com.gxwebsoft.oa.entity;
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import java.io.Serializable;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表
|
* 订单
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@ApiModel(value = "Order对象", description = "订单记录表")
|
@ApiModel(value = "Order对象", description = "订单")
|
||||||
@TableName("oa_order")
|
@TableName("shop_order")
|
||||||
public class Order implements Serializable {
|
public class Order implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "类型")
|
@ApiModelProperty(value = "类型")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "付款金额")
|
@ApiModelProperty(value = "订单金额")
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
|
|
||||||
@ApiModelProperty(value = "实际付款金额(包含运费)")
|
@ApiModelProperty(value = "实际付款金额(包含运费)")
|
||||||
@@ -70,6 +68,9 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "付款时间")
|
@ApiModelProperty(value = "付款时间")
|
||||||
private LocalDateTime payTime;
|
private LocalDateTime payTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "支付方式")
|
||||||
|
private Integer payMethod;
|
||||||
|
|
||||||
@ApiModelProperty(value = "支付流水号")
|
@ApiModelProperty(value = "支付流水号")
|
||||||
private String transactionId;
|
private String transactionId;
|
||||||
|
|
||||||
@@ -120,9 +121,9 @@ public class Order implements Serializable {
|
|||||||
private Integer tenantId;
|
private Integer tenantId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private Date updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,18 +1,18 @@
|
|||||||
package com.gxwebsoft.oa.mapper;
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.gxwebsoft.oa.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.oa.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表Mapper
|
* 订单Mapper
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
public interface OrderMapper extends BaseMapper<Order> {
|
public interface OrderMapper extends BaseMapper<Order> {
|
||||||
|
|
||||||
+7
-8
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.gxwebsoft.oa.mapper.OrderMapper">
|
<mapper namespace="com.gxwebsoft.shop.mapper.OrderMapper">
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM oa_order a
|
FROM shop_order a
|
||||||
<where>
|
<where>
|
||||||
<if test="param.orderId != null">
|
<if test="param.orderId != null">
|
||||||
AND a.order_id = #{param.orderId}
|
AND a.order_id = #{param.orderId}
|
||||||
@@ -104,20 +104,19 @@
|
|||||||
AND a.create_time <= #{param.createTimeEnd}
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.keywords != null">
|
<if test="param.keywords != null">
|
||||||
AND (a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.order_no LIKE CONCAT('%', #{param.keywords}, '%')
|
)
|
||||||
)
|
</if>
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Order">
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Order">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
<!-- 查询全部 -->
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Order">
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Order">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
+7
-8
@@ -1,26 +1,25 @@
|
|||||||
package com.gxwebsoft.oa.param;
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import java.math.BigDecimal;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表查询参数
|
* 订单查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@ApiModel(value = "OrderParam对象", description = "订单记录表查询参数")
|
@ApiModel(value = "OrderParam对象", description = "订单查询参数")
|
||||||
public class OrderParam extends BaseParam {
|
public class OrderParam extends BaseParam {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -35,7 +34,7 @@ public class OrderParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "付款金额")
|
@ApiModelProperty(value = "订单金额")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
|
|
||||||
+5
-5
@@ -1,17 +1,17 @@
|
|||||||
package com.gxwebsoft.oa.service;
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import com.gxwebsoft.oa.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.oa.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表Service
|
* 订单Service
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
public interface OrderService extends IService<Order> {
|
public interface OrderService extends IService<Order> {
|
||||||
|
|
||||||
+9
-9
@@ -1,10 +1,10 @@
|
|||||||
package com.gxwebsoft.oa.service.impl;
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gxwebsoft.oa.mapper.OrderMapper;
|
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||||
import com.gxwebsoft.oa.service.OrderService;
|
import com.gxwebsoft.shop.service.OrderService;
|
||||||
import com.gxwebsoft.oa.entity.Order;
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
import com.gxwebsoft.oa.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -12,10 +12,10 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单记录表Service实现
|
* 订单Service实现
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-02-29 18:02:30
|
* @since 2024-04-06 12:12:48
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
|
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
|
||||||
@@ -23,7 +23,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<Order> pageRel(OrderParam param) {
|
public PageResult<Order> pageRel(OrderParam param) {
|
||||||
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("create_time desc");
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
List<Order> list = baseMapper.selectPageRel(page, param);
|
List<Order> list = baseMapper.selectPageRel(page, param);
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
List<Order> list = baseMapper.selectListRel(param);
|
List<Order> list = baseMapper.selectListRel(param);
|
||||||
// 排序
|
// 排序
|
||||||
PageParam<Order, OrderParam> page = new PageParam<>();
|
PageParam<Order, OrderParam> page = new PageParam<>();
|
||||||
//page.setDefaultOrder("create_time desc");
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,8 @@ public class ShopGenerator {
|
|||||||
// "shop_brand",
|
// "shop_brand",
|
||||||
// "shop_merchant",
|
// "shop_merchant",
|
||||||
// "shop_merchant_type",
|
// "shop_merchant_type",
|
||||||
"shop_merchant_apply"
|
// "shop_merchant_apply",
|
||||||
|
"shop_order"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
Reference in New Issue
Block a user