fixbug:提现申请充值业务问题处理
This commit is contained in:
parent
967852f84d
commit
61104b9cd3
@ -79,4 +79,12 @@ ALTER TABLE li_store ADD `self_pick_flag` bit(1) DEFAULT NULL;
|
||||
/**
|
||||
历史足迹增加店铺Id
|
||||
*/
|
||||
ALTER TABLE li_foot_print ADD `store_id` varchar(255) DEFAULT NULL COMMENT '店铺ID';
|
||||
ALTER TABLE li_foot_print ADD `store_id` varchar(255) DEFAULT NULL COMMENT '店铺ID';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
订单增加自提信息
|
||||
*/
|
||||
ALTER TABLE li_member_withdraw_apply ADD `real_name` varchar(255) DEFAULT NULL;
|
||||
ALTER TABLE li_member_withdraw_apply ADD `connect_number` varchar(255) DEFAULT NULL;
|
||||
|
@ -10,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -26,6 +27,7 @@ import javax.validation.constraints.Min;
|
||||
@RestController
|
||||
@Api(tags = "买家端,预存款充值记录接口")
|
||||
@RequestMapping("/buyer/trade/recharge")
|
||||
@Validated
|
||||
public class RechargeTradeBuyerController {
|
||||
|
||||
@Autowired
|
||||
@ -37,7 +39,10 @@ public class RechargeTradeBuyerController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "price", value = "充值金额", required = true, dataType = "double", paramType = "query")
|
||||
})
|
||||
public ResultMessage<Recharge> create(@Max(value = 10000, message = "充值金额单次最多允许充值10000元") @Min(value = 1, message = "充值金额单次最少充值金额为1元") Double price) {
|
||||
public ResultMessage<Recharge> create(
|
||||
@Max(value = 10000, message = "充值金额单次最多允许充值10000元")
|
||||
@Min(value = 1, message = "充值金额单次最少充值金额为1元")
|
||||
Double price) {
|
||||
Recharge recharge = this.rechargeService.recharge(price);
|
||||
return ResultUtil.data(recharge);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
@ -36,6 +37,7 @@ import javax.validation.constraints.Pattern;
|
||||
@RestController
|
||||
@Api(tags = "买家端,会员余额接口")
|
||||
@RequestMapping("/buyer/wallet/wallet")
|
||||
@Validated
|
||||
public class MemberWalletBuyerController {
|
||||
|
||||
/**
|
||||
@ -127,7 +129,10 @@ public class MemberWalletBuyerController {
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "price", value = "提现金额", required = true, dataType = "double", paramType = "query")
|
||||
})
|
||||
public ResultMessage<Boolean> withdrawal(@Max(value = 9999, message = "充值金额单次最多允许提现9999元") @Min(value = 1, message = "充值金额单次最少提现金额为1元") Double price) {
|
||||
public ResultMessage<Boolean> withdrawal(
|
||||
@Max(value = 9999, message = "提现金额单次最多允许提现9999元")
|
||||
@Min(value = 1, message = "提现金额单次最少提现金额为1元")
|
||||
Double price) {
|
||||
return ResultUtil.data(memberWalletService.applyWithdrawal(price));
|
||||
}
|
||||
|
||||
|
50
docs/diagram/OrderComplaintBuyerController.uml
Normal file
50
docs/diagram/OrderComplaintBuyerController.uml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Diagram>
|
||||
<ID>JAVA</ID>
|
||||
<OriginalElement>cn.lili.controller.order.OrderComplaintBuyerController</OriginalElement>
|
||||
<nodes>
|
||||
<node x="-377.0" y="-206.0">cn.lili.modules.order.order.service.OrderComplaintCommunicationService</node>
|
||||
<node x="-927.5" y="123.5">cn.lili.controller.order.OrderComplaintStoreController</node>
|
||||
<node x="-378.0" y="607.0">cn.lili.modules.order.order.service.OrderComplaintService</node>
|
||||
<node x="311.5" y="111.0">cn.lili.controller.order.OrderComplaintBuyerController</node>
|
||||
<node x="-308.0" y="123.5">cn.lili.controller.order.OrderComplaintManagerController</node>
|
||||
</nodes>
|
||||
<notes />
|
||||
<edges>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintStoreController" target="cn.lili.modules.order.order.service.OrderComplaintCommunicationService" relationship="TO_ONE">
|
||||
<point x="278.0" y="-84.5" />
|
||||
<point x="-330.0" y="38.5" />
|
||||
</edge>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintStoreController" target="cn.lili.modules.order.order.service.OrderComplaintService" relationship="TO_ONE">
|
||||
<point x="262.0" y="84.5" />
|
||||
<point x="-300.0" y="-119.0" />
|
||||
</edge>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintBuyerController" target="cn.lili.modules.order.order.service.OrderComplaintCommunicationService" relationship="TO_ONE">
|
||||
<point x="-286.0" y="-73.0" />
|
||||
<point x="345.0" y="38.5" />
|
||||
</edge>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintBuyerController" target="cn.lili.modules.order.order.service.OrderComplaintService" relationship="TO_ONE">
|
||||
<point x="0.0" y="73.0" />
|
||||
<point x="606.5" y="726.0" />
|
||||
<point x="307.5" y="0.0" />
|
||||
</edge>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintManagerController" target="cn.lili.modules.order.order.service.OrderComplaintCommunicationService" relationship="TO_ONE">
|
||||
<point x="-11.5" y="-84.5" />
|
||||
<point x="0.0" y="38.5" />
|
||||
</edge>
|
||||
<edge source="cn.lili.controller.order.OrderComplaintManagerController" target="cn.lili.modules.order.order.service.OrderComplaintService" relationship="TO_ONE">
|
||||
<point x="-57.5" y="84.5" />
|
||||
<point x="0.0" y="-119.0" />
|
||||
</edge>
|
||||
</edges>
|
||||
<settings layout="Hierarchic" zoom="1.0" showDependencies="true" x="-13.0" y="319.65625" />
|
||||
<SelectedNodes />
|
||||
<Categories>
|
||||
<Category>Inner Classes</Category>
|
||||
<Category>Methods</Category>
|
||||
<Category>Properties</Category>
|
||||
</Categories>
|
||||
<SCOPE>All</SCOPE>
|
||||
<VISIBILITY>private</VISIBILITY>
|
||||
</Diagram>
|
||||
|
20
docs/uml/AfterSaleRefundGodos.puml
Normal file
20
docs/uml/AfterSaleRefundGodos.puml
Normal file
@ -0,0 +1,20 @@
|
||||
@startuml
|
||||
'https://plantuml.com/sequence-diagram
|
||||
|
||||
actor user
|
||||
actor seller
|
||||
actor manager
|
||||
|
||||
user --> 平台: 申请售后
|
||||
seller -> 平台: 审核售后申请
|
||||
activate 平台
|
||||
平台 -> 平台: 更新售后状态
|
||||
return 售后审核响应
|
||||
|
||||
user -> 平台: 填写物流信息
|
||||
seller->平台: 确认收货
|
||||
activate 平台
|
||||
平台 -> 平台: 自动退款
|
||||
return 售后审核响应
|
||||
平台 -> user: 售后结束
|
||||
@enduml
|
16
docs/uml/AfterSaleRefundMoney.puml
Normal file
16
docs/uml/AfterSaleRefundMoney.puml
Normal file
@ -0,0 +1,16 @@
|
||||
@startuml
|
||||
'https://plantuml.com/sequence-diagram
|
||||
|
||||
actor user
|
||||
actor seller
|
||||
actor manager
|
||||
|
||||
user --> 平台: 申请售后
|
||||
seller -> 平台: 审核售后申请
|
||||
activate 平台
|
||||
平台 -> 平台: 通过审核,自动退款
|
||||
manager --> 平台: 审核阶段可介入操作
|
||||
return 售后审核响应
|
||||
|
||||
user -> 平台: 查询售后结果
|
||||
@enduml
|
21
docs/uml/Complaint.puml
Normal file
21
docs/uml/Complaint.puml
Normal file
@ -0,0 +1,21 @@
|
||||
@startuml
|
||||
'https://plantuml.com/sequence-diagram
|
||||
|
||||
actor user
|
||||
actor seller
|
||||
actor manager
|
||||
|
||||
activate 平台
|
||||
user -> 平台: 输入原因,发起投诉
|
||||
user --> 平台: 多次输出对话
|
||||
seller --> 平台: 多次输出对话
|
||||
manager --> 平台: 多次输出对话
|
||||
manager -> 平台: 根据各方意见,仲裁投诉结果
|
||||
activate 平台
|
||||
平台->平台: 仲裁结果,更新状态
|
||||
|
||||
平台 -> seller: 根据平台仲裁结果进行处理
|
||||
平台 -> user: 根据平台仲裁结果进行处理
|
||||
deactivate 平台
|
||||
|
||||
@enduml
|
@ -221,7 +221,7 @@ public enum ResultCode {
|
||||
PAY_POINT_ENOUGH(32010, "积分不足,不能兑换"),
|
||||
PAY_NOT_EXIST_ORDER(32011, "支付订单不存在"),
|
||||
CAN_NOT_RECHARGE_WALLET(32012, "不能使用余额进行充值"),
|
||||
|
||||
RECHARGE_PRICE_ERROR(32013, "充值金额错误"),
|
||||
|
||||
/**
|
||||
* 售后
|
||||
@ -259,7 +259,7 @@ public enum ResultCode {
|
||||
WALLET_REMARK_ERROR(34004, "请填写审核备注!"),
|
||||
WALLET_EXIT_ERROR(34000, "钱包已存在,无法重复创建"),
|
||||
WALLET_APPLY_ERROR(34005, "提现申请异常!"),
|
||||
|
||||
WALLET_WITHDRAWAL_AMOUNT_ERROR(34006, "申请提现金额异常!"),
|
||||
/**
|
||||
* 评价
|
||||
*/
|
||||
@ -502,6 +502,7 @@ public enum ResultCode {
|
||||
PURCHASE_ORDER_DEADLINE_ERROR(90004, "供求单,已超过报名截止时间"),
|
||||
INDEX_BUILDING(90005, "索引正在生成");
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
|
||||
|
@ -257,6 +257,11 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean applyWithdrawal(Double price) {
|
||||
|
||||
if (price == null || price <= 0 || price > 1000000) {
|
||||
throw new ServiceException(ResultCode.WALLET_WITHDRAWAL_AMOUNT_ERROR);
|
||||
}
|
||||
|
||||
MemberWithdrawalMessage memberWithdrawalMessage = new MemberWithdrawalMessage();
|
||||
AuthUser authUser = UserContext.getCurrentUser();
|
||||
//构建审核参数
|
||||
@ -307,7 +312,7 @@ public class MemberWalletServiceImpl extends ServiceImpl<MemberWalletMapper, Mem
|
||||
//保存或者修改零钱提现
|
||||
this.memberWithdrawApplyService.saveOrUpdate(memberWithdrawApply);
|
||||
//TODO 做成配置项目
|
||||
cashierSupport.transfer(PaymentMethodEnum.WECHAT,memberWithdrawApply);
|
||||
cashierSupport.transfer(PaymentMethodEnum.WECHAT, memberWithdrawApply);
|
||||
boolean result = true;
|
||||
//如果微信提现失败 则抛出异常 回滚数据
|
||||
if (!result) {
|
||||
|
@ -42,6 +42,11 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
|
||||
|
||||
@Override
|
||||
public Recharge recharge(Double price) {
|
||||
|
||||
if (price == null || price <= 0 || price > 1000000) {
|
||||
throw new ServiceException(ResultCode.RECHARGE_PRICE_ERROR);
|
||||
}
|
||||
|
||||
//获取当前登录的会员
|
||||
AuthUser authUser = UserContext.getCurrentUser();
|
||||
//构建sn
|
||||
|
Loading…
x
Reference in New Issue
Block a user