ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/entity/Order.java
@@ -147,7 +147,7 @@ @TableField("subsidy") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") @TableField("is_withdrawal") private Integer isWithdrawal; ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/entity/OrderRequest.java
@@ -100,7 +100,7 @@ @ApiModelProperty("订单补贴金额") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; @ApiModelProperty("详细地址") ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/entity/Withdraw.java
@@ -13,6 +13,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * <p> @@ -63,6 +64,9 @@ @ApiModelProperty("城市code") @TableField("city_code") private String cityCode; @ApiModelProperty("提现进度") @TableField(exist = false) private List<WithdrawRecord> withdrawRecords; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/entity/WithdrawDetailVO.java
@@ -6,6 +6,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * @author HJL @@ -80,7 +81,7 @@ @ApiModelProperty("订单补贴金额") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; @ApiModelProperty("提现申请状态(0待审核;1已通过;2已驳回)") @@ -95,5 +96,7 @@ @ApiModelProperty("现场照片(多张照片 ','隔开)") private String photo; @ApiModelProperty("提现进度") private List<WithdrawRecord> withdrawRecords; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/entity/WithdrawRecord.java
New file @@ -0,0 +1,52 @@ package com.ruoyi.order.api.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.Getter; import lombok.Setter; import java.util.Date; /** * <p> * 用户提现流程 * </p> * * @author hjl * @since 2024-07-09 */ @Getter @Setter @TableName("t_withdraw_record") @ApiModel(value = "WithdrawRecord对象", description = "用户提现流程表") public class WithdrawRecord { @TableId(value = "id", type = IdType.AUTO) private Integer id; @ApiModelProperty("提现记录id") @TableField(value = "withdraw_id") private String withdrawId; @ApiModelProperty("订单id") @TableField("orderId") private String orderId; @ApiModelProperty("用户id") @TableField("userId") private Integer userId; @ApiModelProperty("类型 1=提现申请 2=平台审核 3=用户确认 4=提现成功") @TableField("withdrawType") private Integer withdrawType; @ApiModelProperty("创建时间") @TableField("createTime") private Date createTime; @ApiModelProperty("审核结果 1=通过 0=拒绝") @TableField("auditStatus") private Integer auditStatus; } ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/feignClient/WithdrawClient.java
@@ -207,4 +207,7 @@ @GetMapping("/withdraw/withdrawDetailByUser") R<WithdrawDetailVO> withdrawDetailByUser(@RequestParam("orderId") String orderId); @GetMapping("/withdraw/confirmMoney") R<String> confirmMoney(@RequestParam("id")String id); } ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/entity/Order.java
@@ -132,7 +132,7 @@ @TableField("subsidy") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") @TableField("is_withdrawal") private Integer isWithdrawal; ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java
@@ -5,13 +5,11 @@ import com.ruoyi.common.core.constant.Constants; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.exception.GlobalException; import com.ruoyi.order.entity.Order; import com.ruoyi.order.entity.ServeRecord; import com.ruoyi.order.entity.Withdraw; import com.ruoyi.order.entity.WithdrawalSetting; import com.ruoyi.order.entity.*; import com.ruoyi.order.request.WithdrawExportRequest; import com.ruoyi.order.service.OrderService; import com.ruoyi.order.service.ServeRecordService; import com.ruoyi.order.service.WithdrawRecordService; import com.ruoyi.order.service.WithdrawService; import com.ruoyi.order.vo.MoneyQueryRequest; import com.ruoyi.order.vo.UserWithdrawRecordVO; @@ -23,7 +21,11 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -41,6 +43,8 @@ @Resource private WithdrawService withdrawService; @Resource private WithdrawRecordService withdrawRecordService; @Resource private OrderService orderService; @Resource @@ -96,6 +100,8 @@ public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Long id) { Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id) .eq(Withdraw::getIsDelete, 0).one(); List<WithdrawRecord> one = withdrawRecordService.lambdaQuery().eq(WithdrawRecord::getWithdrawId, id).list(); withdraw.setWithdrawRecords(one); return R.ok(withdraw); } @@ -141,7 +147,23 @@ if (!b) { throw new GlobalException("提现失败!"); } WithdrawRecord withdrawRecord = new WithdrawRecord(); withdrawRecord.setWithdrawId(withdraw.getId()); withdrawRecord.setOrderId(withdraw.getOrderId()); withdrawRecord.setUserId(withdraw.getUserId()); withdrawRecord.setWithdrawType(2); withdrawRecord.setCreateTime(new Date()); withdrawRecord.setAuditStatus(1); withdrawRecordService.save(withdrawRecord); }else { WithdrawRecord withdrawRecord = new WithdrawRecord(); withdrawRecord.setWithdrawId(withdraw.getId()); withdrawRecord.setOrderId(withdraw.getOrderId()); withdrawRecord.setUserId(withdraw.getUserId()); withdrawRecord.setWithdrawType(2); withdrawRecord.setCreateTime(new Date()); withdrawRecord.setAuditStatus(0); withdrawRecordService.save(withdrawRecord); Order order = orderService.lambdaQuery() .eq(Order::getId, withdraw.getOrderId()) .eq(Order::getIsDelete, 0).one(); @@ -299,7 +321,20 @@ .eq(Withdraw::getIsDelete, 0).orderByDesc(Withdraw::getCreateTime) .page(Page.of(pageNum, pageSize))); } @GetMapping("/confirmMoney") R<String> confirmWithdraw(@RequestParam("id")String id){ Withdraw withdraw = withdrawService.getById(id); WithdrawRecord withdrawRecord = new WithdrawRecord(); withdrawRecord.setWithdrawId(withdraw.getId()); withdrawRecord.setOrderId(withdraw.getOrderId()); withdrawRecord.setUserId(withdraw.getUserId()); withdrawRecord.setWithdrawType(3); withdrawRecord.setCreateTime(new Date()); withdrawRecord.setAuditStatus(1); withdrawRecordService.save(withdrawRecord); return R.ok(); } @GetMapping("/withdrawDetailByUser") @ApiOperation(value = "提现订单详情", tags = {"用户端"}) public R<WithdrawDetailVO> withdrawDetailByUser(@RequestParam("orderId") String orderId) { @@ -345,6 +380,10 @@ if (null != serveRecord) { withdrawDetailVO.setPhoto(serveRecord.getPhoto()); } List<WithdrawRecord> list = withdrawRecordService.lambdaQuery().eq(WithdrawRecord::getOrderId, orderId) .eq(WithdrawRecord::getWithdrawId, withdraw.getId()) .eq(WithdrawRecord::getUserId, withdraw.getUserId()).list(); withdrawDetailVO.setWithdrawRecords(list); return R.ok(withdrawDetailVO); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WxChatPayCallBack.java
@@ -12,15 +12,9 @@ import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.vo.UserDto; import com.ruoyi.common.security.annotation.RequiresPermissions; import com.ruoyi.order.entity.ChangeDispatch; import com.ruoyi.order.entity.Order; import com.ruoyi.order.entity.Withdraw; import com.ruoyi.order.entity.WithdrawDetail; import com.ruoyi.order.entity.*; import com.ruoyi.order.request.ChangeDispatchRequest; import com.ruoyi.order.service.ChangeDispatchService; import com.ruoyi.order.service.OrderService; import com.ruoyi.order.service.WithdrawDetailService; import com.ruoyi.order.service.WithdrawService; import com.ruoyi.order.service.*; import com.ruoyi.order.vx.HttpUtil; import com.ruoyi.system.api.RemoteUserService; import com.ruoyi.user.api.feignClient.UserClient; @@ -63,6 +57,8 @@ @Autowired private WithdrawDetailService withdrawDetailService; @Autowired private WithdrawRecordService withdrawRecordService; @Resource private OrderService orderService; @Autowired @@ -111,6 +107,15 @@ withdrawDetail.setStatus("SUCCESS"); withdrawDetailService.updateById(withdrawDetail); orderService.updateById(order); WithdrawRecord withdrawRecord = new WithdrawRecord(); withdrawRecord.setWithdrawId(withdraw.getId()); withdrawRecord.setOrderId(withdraw.getOrderId()); withdrawRecord.setUserId(withdraw.getUserId()); withdrawRecord.setWithdrawType(4); withdrawRecord.setCreateTime(new Date()); withdrawRecord.setAuditStatus(1); }else if ("CANCELLED".equals(state)||"CANCELING".equals(state)||"FAIL".equals(state)){ // 校验提现 // List<Withdraw> list = withdrawService.lambdaQuery().eq(Withdraw::getUserId, order.getUserId()) ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/entity/Withdraw.java
@@ -13,6 +13,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * <p> @@ -71,5 +72,8 @@ @ApiModelProperty("城市code") @TableField("city_code") private String cityCode; @ApiModelProperty("提现进度") @TableField(exist = false) private List<WithdrawRecord> withdrawRecords; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/request/OrderRequest.java
@@ -98,7 +98,7 @@ @ApiModelProperty("订单补贴金额") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; @ApiModelProperty("详细地址") ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java
@@ -14,16 +14,10 @@ import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.vo.UserDto; import com.ruoyi.common.redis.service.RedisService; import com.ruoyi.order.entity.Order; import com.ruoyi.order.entity.Withdraw; import com.ruoyi.order.entity.WithdrawDetail; import com.ruoyi.order.entity.WithdrawalSetting; import com.ruoyi.order.entity.*; import com.ruoyi.order.mapper.WithdrawMapper; import com.ruoyi.order.request.WithdrawExportRequest; import com.ruoyi.order.service.OrderService; import com.ruoyi.order.service.WithdrawDetailService; import com.ruoyi.order.service.WithdrawService; import com.ruoyi.order.service.WithdrawalSettingService; import com.ruoyi.order.service.*; import com.ruoyi.order.vo.MoneyQueryRequest; import com.ruoyi.order.vo.UserWithdrawRecordVO; import com.ruoyi.order.vx.HttpUtil; @@ -56,6 +50,8 @@ @Resource private WithdrawalSettingService withdrawalSettingService; @Resource private WithdrawRecordService withdrawRecordService; @Resource private OrderService orderService; @Resource @@ -245,8 +241,16 @@ withdraw.setApplyForMoney(order.getOrderMoney()); withdraw.setOrderId(orderId); withdraw.setCityCode(order.getCityCode()); this.save(withdraw); WithdrawRecord withdrawRecord = new WithdrawRecord(); withdrawRecord.setWithdrawId(withdraw.getId()); withdrawRecord.setOrderId(withdraw.getOrderId()); withdrawRecord.setUserId(withdraw.getUserId()); withdrawRecord.setWithdrawType(1); withdrawRecord.setCreateTime(new Date()); withdrawRecord.setAuditStatus(1); withdrawRecordService.save(withdrawRecord); // 未开启全局 提现审核,则用户提现不需要后台审核 if (Constants.ZERO.equals(withdrawalSetting.getEnableProcess())) { // 已通过 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/WithdrawDetailVO.java
@@ -1,11 +1,13 @@ package com.ruoyi.order.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.order.entity.WithdrawRecord; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; import java.util.List; /** * @author HJL @@ -79,7 +81,7 @@ @ApiModelProperty("订单补贴金额") private BigDecimal subsidy; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; @ApiModelProperty("提现申请状态(0待审核;1已通过;2已驳回)") @@ -94,5 +96,6 @@ @ApiModelProperty("现场照片(多张照片 ','隔开)") private String photo; @ApiModelProperty("提现进度") private List<WithdrawRecord> withdrawRecords; } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/WithdrawOrderVO.java
@@ -34,7 +34,7 @@ @ApiModelProperty("订单完成时间") private Date completeTime; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; } ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/WithdrawController.java
@@ -66,13 +66,22 @@ } return withdrawClient.withdrawDetailByUser(orderId); } @GetMapping("/confirmMoney") @ApiOperation(value = "确认收款", tags = {"用户端-个人中心-提现"}) @ApiImplicitParams({ @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "String", required = true) }) public R<String> confirmMoney(@RequestParam("id") String id) { return withdrawClient.confirmMoney(id); } @GetMapping("/confirmWithdraw") @ApiOperation(value = "确认提现", tags = {"用户端-个人中心-提现"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true) }) public synchronized R<Boolean> confirmWithdraw(@RequestParam String orderId) { LoginUserInfo loginUser = tokenService.getLoginUserByUser(); if (null == loginUser) { ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/entity/Order.java
@@ -126,7 +126,7 @@ @TableField("complete_time") private Date completeTime; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") @TableField("is_withdrawal") private Integer isWithdrawal; ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/vo/WithdrawOrderVO.java
@@ -39,7 +39,7 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date completeTime; @ApiModelProperty("是否已提现(0:未提现,1:已提现)") @ApiModelProperty("是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)") private Integer isWithdrawal; @ApiModelProperty("订单金额") sql/secondary_recovery_order.sql
@@ -365,7 +365,7 @@ `latitude` double NULL DEFAULT NULL COMMENT '下单用户纬度', `arrive_time` datetime NULL DEFAULT NULL COMMENT '师傅到达预约地点时间', `complete_time` datetime NULL DEFAULT NULL COMMENT '订单完成时间', `is_withdrawal` int NULL DEFAULT NULL COMMENT '是否已提现(0:未提现,1:已提现)', `is_withdrawal` int NULL DEFAULT NULL COMMENT '是否已提现(0:未提现,1:审核中 2审核通过 3:已确认收款)', `subsidy` decimal(10, 6) NULL DEFAULT NULL COMMENT '补贴金额', `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '详细地址', `top_sort` int NULL DEFAULT NULL COMMENT '置顶顺序',