feat:正元默认绑定商户用于统计
This commit is contained in:
1 parent
f8ce17ca84
commit
b28045e29d
3 files changed
+37
No files matched your search
+19
@@ -26,9 +26,12 @@ import com.bsd.pjcloud.hard.mapper.order.HardAfterSaleLogMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardAfterSaleService;
|
||||
import com.bsd.pjcloud.hard.service.HardOrderService;
|
||||
import com.bsd.pjcloud.hard.service.HardThirdSelfZyService;
|
||||
import com.bsd.pjcloud.hard.zy.config.ZyCallbackConfig;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.feign.RemoteWalletService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -48,11 +51,14 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
|
||||
private final RemoteWalletService remoteWalletService;
|
||||
private final RemoteUserService remoteUserService;
|
||||
private final RemoteMchService remoteMchService;
|
||||
|
||||
private final HardOrderService hardOrderService;
|
||||
private final HardAfterSaleLogMapper hardAfterSaleLogMapper;
|
||||
private final HardAfterSaleService hardAfterSaleService;
|
||||
|
||||
private final ZyCallbackConfig zyCallbackConfig;
|
||||
|
||||
/**
|
||||
* 正元支付
|
||||
*/
|
||||
@@ -69,6 +75,9 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
// 用户
|
||||
UserInfo user = remoteUserService.getByUserId(wallet.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(user)) throw new RuntimeException("用户不存在");
|
||||
// 查询正元默认商户
|
||||
MchManageVo zyDefaultMch = getZyDefaultMch();
|
||||
if (ObjectUtil.isEmpty(zyDefaultMch)) throw new RuntimeException("默认商户不存在");
|
||||
Integer balance = wallet.getBalance();
|
||||
int totalPrice = dto.getPayPrice();
|
||||
if (balance < totalPrice) {
|
||||
@@ -81,6 +90,9 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
HardOrderEntity orderObj = HardOrderEntity.builder()
|
||||
.orderNo(dto.getOrderNo())
|
||||
.userId(dto.getUserId())
|
||||
.merchantId(zyDefaultMch.getId())
|
||||
.merchantType(zyDefaultMch.getTypes())
|
||||
.merchantDeptId(zyDefaultMch.getDeptId())
|
||||
.userDeptId(userDetail.getSysUser().getDeptId())
|
||||
.parentCarId(null)
|
||||
.sysType(null)
|
||||
@@ -172,4 +184,11 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询正元默认商户信息
|
||||
*/
|
||||
private MchManageVo getZyDefaultMch() {
|
||||
return remoteMchService.getById(zyCallbackConfig.getMchId()).getData();
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.hard.zy.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "zy-callback")
|
||||
@Component
|
||||
public class ZyCallbackConfig {
|
||||
|
||||
private Long mchId;
|
||||
|
||||
}
|
||||
@@ -16,3 +16,7 @@ spring:
|
||||
import:
|
||||
- optional:nacos:application-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
|
||||
# 正源回调配置
|
||||
#zy-callback:
|
||||
# mch-id: 1909168994551459842
|
||||
Reference in new issue
Block a user