admin
2024-04-26 5e7b0ed4a154ad067cbcf4aa1a1c7cce32f9864c
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -13,6 +13,7 @@
import javax.annotation.Resource;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.util.*;
import org.dom4j.Document;
import org.dom4j.DocumentException;
@@ -348,7 +349,6 @@
     * @param extract
     * @param session
     */
    @Transactional
    private void transfer(Extract extract, AdminUser adminUser) {
        Integer type = extract.getType();
        if (Constant.ZHIFUBAO == type) {
@@ -405,6 +405,15 @@
        return 0;
    }
    private String getOrderPrefix(SystemEnum system) {
        if (system == SystemEnum.yhqjx) {
            return "TJ";
        } else if (system == SystemEnum.hsb) {
            return "HSB";
        }
        return "";
    }
    /**
     * 提现到支付宝
     *
@@ -412,12 +421,19 @@
     * @param session
     */
    // TODO 转账逻辑需要改变,固定IP
    @Transactional
    private void extractByZhiFuBao(Extract extract, AdminUser adminUser) {
        LogHelper.userErrorInfo("提现:开始通过提现-" + extract.getId());
        //获取用户的系统
        UserInfo user = userInfoMapper.selectByPrimaryKey(extract.getUserInfo().getId());
        String appName = user.getSystem().getName();
        //备注
        String remark = appName + "APP渠道提现";
        //理由
        String reason = String.format("用户ID【%s】发起的提现", getOrderPrefix(user.getSystem()) + user.getId());
        AlipayFundTransUniTransferResponse response = null;
        try {
            response = AlipayUtil.transferNoThrowException("widthdraw_" + extract.getId(), extract.getAccount(), extract.getName(), extract.getMoney(), "板栗快省提现到账", "来自板栗快省的提现");
            response = AlipayUtil.transferNoThrowException("widthdraw_" + extract.getId(), extract.getAccount(), extract.getName(), extract.getMoney(), remark, reason);
            LogHelper.userErrorInfo("提现:支付宝通过提现成功-" + extract.getId());
        } catch (AlipayApiException e) {
            LogHelper.errorDetailInfo(e, "支付宝转账异常:" + extract.getId(), "");
@@ -443,7 +459,7 @@
        UserInfo user = extract.getUserInfo();
        // MoneyRecord moneyRecord = new MoneyRecord(user, null, extract
        // .getMoney(), "提现", "提现失败", new Date().getTime(), 3);
        if ("PAYER_BALANCE_NOT_ENOUGH".equals(subCode)) {
        if ("PAYER_BALANCE_NOT_ENOUGH".equals(subCode) || "BALANCE_IS_NOT_ENOUGH".equals(subCode)) {
            Extract updateExtract = new Extract();
            updateExtract.setId(extract.getId());
            updateExtract.setState(Constant.EXTRACT_DEFUALT);
@@ -497,7 +513,6 @@
     * @param extract
     * @param session
     */
    @Transactional
    private void extractSuccess(Extract extract, String alipayNo) {
        // 老版本功能
        // List<MoneyRecord> list = moneyRecordDao.list("from MoneyRecord mr