分销修改
This commit is contained in:
parent
5b518f674b
commit
ff32ec71c1
|
|
@ -5,14 +5,13 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaCheckMainShop;
|
||||
import com.czg.market.dto.MkDistributionConfigDTO;
|
||||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
||||
import com.czg.market.service.*;
|
||||
import com.czg.market.vo.*;
|
||||
import com.czg.order.dto.MkDistributionPayDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.service.impl.AppWxServiceImpl;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -38,6 +37,8 @@ public class DistributionController {
|
|||
private MkDistributionFlowService distributionFlowService;
|
||||
@Resource
|
||||
private MkDistributionWithdrawFlowService withdrawFlowService;
|
||||
@Resource
|
||||
private AppWxServiceImpl appWxService;
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
|
|
@ -121,13 +122,23 @@ public class DistributionController {
|
|||
* @param endTime 结束时间
|
||||
*/
|
||||
@GetMapping("/withdrawFlow")
|
||||
public CzgResult<Page<MkDistributionWithdrawFlow>> withdrawPageInfo(@RequestParam(required = false) Long userId, @RequestParam(required = false) String key,
|
||||
@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
|
||||
public CzgResult<Map<String, Object>> withdrawPageInfo(@RequestParam(required = false) Long userId, @RequestParam(required = false) String key,
|
||||
@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime) {
|
||||
return CzgResult.success(withdrawFlowService.withdrawPageInfo(userId, StrUtil.isBlank(startTime) ? null : DateUtil.parseLocalDateTime(startTime),
|
||||
StrUtil.isBlank(endTime) ? null : DateUtil.parseLocalDateTime(endTime), key));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 充值二维码获取
|
||||
* @param amount 金额
|
||||
* @return base64
|
||||
*/
|
||||
@GetMapping("/rechargeQrCode")
|
||||
public CzgResult<String> rechargeQrCode(@RequestParam BigDecimal amount) {
|
||||
return CzgResult.success(appWxService.genCode("/pages/pay", "amount=" + amount + "&shopId=" + StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.mybatisflex.core.service.IService;
|
|||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 提现记录表 服务层。
|
||||
|
|
@ -16,5 +17,5 @@ public interface MkDistributionWithdrawFlowService extends IService<MkDistributi
|
|||
|
||||
Page<MkDistributionWithdrawFlow> pageInfo(long userId);
|
||||
|
||||
Page<MkDistributionWithdrawFlow> withdrawPageInfo(Long userId, LocalDateTime startTime, LocalDateTime endTime, String key);
|
||||
Map<String, Object> withdrawPageInfo(Long userId, LocalDateTime startTime, LocalDateTime endTime, String key);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,9 +325,9 @@ public abstract class BaseWx {
|
|||
return jsonObject.getString("refund_id");
|
||||
}
|
||||
|
||||
String genCode(int shopId, int id, String path) {
|
||||
public String genCode(String path, String scene) {
|
||||
Map<String, Object> params = Map.of(
|
||||
"scene", "id=" + id + "&shopId=" + shopId,
|
||||
"scene", scene,
|
||||
"page", path,
|
||||
"width", 430
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.czg.service.market.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.utils.MyQueryWrapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
|
|
@ -16,6 +18,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 提现记录表 服务层实现。
|
||||
|
|
@ -34,7 +37,7 @@ public class MkDistributionWithdrawFlowServiceImpl extends ServiceImpl<MkDistrib
|
|||
}
|
||||
|
||||
@Override
|
||||
public Page<MkDistributionWithdrawFlow> withdrawPageInfo(Long userId, LocalDateTime startTime, LocalDateTime endTime, String key) {
|
||||
public Map<String, Object> withdrawPageInfo(Long userId, LocalDateTime startTime, LocalDateTime endTime, String key) {
|
||||
QueryWrapper queryWrapper = new MyQueryWrapper()
|
||||
.selectAll(MkDistributionWithdrawFlow.class)
|
||||
.leftJoin(UserInfo.class).on(UserInfo::getId, MkDistributionWithdrawFlow::getUserId)
|
||||
|
|
@ -57,6 +60,10 @@ public class MkDistributionWithdrawFlowServiceImpl extends ServiceImpl<MkDistrib
|
|||
});
|
||||
});
|
||||
}
|
||||
return page(PageUtil.buildPage(), queryWrapper);
|
||||
Page<MkDistributionWithdrawFlow> page = page(PageUtil.buildPage(), queryWrapper);
|
||||
Map<String, Object> map = BeanUtil.beanToMap(page);
|
||||
map.put("pending", getOne(new QueryWrapper().eq(MkDistributionWithdrawFlow::getStatus, TableValueConstant.DistributionWithdrawFlow.Status.PENDING.getCode()).select("sum(amount)")));
|
||||
map.put("finish", getOne(new QueryWrapper().eq(MkDistributionWithdrawFlow::getStatus, TableValueConstant.DistributionWithdrawFlow.Status.FINISH.getCode()).select("sum(amount)")));
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue