mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
禅道bug#1599修复
This commit is contained in:
+5
@@ -154,4 +154,9 @@ public class PurchaseRecordDO extends BaseDO {
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 第三方支付链接
|
||||
*/
|
||||
private String displayContent;
|
||||
}
|
||||
|
||||
+21
-5
@@ -8,10 +8,12 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cf.imes.framework.common.exception.ErrorData;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.validation.ValidationUtils;
|
||||
import com.cf.imes.framework.id.core.util.SnowflakeSerialNoWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.cf.imes.framework.pay.config.ChenfengAlipayConfig;
|
||||
import com.cf.imes.framework.pay.config.ChenfengPayConfig;
|
||||
import com.cf.imes.framework.pay.core.client.dto.order.PayOrderRespDTO;
|
||||
@@ -56,6 +58,7 @@ import jakarta.validation.Validator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -166,7 +169,11 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
// 检查机构产品是否有待支付的购买记录
|
||||
List<PurchaseRecordDO> pendingPurchaseList = purchaseService.getOrgProductPendingPurchaseList(organId, productId);
|
||||
if (CollUtil.isNotEmpty(pendingPurchaseList)) {
|
||||
throw new ServiceException(ORG_PRODUCT_PURCHASE_WAIT_PAY_ERROR);
|
||||
// 取更新时间最新的那一条展示支付链接
|
||||
PurchaseRecordDO latestPendingPurchase = pendingPurchaseList.stream()
|
||||
.max(Comparator.comparing(BaseDO::getUpdateTime))
|
||||
.orElse(null);
|
||||
throw new ServiceException(ORG_PRODUCT_PURCHASE_WAIT_PAY_ERROR, new ErrorData().setErrorData(latestPendingPurchase.getDisplayContent()), payConfig.getPayExpireTime().toMinutes());
|
||||
}
|
||||
|
||||
// 查询组织产品的首次购买记录
|
||||
@@ -188,15 +195,20 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
processPreviosPurchaseRecord(previouProductDelayRespVO, payOrder);
|
||||
|
||||
// 记录入库,如果有外部支付发起请求二维码
|
||||
// 购买记录入库
|
||||
purchaseService.createRecord(productProcessorRespVO.getPurchaseRecordDO());
|
||||
PurchaseRecordDO purchaseRecordDO = productProcessorRespVO.getPurchaseRecordDO();
|
||||
|
||||
|
||||
// 发起渠道方支付
|
||||
createPayOrder(payOrder);
|
||||
AbstractPayHandler payHandler = payHandlerFactory.getPayHandler(channelCode);
|
||||
|
||||
payOrderUnifiedReqDTO = createPayOrderUnifiedReqDTO(payOrder);
|
||||
return payHandler.unifiedOrder(payOrderUnifiedReqDTO);
|
||||
PayOrderRespDTO payOrderRespDTO = payHandler.unifiedOrder(payOrderUnifiedReqDTO);
|
||||
|
||||
// 购买记录入库,记录外部支付请求
|
||||
purchaseRecordDO.setDisplayContent(payOrderRespDTO.getDisplayContent());
|
||||
purchaseService.createRecord(purchaseRecordDO);
|
||||
return payOrderRespDTO;
|
||||
|
||||
} catch (Throwable e) {
|
||||
// 系统异常,则包装成 PayException 异常抛出
|
||||
@@ -231,7 +243,11 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
// 检查机构产品是否有待支付的购买记录
|
||||
List<PurchaseRecordDO> pendingPurchaseList = purchaseService.getOrgProductPendingPurchaseList(organId, productId);
|
||||
if (CollUtil.isNotEmpty(pendingPurchaseList)) {
|
||||
throw new ServiceException(ORG_PRODUCT_PURCHASE_WAIT_PAY_ERROR);
|
||||
// 取更新时间最新的那一条展示支付链接
|
||||
PurchaseRecordDO latestPendingPurchase = pendingPurchaseList.stream()
|
||||
.max(Comparator.comparing(BaseDO::getUpdateTime))
|
||||
.orElse(null);
|
||||
throw new ServiceException(ORG_PRODUCT_PURCHASE_WAIT_PAY_ERROR, new ErrorData().setErrorData(latestPendingPurchase.getDisplayContent()), payConfig.getPayExpireTime().toMinutes());
|
||||
}
|
||||
|
||||
// 查询组织产品的首次购买记录
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user