重构服务器管理、新增订单管理

This commit is contained in:
gxwebsoft
2024-02-29 18:09:50 +08:00
parent 8208122e12
commit 777af7b4e5
14 changed files with 719 additions and 47 deletions
@@ -19,8 +19,7 @@ import io.swagger.annotations.ApiOperation;
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.*;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.gxwebsoft.common.core.constants.AppUserConstants.ADMINISTRATOR; import static com.gxwebsoft.common.core.constants.AppUserConstants.ADMINISTRATOR;
@@ -42,6 +41,40 @@ public class AppController extends BaseController {
@Resource @Resource
private RedisUtil redisUtil; private RedisUtil redisUtil;
@ApiOperation("统计信息")
@GetMapping("/data")
public ApiResult<Map<String, Integer>> data() {
Map<String, Integer> data = new HashMap<>();
Integer totalNum = appService.count(
new LambdaQueryWrapper<App>()
.ne(App::getAppStatus, "已下架")
);
Integer totalNum2 = appService.count(
new LambdaQueryWrapper<App>()
.eq(App::getAppStatus, "开发中")
);
Integer totalNum3 = appService.count(
new LambdaQueryWrapper<App>()
.eq(App::getAppStatus, "已上架")
);
Integer totalNum4 = appService.count(
new LambdaQueryWrapper<App>()
.eq(App::getAppStatus, "已上架")
.eq(App::getShowExpiration,false)
);
Integer totalNum5 = appService.count(
new LambdaQueryWrapper<App>()
.eq(App::getAppStatus, "已下架")
);
data.put("totalNum", totalNum);
data.put("totalNum2", totalNum2);
data.put("totalNum3", totalNum3);
data.put("totalNum4", totalNum4);
data.put("totalNum5", totalNum5);
return success(data);
}
@ApiOperation("分页查询应用管理记录表") @ApiOperation("分页查询应用管理记录表")
@GetMapping("/page") @GetMapping("/page")
public ApiResult<PageResult<App>> page(AppParam param) { public ApiResult<PageResult<App>> page(AppParam param) {
@@ -103,6 +136,7 @@ public class AppController extends BaseController {
// 添加应用管理员 // 添加应用管理员
if (loginUser != null) { if (loginUser != null) {
appUser.setUserId(loginUser.getUserId()); appUser.setUserId(loginUser.getUserId());
appUser.setNickname(loginUser.getNickname());
appUser.setAppId(app.getAppId()); appUser.setAppId(app.getAppId());
appUser.setRole(ADMINISTRATOR); appUser.setRole(ADMINISTRATOR);
appUserService.save(appUser); appUserService.save(appUser);
@@ -3,30 +3,27 @@ package com.gxwebsoft.oa.controller;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.utils.BtUtil; import com.gxwebsoft.common.core.utils.BtUtil;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.AssetsUser;
import com.gxwebsoft.oa.service.AssetsService;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.param.AssetsParam;
import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult; import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam; import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog; import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.entity.AssetsUser;
import com.gxwebsoft.oa.param.AssetsParam;
import com.gxwebsoft.oa.service.AssetsService;
import com.gxwebsoft.oa.service.AssetsUserService; import com.gxwebsoft.oa.service.AssetsUserService;
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.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.gxwebsoft.common.core.constants.AppUserConstants.ADMINISTRATOR;
/** /**
* 服务器资产记录表控制器 * 服务器资产记录表控制器
* *
@@ -44,6 +41,34 @@ public class AssetsController extends BaseController {
@Resource @Resource
private BtUtil btUtil; private BtUtil btUtil;
@ApiOperation("统计信息")
@GetMapping("/data")
public ApiResult<Map<String, Integer>> data() {
Map<String, Integer> data = new HashMap<>();
Integer totalNum = assetsService.count(
new LambdaQueryWrapper<Assets>()
);
Integer totalNum1 = assetsService.count(
new LambdaQueryWrapper<Assets>()
.eq(Assets::getStatus, "运行中")
);
Integer totalNum2 = assetsService.count(
new LambdaQueryWrapper<Assets>()
.eq(Assets::getStatus, "已过期")
);
Integer totalNum3 = assetsService.count(
new LambdaQueryWrapper<Assets>()
.eq(Assets::getStatus, "已销毁")
);
data.put("totalNum", totalNum);
data.put("totalNum1", totalNum1);
data.put("totalNum2", totalNum2);
data.put("totalNum3", totalNum3);
return success(data);
}
@ApiOperation("分页查询服务器资产记录表") @ApiOperation("分页查询服务器资产记录表")
@GetMapping("/page") @GetMapping("/page")
public ApiResult<PageResult<Assets>> page(AssetsParam param) { public ApiResult<PageResult<Assets>> page(AssetsParam param) {
@@ -82,11 +107,14 @@ public class AssetsController extends BaseController {
@GetMapping("/{id}") @GetMapping("/{id}")
public ApiResult<Assets> get(@PathVariable("id") Integer id) { public ApiResult<Assets> get(@PathVariable("id") Integer id) {
final Assets assets = assetsService.getByIdRel(id); final Assets assets = assetsService.getByIdRel(id);
final BtUtil client = btUtil.client(id); // 查询宝塔接口
final String systemTotal = client.getSystemTotal(); if(StrUtil.isNotBlank(assets.getBtSign())){
final String diskInfo = client.getDiskInfo(); final BtUtil client = btUtil.client(id);
assets.setSystemTotal(systemTotal); final String systemTotal = client.getSystemTotal();
assets.setDiskInfo(diskInfo); final String diskInfo = client.getDiskInfo();
assets.setSystemTotal(systemTotal);
assets.setDiskInfo(diskInfo);
}
// 使用关联查询 // 使用关联查询
return success(assets); return success(assets);
} }
@@ -103,6 +131,15 @@ public class AssetsController extends BaseController {
return fail("该IP地址已存在"); return fail("该IP地址已存在");
} }
if (assetsService.save(assets)) { if (assetsService.save(assets)) {
// 添加应用管理员
if (loginUser != null) {
final AssetsUser assetsUser = new AssetsUser();
assetsUser.setUserId(loginUser.getUserId());
assetsUser.setNickname(loginUser.getNickname());
assetsUser.setAssetsId(assets.getAssetsId());
assetsUser.setRole(ADMINISTRATOR);
assetsUserService.save(assetsUser);
}
return success("添加成功"); return success("添加成功");
} }
return fail("添加失败"); return fail("添加失败");
@@ -84,6 +84,7 @@ public class CompanyController extends BaseController {
if (companyService.save(company)) { if (companyService.save(company)) {
// 添加客户所有者 // 添加客户所有者
companyUser.setUserId(loginUser.getUserId()); companyUser.setUserId(loginUser.getUserId());
companyUser.setNickname(loginUser.getNickname());
companyUser.setCompanyId(company.getCompanyId()); companyUser.setCompanyId(company.getCompanyId());
companyUser.setRole(ADMINISTRATOR); companyUser.setRole(ADMINISTRATOR);
companyUserService.save(companyUser); companyUserService.save(companyUser);
@@ -0,0 +1,112 @@
package com.gxwebsoft.oa.controller;
import com.gxwebsoft.common.core.web.*;
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.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 订单记录表控制器
*
* @author 科技小王子
* @since 2024-02-29 18:02:30
*/
@Api(tags = "订单记录表管理")
@RestController
@RequestMapping("/api/oa/order")
public class OrderController extends BaseController {
@Resource
private OrderService orderService;
@ApiOperation("分页查询订单记录表")
@GetMapping("/page")
public ApiResult<PageResult<Order>> page(OrderParam param) {
// 使用关联查询
return success(orderService.pageRel(param));
}
@ApiOperation("查询全部订单记录表")
@GetMapping()
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));
}
@ApiOperation("根据id查询订单记录表")
@GetMapping("/{id}")
public ApiResult<Order> get(@PathVariable("id") Integer id) {
return success(orderService.getById(id));
// 使用关联查询
//return success(orderService.getByIdRel(id));
}
@ApiOperation("添加订单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Order order) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
order.setUserId(loginUser.getUserId());
}
if (orderService.save(order)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改订单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Order order) {
if (orderService.updateById(order)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除订单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加订单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
if (orderService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改订单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
if (batchParam.update(orderService, "order_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除订单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}
@@ -1,18 +1,16 @@
package com.gxwebsoft.oa.entity; package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.TableField;
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.TableName;
import java.io.Serializable;
import java.util.Date;
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.util.Date;
/** /**
* 服务器成员管理 * 服务器成员管理
* *
@@ -49,23 +47,6 @@ public class AssetsUser implements Serializable {
private Date createTime; private Date createTime;
@ApiModelProperty(value = "昵称") @ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname; private String nickname;
@ApiModelProperty(value = "用户名")
@TableField(exist = false)
private String username;
@ApiModelProperty(value = "手机号码")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "邮箱")
@TableField(exist = false)
private String email;
@ApiModelProperty(value = "头像")
@TableField(exist = false)
private String avatar;
} }
@@ -48,7 +48,6 @@ public class CompanyUser implements Serializable {
private Date createTime; private Date createTime;
@ApiModelProperty(value = "昵称") @ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname; private String nickname;
@ApiModelProperty(value = "用户名") @ApiModelProperty(value = "用户名")
@@ -0,0 +1,128 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
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.time.LocalDateTime;
import java.util.Date;
/**
* 订单记录表
*
* @author 科技小王子
* @since 2024-02-29 18:02:30
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Order对象", description = "订单记录表")
@TableName("oa_order")
public class Order implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@TableId(value = "order_id", type = IdType.AUTO)
private Integer orderId;
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "类型")
private Integer type;
@ApiModelProperty(value = "付款金额")
private BigDecimal money;
@ApiModelProperty(value = "实际付款金额(包含运费)")
private BigDecimal payPrice;
@ApiModelProperty(value = "套餐ID")
private Integer planId;
@ApiModelProperty(value = "卡ID")
private Integer priceId;
@ApiModelProperty(value = "获得的会员等级")
private Integer gradeId;
@ApiModelProperty(value = "卡名称")
private String priceName;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "持有者ID")
private Integer memberId;
@ApiModelProperty(value = "真实姓名")
private String realName;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "付款时间")
private LocalDateTime payTime;
@ApiModelProperty(value = "支付流水号")
private String transactionId;
@ApiModelProperty(value = "付款状态(10未付款 20已付款)")
private Integer payStatus;
@ApiModelProperty(value = "到期时间")
private LocalDateTime expirationTime;
@ApiModelProperty(value = "所在省份")
private String province;
@ApiModelProperty(value = "所在城市")
private String city;
@ApiModelProperty(value = "所在辖区")
private String region;
@ApiModelProperty(value = "所在地区")
private String area;
@ApiModelProperty(value = "街道地址")
private String address;
@ApiModelProperty(value = "退款凭证")
private String refundImage;
@ApiModelProperty(value = "退款理由")
private String refundContent;
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
private Integer isSettled;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
@@ -0,0 +1,37 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Order;
import com.gxwebsoft.oa.param.OrderParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 订单记录表Mapper
*
* @author 科技小王子
* @since 2024-02-29 18:02:30
*/
public interface OrderMapper extends BaseMapper<Order> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Order>
*/
List<Order> selectPageRel(@Param("page") IPage<Order> page,
@Param("param") OrderParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Order> selectListRel(@Param("param") OrderParam param);
}
@@ -4,8 +4,9 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.* SELECT a.*,b.short_name,b.company_name
FROM oa_assets a FROM oa_assets a
LEFT JOIN oa_company b ON a.company_id = b.company_id
<where> <where>
<if test="param.assetsId != null"> <if test="param.assetsId != null">
AND a.assets_id = #{param.assetsId} AND a.assets_id = #{param.assetsId}
@@ -0,0 +1,124 @@
<?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.oa.mapper.OrderMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM oa_order a
<where>
<if test="param.orderId != null">
AND a.order_id = #{param.orderId}
</if>
<if test="param.orderNo != null">
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
</if>
<if test="param.type != null">
AND a.type = #{param.type}
</if>
<if test="param.money != null">
AND a.money = #{param.money}
</if>
<if test="param.payPrice != null">
AND a.pay_price = #{param.payPrice}
</if>
<if test="param.planId != null">
AND a.plan_id = #{param.planId}
</if>
<if test="param.priceId != null">
AND a.price_id = #{param.priceId}
</if>
<if test="param.gradeId != null">
AND a.grade_id = #{param.gradeId}
</if>
<if test="param.priceName != null">
AND a.price_name LIKE CONCAT('%', #{param.priceName}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.memberId != null">
AND a.member_id = #{param.memberId}
</if>
<if test="param.realName != null">
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
</if>
<if test="param.phone != null">
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
</if>
<if test="param.payTime != null">
AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%')
</if>
<if test="param.transactionId != null">
AND a.transaction_id LIKE CONCAT('%', #{param.transactionId}, '%')
</if>
<if test="param.payStatus != null">
AND a.pay_status = #{param.payStatus}
</if>
<if test="param.expirationTime != null">
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
</if>
<if test="param.province != null">
AND a.province LIKE CONCAT('%', #{param.province}, '%')
</if>
<if test="param.city != null">
AND a.city LIKE CONCAT('%', #{param.city}, '%')
</if>
<if test="param.region != null">
AND a.region LIKE CONCAT('%', #{param.region}, '%')
</if>
<if test="param.area != null">
AND a.area LIKE CONCAT('%', #{param.area}, '%')
</if>
<if test="param.address != null">
AND a.address LIKE CONCAT('%', #{param.address}, '%')
</if>
<if test="param.refundImage != null">
AND a.refund_image LIKE CONCAT('%', #{param.refundImage}, '%')
</if>
<if test="param.refundContent != null">
AND a.refund_content LIKE CONCAT('%', #{param.refundContent}, '%')
</if>
<if test="param.isSettled != null">
AND a.is_settled = #{param.isSettled}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</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.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.phone LIKE CONCAT('%', #{param.keywords}, '%')
OR a.order_no LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Order">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Order">
<include refid="selectSql"></include>
</select>
</mapper>
@@ -0,0 +1,128 @@
package com.gxwebsoft.oa.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-02-29 18:02:30
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "OrderParam对象", description = "订单记录表查询参数")
public class OrderParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@QueryField(type = QueryType.EQ)
private Integer orderId;
@ApiModelProperty(value = "订单号")
private String orderNo;
@ApiModelProperty(value = "类型")
@QueryField(type = QueryType.EQ)
private Integer type;
@ApiModelProperty(value = "付款金额")
@QueryField(type = QueryType.EQ)
private BigDecimal money;
@ApiModelProperty(value = "实际付款金额(包含运费)")
@QueryField(type = QueryType.EQ)
private BigDecimal payPrice;
@ApiModelProperty(value = "套餐ID")
@QueryField(type = QueryType.EQ)
private Integer planId;
@ApiModelProperty(value = "卡ID")
@QueryField(type = QueryType.EQ)
private Integer priceId;
@ApiModelProperty(value = "获得的会员等级")
@QueryField(type = QueryType.EQ)
private Integer gradeId;
@ApiModelProperty(value = "卡名称")
private String priceName;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "持有者ID")
@QueryField(type = QueryType.EQ)
private Integer memberId;
@ApiModelProperty(value = "真实姓名")
private String realName;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "付款时间")
private String payTime;
@ApiModelProperty(value = "支付流水号")
private String transactionId;
@ApiModelProperty(value = "付款状态(10未付款 20已付款)")
@QueryField(type = QueryType.EQ)
private Integer payStatus;
@ApiModelProperty(value = "到期时间")
private String expirationTime;
@ApiModelProperty(value = "所在省份")
private String province;
@ApiModelProperty(value = "所在城市")
private String city;
@ApiModelProperty(value = "所在辖区")
private String region;
@ApiModelProperty(value = "所在地区")
private String area;
@ApiModelProperty(value = "街道地址")
private String address;
@ApiModelProperty(value = "退款凭证")
private String refundImage;
@ApiModelProperty(value = "退款理由")
private String refundContent;
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
@QueryField(type = QueryType.EQ)
private Integer isSettled;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
}
@@ -0,0 +1,42 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Order;
import com.gxwebsoft.oa.param.OrderParam;
import java.util.List;
/**
* 订单记录表Service
*
* @author 科技小王子
* @since 2024-02-29 18:02:30
*/
public interface OrderService extends IService<Order> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Order>
*/
PageResult<Order> pageRel(OrderParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Order>
*/
List<Order> listRel(OrderParam param);
/**
* 根据id查询
*
* @param orderId ID
* @return Order
*/
Order getByIdRel(Integer orderId);
}
@@ -0,0 +1,47 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.OrderMapper;
import com.gxwebsoft.oa.service.OrderService;
import com.gxwebsoft.oa.entity.Order;
import com.gxwebsoft.oa.param.OrderParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 订单记录表Service实现
*
* @author 科技小王子
* @since 2024-02-29 18:02:30
*/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
@Override
public PageResult<Order> pageRel(OrderParam param) {
PageParam<Order, OrderParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Order> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Order> listRel(OrderParam param) {
List<Order> list = baseMapper.selectListRel(param);
// 排序
PageParam<Order, OrderParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Order getByIdRel(Integer orderId) {
OrderParam param = new OrderParam();
param.setOrderId(orderId);
return param.getOne(baseMapper.selectListRel(param));
}
}
@@ -56,8 +56,9 @@ public class OaGenerator {
// "oa_product_tabs", // "oa_product_tabs",
// "oa_app_field", // "oa_app_field",
// "oa_link", // "oa_link",
"oa_company_field", // "oa_company_field",
"oa_company_user" // "oa_company_user",
"oa_order"
}; };
// 需要去除的表前缀 // 需要去除的表前缀
private static final String[] TABLE_PREFIX = new String[]{ private static final String[] TABLE_PREFIX = new String[]{