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

逻辑调整

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