提交 37004aec authored 作者: 胡宁宁's avatar 胡宁宁

增加司机保证金冻结支付接口 修改流水号

上级 afc29cf3
......@@ -99,6 +99,7 @@ public class PayNotifyController {
// 支付失败处理
log.info("支付失败处理 唯一id {}", notify.getOrderNo());
} else {
analysisSuccess(notify.getData().toString(), operation, paymentItem);
paymentService.updateOrderPaymentSuccess(notify.getOrderNo(), operation,
paymentItem);
......@@ -191,4 +192,31 @@ public class PayNotifyController {
Result<Object> ret = new Result<>();
return ret;
}
private Integer analysisSuccess(String result,Integer operation, String paymentItem){
//36:201706050000015794,37:201706050000015838,38:201706050000015992
Integer id = 0;
if(result.contains(",")){
String[] stringFlag = result.split(",");
if(stringFlag.length>0){
//最多四笔,直接循环修改
for(int i=0;i<stringFlag.length;i++){
String [] ress = stringFlag[i].split("=");
if(ress.length==2){//例如 id=serialNo
paymentService.updateOrderPaymentSerialNoSuccess(ress[0],ress[1],operation,paymentItem);
id = Integer.valueOf(ress[0]);
}
}
}
}else{
String[] ress = result.split("=");
if(ress.length==2){//例如 id=serialNo
paymentService.updateOrderPaymentSerialNoSuccess(ress[0],ress[1],operation,paymentItem);
id = Integer.valueOf(ress[0]);
}
}
return id;
}
}
......@@ -22,4 +22,5 @@ public interface PaymentService {
void updateOrderPaymentFail(String orderNo,String msg,Integer operation, String paymentItem);
void updateOrderPaymentSuccess(String orderNo,Integer operation, String paymentItem);
void updateOrderPaymentSerialNoSuccess(String orderNo,String serialNo,Integer operation, String paymentItem);
}
......@@ -348,6 +348,18 @@ public class PaymentServiceImpl implements PaymentService {
orderPaymentDao.updateEntityByKey(orderPaymentOptional);
}
@Override
public void updateOrderPaymentSerialNoSuccess(String orderNo, String serialNo, Integer operation, String paymentItem) {
OrderPayment orderPaymentOptional =
orderPaymentDao.selectByRelationNo(orderNo,operation,paymentItem).orNull();
if (null == orderPaymentOptional){
log.error("数据不存在 {}, {}" ,orderNo);
}
orderPaymentOptional.setStatus(PaymentStatusEnum.SUCCESS.getValue());
orderPaymentOptional.setSerialNo(serialNo);
orderPaymentDao.updateEntityByKey(orderPaymentOptional);
}
/**
* post请求
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论