Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -7,6 +7,7 @@ import com.czg.account.entity.UserInfo;
|
|||||||
import com.czg.constant.TableValueConstant;
|
import com.czg.constant.TableValueConstant;
|
||||||
import com.czg.market.vo.MkDistributionAmountFlowVO;
|
import com.czg.market.vo.MkDistributionAmountFlowVO;
|
||||||
import com.czg.order.entity.OrderInfo;
|
import com.czg.order.entity.OrderInfo;
|
||||||
|
import com.czg.order.entity.OrderPayment;
|
||||||
import com.czg.utils.MyQueryWrapper;
|
import com.czg.utils.MyQueryWrapper;
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
@@ -71,10 +72,11 @@ public class MkDistributionAmountFlowServiceImpl extends ServiceImpl<MkDistribut
|
|||||||
public Map<String, Object> openPageInfo(Long shopId, LocalDateTime startTime, LocalDateTime endTime, String key) {
|
public Map<String, Object> openPageInfo(Long shopId, LocalDateTime startTime, LocalDateTime endTime, String key) {
|
||||||
QueryWrapper queryWrapper = new MyQueryWrapper()
|
QueryWrapper queryWrapper = new MyQueryWrapper()
|
||||||
.selectAll(MkDistributionAmountFlow.class)
|
.selectAll(MkDistributionAmountFlow.class)
|
||||||
.leftJoin(OrderInfo.class).on(OrderInfo::getId, MkDistributionAmountFlow::getSourceId)
|
.leftJoin(OrderPayment.class).on(OrderPayment::getId, MkDistributionAmountFlow::getSourceId)
|
||||||
.leftJoin(ShopUser.class).on(ShopUser::getId, OrderInfo::getUserId)
|
.leftJoin(ShopUser.class).on(ShopUser::getId, OrderPayment::getSourceId)
|
||||||
.eq(MkDistributionAmountFlow::getShopId, shopId)
|
.eq(MkDistributionAmountFlow::getShopId, shopId)
|
||||||
.select(OrderInfo::getOrderNo)
|
.select(OrderPayment::getOrderNo)
|
||||||
|
.eq(MkDistributionAmountFlow::getType, TableValueConstant.DistributionAmountFlow.Type.OPEN.getCode())
|
||||||
.select(ShopUser::getPhone, ShopUser::getNickName);
|
.select(ShopUser::getPhone, ShopUser::getNickName);
|
||||||
if (startTime != null) {
|
if (startTime != null) {
|
||||||
queryWrapper.ge(MkDistributionAmountFlow::getCreateTime, startTime);
|
queryWrapper.ge(MkDistributionAmountFlow::getCreateTime, startTime);
|
||||||
@@ -87,7 +89,7 @@ public class MkDistributionAmountFlowServiceImpl extends ServiceImpl<MkDistribut
|
|||||||
if (StrUtil.isNotBlank(key)) {
|
if (StrUtil.isNotBlank(key)) {
|
||||||
queryWrapper.and(and -> {
|
queryWrapper.and(and -> {
|
||||||
and.or(or -> {
|
and.or(or -> {
|
||||||
or.like(OrderInfo::getOrderNo, key);
|
or.like(OrderPayment::getOrderNo, key);
|
||||||
});
|
});
|
||||||
and.or(or -> {
|
and.or(or -> {
|
||||||
or.like(ShopUser::getNickName, key);
|
or.like(ShopUser::getNickName, key);
|
||||||
|
|||||||
@@ -67,14 +67,14 @@ public class DistributionPayServiceImpl implements DistributionPayService {
|
|||||||
if (!isRecharge && !TableValueConstant.DistributionConfig.OpenType.PAY.getCode().equals(detail.getOpenType())) {
|
if (!isRecharge && !TableValueConstant.DistributionConfig.OpenType.PAY.getCode().equals(detail.getOpenType())) {
|
||||||
throw new CzgException("当前未开启购买分销配置");
|
throw new CzgException("当前未开启购买分销配置");
|
||||||
}
|
}
|
||||||
|
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
||||||
|
|
||||||
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : userId)
|
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : shopUserInfo.getId())
|
||||||
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
|
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
|
||||||
orderPaymentService.save(orderPayment);
|
orderPaymentService.save(orderPayment);
|
||||||
|
|
||||||
InitInfo initInfo = new InitInfo().setConfig(detail);
|
InitInfo initInfo = new InitInfo().setConfig(detail);
|
||||||
if (!isRecharge) {
|
if (!isRecharge) {
|
||||||
ShopUser shopUserInfo = shopUserService.getShopUserInfo(payParam.getShopId(), userId);
|
|
||||||
UserInfo userInfo = userInfoService.getById(userId);
|
UserInfo userInfo = userInfoService.getById(userId);
|
||||||
initInfo.setPayment(orderPayment).setShopUser(shopUserInfo)
|
initInfo.setPayment(orderPayment).setShopUser(shopUserInfo)
|
||||||
.setOpenId("aliPay".equals(payParam.getPayType()) ? userInfo.getAlipayOpenId() : userInfo.getWechatOpenId());
|
.setOpenId("aliPay".equals(payParam.getPayType()) ? userInfo.getAlipayOpenId() : userInfo.getWechatOpenId());
|
||||||
|
|||||||
Reference in New Issue
Block a user