提交 6f017f8f authored 作者: 胡宁宁's avatar 胡宁宁

逻辑调整

上级 80923da4
......@@ -194,9 +194,7 @@ public class PayNotifyController {
}
private Integer analysisSuccess(String result,Integer operation, String paymentItem){
//36:201706050000015794,37:201706050000015838,38:201706050000015992
Integer id = 0;
private void analysisSuccess(String result,Integer operation, String paymentItem){
if(result.contains(",")){
String[] stringFlag = result.split(",");
if(stringFlag.length>0){
......@@ -205,7 +203,6 @@ public class PayNotifyController {
String [] ress = stringFlag[i].split("=");
if(ress.length==2){//例如 id=serialNo
paymentService.updateOrderPaymentSerialNoSuccess(ress[0],ress[1],operation,paymentItem);
id = Integer.valueOf(ress[0]);
}
}
}
......@@ -213,10 +210,8 @@ public class PayNotifyController {
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;
}
}
......@@ -36,6 +36,17 @@ public class OrderPaymentDaoImpl extends BaseDaoImpl<OrderPaymentMapper, OrderPa
.map(super::getOne);
}
@Override
public Optional<OrderPayment> selectByOrderNoAndItemIdAndOperation(String orderNo, String paymentItem,
Integer operation) {
return Optional.of(orderNo)
.map(item -> lQrWrapper()
.eq(OrderPayment::getOrderNo, item)
.eq(OrderPayment::getPaymentItem, paymentItem)
.eq(OrderPayment::getOperation, operation)
)
.map(super::getOne);
}
}
......@@ -20,4 +20,8 @@ public interface OrderPaymentDao extends BaseDao<OrderPaymentMapper, OrderPaymen
@Param("operation")Integer operation,
@Param("paymentItem")String paymentItem);
Optional<OrderPayment> selectByOrderNoAndItemIdAndOperation(@Param("orderNo")String orderNo,
@Param("paymentItem")String paymentItem,
@Param("operation")Integer operation);
}
......@@ -220,8 +220,9 @@ public class PaymentServiceImpl implements PaymentService {
public Result paymentChangePlatformFee(PayPlatformFeeParam param) {
//查询冻结记录
OrderPayment orderPaymentOptional =
orderPaymentDao.selectByOrderNoAndItemId(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "").orNull();
orderPaymentDao.selectByOrderNoAndItemIdAndOperation(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "",
PayOperationStatusEnum.FREEZE.getValue()).orNull();
if (null == orderPaymentOptional){
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND,"数据不存在") ;
}
......@@ -230,6 +231,7 @@ public class PaymentServiceImpl implements PaymentService {
.setAmount(param.getFigure())
.setOrderNo(param.getTradeNo())
.setRelationNo(payOrderNoGenerate())
.setSerialNo(orderPaymentOptional.getSerialNo())
.setPaymentItem(PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "")
.setStatus(PaymentStatusEnum.CREATE.getValue())
.setOperation(PayOperationStatusEnum.ADJUSTMENT.getValue());
......@@ -255,8 +257,9 @@ public class PaymentServiceImpl implements PaymentService {
public Result paymentCompletePlatformFee(PayPlatformFeeParam param) {
//查询冻结记录
OrderPayment orderPaymentOptional =
orderPaymentDao.selectByOrderNoAndItemId(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "").orNull();
orderPaymentDao.selectByOrderNoAndItemIdAndOperation(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "",
PayOperationStatusEnum.FREEZE.getValue()).orNull();
if (null == orderPaymentOptional){
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND,"数据不存在") ;
}
......@@ -291,8 +294,9 @@ public class PaymentServiceImpl implements PaymentService {
public Result paymentCancelPlatformFee(PayPlatformFeeParam param) {
//查询冻结记录
OrderPayment orderPaymentOptional =
orderPaymentDao.selectByOrderNoAndItemId(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "").orNull();
orderPaymentDao.selectByOrderNoAndItemIdAndOperation(param.getTradeNo(),
PayUnitTypeEnum.FREEZE_PLATFORM_FEE.getCode() + "",
PayOperationStatusEnum.FREEZE.getValue()).orNull();
if (null == orderPaymentOptional){
throw new ServiceSystemException(PerformanceResultEnum.DATA_NOT_FIND,"数据不存在") ;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论