shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.ishop.mobile.api;
 
import com.ishop.merchant.Constants;
import com.ishop.mobile.BaseApi;
import com.ishop.model.po.EbUser;
import com.ishop.model.vo.UserClosingConfigVo;
import com.walker.infrastructure.utils.StringUtils;
import com.walker.web.ResponseValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import java.math.BigDecimal;
 
/**
 * 用户结算管理,包含:提现。
 * @author 时克英
 * @date 2023-09-19
 */
@RestController
@RequestMapping("/front/retail/store")
public class RetailStoreApi extends BaseApi {
 
    /**
     * 获取用户结算配置
     * @return
     */
    @RequestMapping(value = "/user/closing/config", method = RequestMethod.GET)
    public ResponseValue getClosingConfig(){
 
        EbUser user = this.getCurrentEbUser();
 
        // 提现最低金额
        String minPrice = this.getArgumentVariable(Constants.RETAIL_STORE_EXTRACT_MIN_PRICE).getStringValue();
        // 冻结天数
        String freezeDay = this.getArgumentVariable(Constants.RETAIL_STORE_BROKERAGE_FREEZING_TIME).getStringValue();
        // 获取提现银行
        String bank = this.getArgumentVariable(Constants.RETAIL_STORE_EXTRACT_BANK).getStringValue();
        // 可提现佣金
        double brokerage = user.getBrokeragePrice();
        // 冻结佣金
        double freezeBrokerage = this.getUserBrokerageService().queryFreezePrice(user.getId());
 
        UserClosingConfigVo vo = new UserClosingConfigVo();
        vo.setMinPrice(minPrice);
        vo.setBrokerage(brokerage);
        vo.setFreezeBrokerage(freezeBrokerage);
        vo.setFreezeDay(freezeDay);
        if (StringUtils.isNotEmpty(bank)) {
            vo.setBankList(StringUtils.asList(StringUtils.commaDelimitedListToStringArray(bank)));
        }
        return ResponseValue.success(vo);
    }
 
}