xin
2025-07-14 a5a0a3c29a97c807cda8846994d1d8df6adeb9e5
oying-system/src/main/java/com/oying/modules/rider/service/impl/RiderInfoServiceImpl.java
@@ -6,6 +6,8 @@
import com.oying.modules.rider.domain.RiderInfo;
import com.oying.modules.rider.domain.RiderSourceInfo;
import com.oying.modules.rider.domain.RiderSourceInfoHttp;
import com.oying.modules.rider.domain.RiderWalletInfo;
import com.oying.modules.rider.service.RiderWalletInfoService;
import com.oying.modules.rider.utils.Constants;
import com.oying.modules.rider.utils.RiderSourceHttpUtils;
import com.oying.utils.FileUtil;
@@ -20,6 +22,7 @@
import org.springframework.transaction.annotation.Transactional;
import com.oying.utils.PageUtil;
import java.math.BigDecimal;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
@@ -36,6 +39,8 @@
public class RiderInfoServiceImpl extends ServiceImpl<RiderInfoMapper, RiderInfo> implements RiderInfoService {
    private final RiderInfoMapper riderInfoMapper;
    private final RiderWalletInfoService riderWalletInfoService;
    @Override
    public PageResult<RiderInfo> queryAll(RiderInfoQueryCriteria criteria, Page<Object> page) {
@@ -91,6 +96,7 @@
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void syncRiderSourceInfo(String sourcePlatform) {
        Long riderId = SecurityUtils.getCurrentUserId();
        // 查询其他平台的数据
@@ -112,6 +118,23 @@
                    newRiderInfo.setRiderId(riderId);
                    newRiderInfo.setSourcePlatform(sourcePlatform);
                    create(newRiderInfo);
                    // 创建骑手钱包信息 正常
                    RiderWalletInfo riderWalletInfo = new RiderWalletInfo();
                    riderWalletInfo.setRiderId(riderId);
                    riderWalletInfo.setAmount(new BigDecimal(0.00));
                    riderWalletInfo.setAvailableBalance(new BigDecimal(0.00));
                    riderWalletInfo.setPurchasingElectricityAmount(new BigDecimal(0.00));
                    riderWalletInfo.setWithdrawTotal(new BigDecimal(0.00));
                    riderWalletInfo.setIncomeTotal(new BigDecimal(0.00));
                    riderWalletInfo.setFrozenAmount(new BigDecimal(0.00));
                    riderWalletInfo.setRunTotal(Constants.ZERO);
                    riderWalletInfo.setCashWithdrawalTotal(Constants.ZERO);
                    riderWalletInfo.setPurchasingElectricityTotal(Constants.ZERO);
                    riderWalletInfo.setStatus(Constants.WALLET_STATUS_NORMAL);
                    riderWalletInfo.setPhone(infoHttpData.getPhone());
                    riderWalletInfo.setCardName(infoHttpData.getCardName());
                    riderWalletInfo.setCardNum(infoHttpData.getCardNum());
                    riderWalletInfoService.create(riderWalletInfo);
                } else {
                    // 是否相同平台
                    if (sourcePlatform.equals(riderInfo.getSourcePlatform())) {
@@ -142,7 +165,7 @@
    }
    @Override
    public RiderInfo getRiderSourceInfo(String riderId) {
    public RiderInfo getRiderSourceInfo(Long riderId) {
        QueryWrapper<RiderInfo> riderInfoQueryWrapper = new QueryWrapper<>();
        riderInfoQueryWrapper.eq(RiderInfo.COL_RIDER_ID, riderId);
        return riderInfoMapper.selectOne(riderInfoQueryWrapper);