退款接口实现
This commit is contained in:
@@ -149,7 +149,7 @@ public class TbPlaceController {
|
||||
}
|
||||
|
||||
@PostMapping("/returnOrder")
|
||||
public ResponseEntity<?> returnOrder(ReturnOrderDTO returnOrderDTO) {
|
||||
public ResponseEntity<?> returnOrder(@RequestBody ReturnOrderDTO returnOrderDTO) {
|
||||
return ResponseEntity.ok(tbShopTableService.returnOrder(returnOrderDTO));
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,7 @@ public class PayServiceImpl implements PayService {
|
||||
*/
|
||||
@Override
|
||||
public void returnOrder(Integer shopId, TbOrderInfo orderInfo, TbOrderInfo returnOrderInfo) {
|
||||
TbMerchantThirdApply thirdApply = mpMerchantThirdApplyMapper.selectOne(new LambdaQueryWrapper<TbMerchantThirdApply>()
|
||||
.eq(TbMerchantThirdApply::getShopId, shopId));
|
||||
TbMerchantThirdApply thirdApply = mpMerchantThirdApplyMapper.selectById(returnOrderInfo.getMerchantId());
|
||||
if (thirdApply == null) {
|
||||
throw new BadRequestException("支付参数未配置");
|
||||
}
|
||||
@@ -100,7 +99,7 @@ public class PayServiceImpl implements PayService {
|
||||
returnOrderInfo.getRefundAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), callBack, null, thirdApply.getAppToken());
|
||||
log.info("福商通退款响应报文: {}", publicResp);
|
||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||
if ("000000".equals(publicResp.getCode())) {
|
||||
if (!"000000".equals(publicResp.getCode())) {
|
||||
if (!"SUCCESS".equals(publicResp.getObjData().getState()) && !publicResp.getObjData().getState().equals("ING")) {
|
||||
throw new BadRequestException("退款渠道调用失败");
|
||||
}
|
||||
|
||||
@@ -2015,6 +2015,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Object returnOrder(ReturnOrderDTO returnOrderDTO) {
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
||||
.eq(TbOrderInfo::getId, returnOrderDTO.getOrderId())
|
||||
|
||||
Reference in New Issue
Block a user