提交 2e03269b authored 作者: 胡宁宁's avatar 胡宁宁

调整支付返回唯一属性

上级 56ff7eea
......@@ -92,16 +92,12 @@ public class PayNotifyController {
String paymentItem = PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode()+"";
int operation = PayOperationStatusEnum.FREEZE.getValue();
if (notify.getCode() != 0) {
paymentService.updateOrderPaymentFail(notify.getOrderNo(), notify.getMsg(),
operation,
paymentItem
);
paymentService.updateOrderPaymentStatusById(notify.getOrderNo(),PaymentStatusEnum.FAIL.getValue());
// 支付失败处理
log.info("支付失败处理 唯一id {}", notify.getOrderNo());
} else {
analysisSuccess(notify.getData().toString(), operation, paymentItem);
paymentService.updateOrderPaymentSuccess(notify.getOrderNo(), operation,
paymentItem);
paymentService.updateOrderPaymentStatusById(notify.getOrderNo(),PaymentStatusEnum.SUCCESS.getValue());
// 支付支付成功处理
log.info(" 支付支付成功处理 唯一id {}", notify.getOrderNo());
......
......@@ -23,6 +23,9 @@ public interface PaymentService {
void updateOrderPaymentFail(String orderNo,String msg,Integer operation, String paymentItem);
void updateOrderPaymentSuccess(String orderNo,Integer operation, String paymentItem);
void updateOrderPaymentStatusById(String id,int status);
void updateOrderPaymentSerialNoSuccess(String orderNo,String serialNo,Integer operation, String paymentItem);
WalletResidueDTO getWalletAndCard(Integer userCode);
......
......@@ -192,7 +192,7 @@ public class PaymentServiceImpl implements PaymentService {
OrderPayment orderPayment = new OrderPayment()
.setAmount(payDTO.getFigure())
.setOrderNo(payDTO.getTradeNo())
.setRelationNo(payOrderNoGenerate())
.setRelationNo(payDTO.getTradeNo())
.setPaymentItem(PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "")
.setStatus(PaymentStatusEnum.CREATE.getValue())
.setOperation(PayOperationStatusEnum.FREEZE.getValue());
......@@ -243,7 +243,7 @@ public class PaymentServiceImpl implements PaymentService {
saveOrderPayment(orderPayment);
/** 调整冻结记录 **/
FreezeBatchDTO freezeBatchDTO = buildChangeFreezeBatchDTO(orderPaymentOptional,orderPayment.getRelationNo() ,param.getFigure());
FreezeBatchDTO freezeBatchDTO = buildChangeFreezeBatchDTO(orderPaymentOptional,orderPayment.getId() ,param.getFigure());
log.info("发起支付请求日志 {}", freezeBatchDTO);
Result<Object> notify = (Result<Object>) postRequest(mslPaymentConfig.getHost() +
......@@ -391,6 +391,19 @@ public class PaymentServiceImpl implements PaymentService {
orderPaymentDao.updateEntityByKey(orderPaymentOptional);
}
@Override
public void updateOrderPaymentStatusById(String id,Integer status) {
//查询冻结记录
OrderPayment orderPaymentOptional = orderPaymentDao.getEntityByKey(Integer.valueOf(id)).orNull();
if (null == orderPaymentOptional){
log.error("数据不存在 {}, {}" ,id);
}
orderPaymentOptional.setStatus(status);
orderPaymentDao.updateEntityByKey(orderPaymentOptional);
}
@Override
public void updateOrderPaymentSerialNoSuccess(String orderNo, String serialNo, Integer operation, String paymentItem) {
OrderPayment orderPaymentOptional =
......@@ -492,7 +505,7 @@ public class PaymentServiceImpl implements PaymentService {
/**
* 构建 司机平台服务费冻结实体
*/
public FreezeBatchDTO buildChangeFreezeBatchDTO(OrderPayment orderPaymentOptional,String orderNo,Integer figure){
public FreezeBatchDTO buildChangeFreezeBatchDTO(OrderPayment orderPaymentOptional,Integer orderNo,Integer figure){
FreezeBatchDTO freezeBatchDTO = new FreezeBatchDTO();
List<FreezeUnitDTO> FreezeUnitList = new ArrayList<FreezeUnitDTO>();
FreezeUnitDTO freightPayUnitDTO = new FreezeUnitDTO();
......@@ -508,7 +521,7 @@ public class PaymentServiceImpl implements PaymentService {
FreezeUnitList.add(freightPayUnitDTO);
freezeBatchDTO.setFreezeUnitList(FreezeUnitList);
freezeBatchDTO.setOrderNo(orderNo);
freezeBatchDTO.setOrderNo(orderNo+"");
freezeBatchDTO.setSystem(SystemCodeEnum.PERFORMANCE_SERVICE.getCode());
//回调地址
freezeBatchDTO.setNotifyUrl(mslPaymentConfig.getNotifyhost() + NOTIFY_ADJUST_PLATFORM_FEE_URL);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论