提现参数修改
This commit is contained in:
parent
faa7f18924
commit
93d6761f18
|
@ -104,4 +104,11 @@ public interface AccountService
|
|||
* 根据用户查询
|
||||
*/
|
||||
List<AccountVO> selectByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 查询用户账户
|
||||
* @param userId 用户ID
|
||||
* @param type 账户类型
|
||||
*/
|
||||
List<AccountVO> selectUserAccountByType(Long userId, String type);
|
||||
}
|
||||
|
|
|
@ -209,6 +209,14 @@ public class AccountServiceImpl implements AccountService {
|
|||
return this.selectSmAccountList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountVO> selectUserAccountByType(Long userId, String type) {
|
||||
AccountQuery query = new AccountQuery();
|
||||
query.setUserId(userId);
|
||||
query.setAccountType(type);
|
||||
return this.selectSmAccountList(query);
|
||||
}
|
||||
|
||||
private boolean isRepeat(Account data) {
|
||||
AccountQuery dto = new AccountQuery();
|
||||
dto.setUserId(data.getUserId());
|
||||
|
|
|
@ -203,6 +203,9 @@ public class TransactionBill extends BaseEntity implements Payable
|
|||
@JsonView(JsonViewProfile.AppMch.class)
|
||||
private String withdrawType;
|
||||
|
||||
@ApiModelProperty("提现审核时的二维码")
|
||||
private String offlineImage;
|
||||
|
||||
/**
|
||||
* 获取价格(分)
|
||||
*/
|
||||
|
|
|
@ -28,6 +28,9 @@ public class WithdrawApprovalDTO {
|
|||
@DictValid(type = DictTypeConstants.WITHDRAW_TYPE, message = "非法的打款方式")
|
||||
private String withdrawType;
|
||||
|
||||
@ApiModelProperty("审核时的二维码图片")
|
||||
private String offlineImage;
|
||||
|
||||
@ApiModelProperty("支付凭证")
|
||||
private String payPicture;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
stb.refund_service_amount,
|
||||
stb.pay_picture,
|
||||
stb.withdraw_type,
|
||||
stb.offline_image,
|
||||
su.user_name as user_name,
|
||||
su1.user_name as mch_name,
|
||||
su1.phonenumber as mch_mobile,
|
||||
|
@ -257,6 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="refundServiceAmount != null">refund_service_amount,</if>
|
||||
<if test="payPicture != null">pay_picture,</if>
|
||||
<if test="withdrawType != null">withdraw_type,</if>
|
||||
<if test="offlineImage != null">offline_image,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="billNo != null">#{billNo},</if>
|
||||
|
@ -297,6 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="refundServiceAmount != null">#{refundServiceAmount},</if>
|
||||
<if test="payPicture != null">#{payPicture},</if>
|
||||
<if test="withdrawType != null">#{withdrawType},</if>
|
||||
<if test="offlineImage != null">#{offlineImage},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -354,6 +357,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.refundServiceAmount != null">refund_service_amount = #{data.refundServiceAmount},</if>
|
||||
<if test="data.payPicture != null">pay_picture = #{data.payPicture},</if>
|
||||
<if test="data.withdrawType != null">withdraw_type = #{data.withdrawType},</if>
|
||||
<if test="data.offlineImage != null">offline_image = #{data.offlineImage},</if>
|
||||
</sql>
|
||||
|
||||
<update id="updateByQuery">
|
||||
|
|
|
@ -37,4 +37,9 @@ public interface TransactionBillValidator {
|
|||
* @param userId 用户ID
|
||||
*/
|
||||
boolean isMch(TransactionBillVO bill, Long userId);
|
||||
|
||||
/**
|
||||
* 判断用户是否订单发起人
|
||||
*/
|
||||
boolean isUser(TransactionBillVO bill, Long userId);
|
||||
}
|
||||
|
|
|
@ -475,6 +475,7 @@ public class TransactionBillServiceImpl implements TransactionBillService {
|
|||
data.setRemark(dto.getRemark());
|
||||
data.setPayPicture(dto.getPayPicture());
|
||||
data.setWithdrawType(dto.getWithdrawType());
|
||||
data.setOfflineImage(dto.getOfflineImage());
|
||||
TransactionBillQuery query = new TransactionBillQuery();
|
||||
query.setBillId(dto.getBillId());
|
||||
query.setType(TransactionBillType.WITHDRAW.getType());
|
||||
|
|
|
@ -166,4 +166,9 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
|
|||
public boolean isMch(TransactionBillVO bill, Long userId) {
|
||||
return bill != null && bill.getMchId() != null && bill.getMchId().equals(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUser(TransactionBillVO bill, Long userId) {
|
||||
return bill != null && bill.getUserId() != null && bill.getUserId().equals(userId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.web.controller.mch;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonView;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.JsonViewProfile;
|
||||
import com.ruoyi.ss.transactionBill.domain.vo.TransactionBillVO;
|
||||
import com.ruoyi.ss.transactionBill.service.TransactionAssembler;
|
||||
import com.ruoyi.ss.transactionBill.service.TransactionBillService;
|
||||
import com.ruoyi.ss.transactionBill.service.TransactionBillValidator;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author wjh
|
||||
* 2024/8/1
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mch/withdraw")
|
||||
public class MchWithdrawController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TransactionBillService transactionBillService;
|
||||
|
||||
@Autowired
|
||||
private TransactionBillValidator transactionBillValidator;
|
||||
|
||||
@Autowired
|
||||
private TransactionAssembler transactionAssembler;
|
||||
|
||||
@ApiOperation("查询本人提现详情")
|
||||
@GetMapping("/{billId}")
|
||||
@JsonView(JsonViewProfile.AppMch.class)
|
||||
public AjaxResult getWithdrawInfo(@PathVariable Long billId) {
|
||||
TransactionBillVO bill = transactionBillService.selectSmTransactionBillByBillId(billId);
|
||||
if (bill == null || !transactionBillValidator.isUser(bill, getUserId())) {
|
||||
return success();
|
||||
}
|
||||
transactionAssembler.assembleChannelName(Collections.singletonList(bill));
|
||||
return AjaxResult.success(bill);
|
||||
}
|
||||
|
||||
}
|
|
@ -4,17 +4,11 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.core.domain.ValidGroup;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
@ -106,4 +100,14 @@ public class AccountController extends BaseController
|
|||
public AjaxResult remove(@PathVariable Long[] accountIds) {
|
||||
return toAjax(smAccountService.deleteSmAccountByAccountIds(accountIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型获取用户账户
|
||||
* @param userId 用户ID
|
||||
* @param type 类型
|
||||
*/
|
||||
@GetMapping("/getUserAccountByType")
|
||||
public AjaxResult getUserAccountByType(@RequestParam Long userId, @RequestParam String type) {
|
||||
return success(smAccountService.selectUserAccountByType(userId, type));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user