| | |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.domain.dto.UserPolicyDto; |
| | | import com.ruoyi.system.mapper.UserPolicyMapper; |
| | | import com.ruoyi.system.service.FundsLogService; |
| | | import com.ruoyi.system.service.GroupWelcomeConfigService; |
| | | import com.ruoyi.system.service.PaymentRecordService; |
| | | import com.ruoyi.system.service.UserAccountService; |
| | | import org.json.JSONObject; |
| | |
| | | private PaymentRecordService paymentRecordService; |
| | | @Autowired |
| | | private UserKycService userKycService; |
| | | @Autowired |
| | | private GroupWelcomeConfigService groupWelcomeConfigService; |
| | | @Autowired |
| | | private FundsLogService fundsLogService; |
| | | |
| | | |
| | | @Override |
| | |
| | | if(ObjectUtil.isEmpty(insuranceProduct)){ |
| | | return Result.error("该产品停止购买或已下架!"); |
| | | } |
| | | |
| | | if(!dto.getPayProductId().equals("0")){ |
| | | |
| | | GroupWelcomeConfig groupWelcomeConfig = groupWelcomeConfigService.getOne(new LambdaQueryWrapper<>(GroupWelcomeConfig.class) |
| | | .eq(GroupWelcomeConfig::getConfigurationName, "IM-BASICS").last(" limit 1")); |
| | | if(ObjectUtil.isNotEmpty(groupWelcomeConfig) && ObjectUtil.isNotEmpty(groupWelcomeConfig.getPaymentSwitch()) && !groupWelcomeConfig.getPaymentSwitch()){ |
| | | return Result.error("无可用支付方式!"); |
| | | } |
| | | |
| | | String orderNo = generateOrderNo(); |
| | | String payOrder = payService.createOrder( |
| | | insuranceProduct.getPremium(), |
| | |
| | | paymentRecord.setProductName(insuranceProduct.getProductName()); |
| | | paymentRecord.setModePayment(3); |
| | | paymentRecordService.save(paymentRecord); |
| | | |
| | | fundsLogService.addLog(userAccount.getId(), userAccount.getAccount(), insuranceProduct.getPremium(), OperationType.USER_ORDER); |
| | | // 生成资金日志 |
| | | return Result.success(); |
| | | } |
| | | } |