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

调整支付返回唯一属性

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