no message
This commit is contained in:
@ -1,131 +1,145 @@
|
||||
//package com.sczx.pay.alipay.controller;
|
||||
//
|
||||
//import com.alipay.api.domain.AppxCategoryVO;
|
||||
//import com.alipay.api.internal.util.StringUtils;
|
||||
//import com.alipay.api.response.AlipayOpenAppItemListQueryResponse;
|
||||
//import com.alipay.api.response.AlipayOpenAppItemQueryResponse;
|
||||
//import com.alipay.api.response.AlipayOpenAppItemTemplateQueryResponse;
|
||||
//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
//import com.sczx.pay.alipay.po.RentRuleItem;
|
||||
//import com.sczx.pay.alipay.service.ItemService;
|
||||
//import com.sczx.pay.alipay.service.RentRuleItemService;
|
||||
//import com.sczx.pay.alipay.vo.ItemCreateRequest;
|
||||
//import com.sczx.pay.alipay.vo.OpenResponse;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import io.swagger.annotations.ApiParam;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//
|
||||
//@Api(tags = "普通商品模块")
|
||||
//@RestController
|
||||
//@RequestMapping(value = "/item")
|
||||
//public class ItemController {
|
||||
//
|
||||
// @Autowired
|
||||
// private ItemService itemService;
|
||||
//
|
||||
// @Autowired
|
||||
// private RentRuleItemService rentRuleItemService;
|
||||
//
|
||||
// /**
|
||||
// * 类目查询
|
||||
// * 获取叶子节点商品类目列表
|
||||
// */
|
||||
// @ApiOperationSupport(order = 1)
|
||||
// @ApiOperation(value = "类目查询", notes = "获取叶子节点商品类目列表")
|
||||
// @GetMapping(value = "/category/list")
|
||||
// public OpenResponse<List<AppxCategoryVO>> categoryList(
|
||||
// @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam String itemType,
|
||||
// @ApiParam(value = "类目状态,默认AUDIT_PASSED", example = "AUDIT_PASSED") @RequestParam(required = false) String catStatus) {
|
||||
package com.sczx.pay.alipay.controller;
|
||||
|
||||
import com.alipay.api.domain.AppxCategoryVO;
|
||||
import com.alipay.api.internal.util.StringUtils;
|
||||
import com.alipay.api.response.AlipayOpenAppItemListQueryResponse;
|
||||
import com.alipay.api.response.AlipayOpenAppItemQueryResponse;
|
||||
import com.alipay.api.response.AlipayOpenAppItemTemplateQueryResponse;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.sczx.pay.alipay.po.RentRuleItem;
|
||||
import com.sczx.pay.alipay.service.ItemService;
|
||||
import com.sczx.pay.alipay.service.RentRuleItemService;
|
||||
import com.sczx.pay.alipay.vo.ItemCreateRequest;
|
||||
import com.sczx.pay.alipay.vo.OpenResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Api(tags = "普通商品模块")
|
||||
@RestController
|
||||
@RequestMapping(value = "/item")
|
||||
public class ItemController {
|
||||
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
|
||||
@Autowired
|
||||
private RentRuleItemService rentRuleItemService;
|
||||
|
||||
/**
|
||||
* 类目查询
|
||||
* 获取叶子节点商品类目列表
|
||||
*/
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ApiOperation(value = "类目查询", notes = "获取叶子节点商品类目列表")
|
||||
@GetMapping(value = "/category/list")
|
||||
public OpenResponse<List<AppxCategoryVO>> categoryList(
|
||||
@ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam String itemType,
|
||||
@ApiParam(value = "类目状态,默认AUDIT_PASSED", example = "AUDIT_PASSED") @RequestParam(required = false) String catStatus) {
|
||||
//return itemService.getCategories(itemType, catStatus);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 普通商品模板信息查询
|
||||
// */
|
||||
// @ApiOperationSupport(order = 2)
|
||||
// @ApiOperation(value = "普通商品模板信息查询")
|
||||
// @GetMapping(value = "/template/query")
|
||||
// public OpenResponse<AlipayOpenAppItemTemplateQueryResponse> queryTemplate(
|
||||
// @ApiParam(value = "类目ID", required = true) @RequestParam String categoryId,
|
||||
// @ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam(required = false) String itemType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通商品模板信息查询
|
||||
*/
|
||||
@ApiOperationSupport(order = 2)
|
||||
@ApiOperation(value = "普通商品模板信息查询")
|
||||
@GetMapping(value = "/template/query")
|
||||
public OpenResponse<AlipayOpenAppItemTemplateQueryResponse> queryTemplate(
|
||||
@ApiParam(value = "类目ID", required = true) @RequestParam String categoryId,
|
||||
@ApiParam(value = "商品类型:1-售卖类(实物),2-租赁类(实物),3-付费充值/兑换类(虚拟)") @RequestParam(required = false) String itemType) {
|
||||
//return itemService.queryTemplate(categoryId, itemType);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 租赁类(实物)商品创建
|
||||
// */
|
||||
// @ApiOperation(value = "租赁类(实物)商品创建")
|
||||
// @ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/rent/create")
|
||||
// public OpenResponse<String> rentCreate(@RequestBody RentRuleItem request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 租赁类(实物)商品创建
|
||||
*/
|
||||
@ApiOperation(value = "租赁类(实物)商品创建")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/rent/create")
|
||||
public OpenResponse<String> rentCreate(@RequestBody RentRuleItem request) {
|
||||
//return itemService.createRentItem(request);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @PostMapping(value = "/rent/modify")
|
||||
// public OpenResponse<String> modifyCreate(@RequestBody RentRuleItem request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/rent/modify")
|
||||
public OpenResponse<String> modifyCreate(@RequestBody RentRuleItem request) {
|
||||
//return itemService.modifyItem(request);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "商品详情查询")
|
||||
// @ApiOperationSupport(order = 7)
|
||||
// @GetMapping(value = "/query")
|
||||
// public OpenResponse<AlipayOpenAppItemQueryResponse> query(@ApiParam(value = "支付平台侧商品ID") @RequestParam(required = false) String itemId,
|
||||
// @ApiParam(value = "商家侧商品ID") @RequestParam(required = false) String outItemId,
|
||||
// @ApiParam(value = "是否查询编辑版本,默认为0", defaultValue = "0") @RequestParam(required = false) String needEditSpu) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "商品详情查询")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@GetMapping(value = "/query")
|
||||
public OpenResponse<AlipayOpenAppItemQueryResponse> query(@ApiParam(value = "支付平台侧商品ID") @RequestParam(required = false) String itemId,
|
||||
@ApiParam(value = "商家侧商品ID") @RequestParam(required = false) String outItemId,
|
||||
@ApiParam(value = "是否查询编辑版本,默认为0", defaultValue = "0") @RequestParam(required = false) String needEditSpu) {
|
||||
// return itemService.queryItemDetail(itemId, outItemId,
|
||||
// StringUtils.isNumeric(needEditSpu) ? Long.parseLong(needEditSpu) : 0);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 租赁类(实物)履约模板创建
|
||||
// */
|
||||
// @ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
// @ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/template/create")
|
||||
// public OpenResponse<String> templateCreate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 租赁类(实物)履约模板创建
|
||||
*/
|
||||
@ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/template/create")
|
||||
public OpenResponse<String> templateCreate() {
|
||||
|
||||
//return itemService.syncDeliveryInfo();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 租赁类(实物)履约模板创建
|
||||
// */
|
||||
// @ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
// @ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/delivery/query")
|
||||
// public OpenResponse<String> deliveryQuery() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 租赁类(实物)履约模板创建
|
||||
*/
|
||||
@ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/delivery/query")
|
||||
public OpenResponse<String> deliveryQuery() {
|
||||
|
||||
//return itemService.deliveryInfoQuery();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
// @ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/deliverytemplate/query")
|
||||
// public OpenResponse<String> deliveryTemplateQuery() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/deliverytemplate/query")
|
||||
public OpenResponse<String> deliveryTemplateQuery() {
|
||||
|
||||
//return itemService.deliveryTemplateQuery();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
// @ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/shop/query")
|
||||
// public OpenResponse<String> shopQuery() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "租赁类(实物)履约模板创建")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/shop/query")
|
||||
public OpenResponse<String> shopQuery() {
|
||||
|
||||
//return itemService.shopQuery();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "接收套餐数据并记录商品")
|
||||
// @GetMapping(value = "/sync/item")
|
||||
// public Map<String,String> syncItem(@RequestParam(required = false) String brandId,@RequestParam(required = false) String carModelId,
|
||||
// @RequestParam(required = false) String carRuleId,@RequestParam(required = false) String batteryRuleId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "接收套餐数据并记录商品")
|
||||
@GetMapping(value = "/sync/item")
|
||||
public Map<String,String> syncItem(@RequestParam(required = false) String brandId,@RequestParam(required = false) String carModelId,
|
||||
@RequestParam(required = false) String carRuleId,@RequestParam(required = false) String batteryRuleId) {
|
||||
//return rentRuleItemService.syncItem(brandId, carModelId,carRuleId,batteryRuleId);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,32 +1,33 @@
|
||||
//package com.sczx.pay.alipay.controller;
|
||||
//
|
||||
//
|
||||
//import com.alipay.api.AlipayApiException;
|
||||
//import com.sczx.pay.alipay.service.RentOrderService;
|
||||
//import com.sczx.pay.alipay.vo.RentOrderCreateRequest;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//
|
||||
//@Api(value = "租赁订单接口", tags = "租赁订单接口")
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/rentorder")
|
||||
//public class ItemOrderController {
|
||||
//
|
||||
// @Autowired
|
||||
// private RentOrderService rentOrderService;
|
||||
//
|
||||
// @ApiOperation(value = "创建租赁订单")
|
||||
// @PostMapping("/create")
|
||||
// public String rentOrderCreate(RentOrderCreateRequest request) throws AlipayApiException {
|
||||
package com.sczx.pay.alipay.controller;
|
||||
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.sczx.pay.alipay.service.RentOrderService;
|
||||
import com.sczx.pay.alipay.vo.RentOrderCreateRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Api(value = "租赁订单接口", tags = "租赁订单接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rentorder")
|
||||
public class ItemOrderController {
|
||||
|
||||
@Autowired
|
||||
private RentOrderService rentOrderService;
|
||||
|
||||
@ApiOperation(value = "创建租赁订单")
|
||||
@PostMapping("/create")
|
||||
public String rentOrderCreate(RentOrderCreateRequest request) throws AlipayApiException {
|
||||
//return rentOrderService.rentOrderCreate(request).getBody();
|
||||
//
|
||||
// }
|
||||
//}
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -224,9 +224,8 @@ public class ItemServiceImpl implements ItemService {
|
||||
// 设置平台类目
|
||||
model.setCategoryId("C001684401");
|
||||
// 设置商品主图
|
||||
String imgStr = imageUploadService.uploadAndReturnId(rentRuleItem.getImage(), "ITEM_HEAD_IMG");
|
||||
model.setHeadImg(imgStr);
|
||||
rentRuleItemvo.setImage(imgStr);
|
||||
model.setHeadImg(rentRuleItem.getAliItemId());
|
||||
rentRuleItemvo.setImage(rentRuleItem.getAliItemId());
|
||||
// 设置商品模版类型
|
||||
model.setItemType("2");
|
||||
//sku_attrs
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package com.sczx.pay.controller;
|
||||
|
||||
import com.sczx.pay.dto.*;
|
||||
import com.sczx.pay.service.AlipayService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(value = "支付宝芝麻免押支付接口", tags = "支付宝芝麻免押支付接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/authAlipay")
|
||||
public class AliAuthPaymentController {
|
||||
|
||||
@Autowired
|
||||
private AlipayService alipayService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 免押冻结
|
||||
*/
|
||||
@ApiOperation(value = "免押冻结接口")
|
||||
@PostMapping("/fundFreeze")
|
||||
public AlipayFundFreezeResponse fundFreeze(@RequestBody AlipayFundFreezeRequest request) {
|
||||
log.info("收到支付宝免押冻结请求: {}", request);
|
||||
return alipayService.fundFreeze(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消冻结
|
||||
*/
|
||||
@ApiOperation(value = "取消冻结接口")
|
||||
@PostMapping("/cancelFundFreeze")
|
||||
public AlipayFundFreezeResponse cancelFundFreeze(@RequestBody AlipayFundFreezeRequest request) {
|
||||
log.info("收到支付宝取消免押冻结请求: {}", request);
|
||||
return alipayService.cancelFundFreeze(request);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询冻结接口")
|
||||
@PostMapping("/queryFundFreeze")
|
||||
public AlipayQueryFreezeResponse queryFundFreeze(@RequestBody AlipayQueryFreezeRequest alipayQueryFreezeRequest) {
|
||||
log.info("收到支付宝查询免押冻结请求: {}", alipayQueryFreezeRequest);
|
||||
return alipayService.queryFundFreeze(alipayQueryFreezeRequest);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "完结冻结接口")
|
||||
@PostMapping("/finishFreeze")
|
||||
public AlipayResponse finishFreeze(@RequestBody AlipayFinishFreezeRequest alipayFinishFreezeRequest) {
|
||||
log.info("收到支付宝完结免押冻结请求: {}", alipayFinishFreezeRequest);
|
||||
return alipayService.finishFreeze(alipayFinishFreezeRequest);
|
||||
}
|
||||
}
|
||||
@ -168,7 +168,7 @@ public class AliPayNotifyController {
|
||||
String status = params.get("status");
|
||||
|
||||
if ("SUCCESS".equals(status)) {
|
||||
log.warn("支付宝免押通知状态失败: {}", status);
|
||||
log.warn("支付宝免押通知状态: {}", status);
|
||||
// 处理免押通知
|
||||
String outOrderNo = params.get("out_order_no");
|
||||
String authNo = params.get("auth_no");
|
||||
|
||||
@ -66,5 +66,4 @@
|
||||
// log.info("收到支付宝退款查询请求: {}", request);
|
||||
// return alipayService.refundQuery(request);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@ -1,29 +1,29 @@
|
||||
//package com.sczx.pay.controller;
|
||||
//
|
||||
//import com.sczx.pay.dto.ali.rent.AlipayRentPayReq;
|
||||
//import com.sczx.pay.dto.ali.rent.AlipayRentPayResponse;
|
||||
//import com.sczx.pay.service.AlipayRentService;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//@Api(value = "支付宝租赁订单支付接口", tags = "支付宝租赁订单支付接口")
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/alipay/rent")
|
||||
//public class AlipayRentController {
|
||||
//
|
||||
// @Autowired
|
||||
// private AlipayRentService alipayRentService;
|
||||
//
|
||||
// @ApiOperation(value = "创建支付单")
|
||||
// @PostMapping("/pay")
|
||||
// public AlipayRentPayResponse pay(@RequestBody AlipayRentPayReq request) {
|
||||
// return alipayRentService.rentPay(request);
|
||||
// }
|
||||
//}
|
||||
package com.sczx.pay.controller;
|
||||
|
||||
import com.sczx.pay.dto.ali.rent.AlipayRentPayReq;
|
||||
import com.sczx.pay.dto.ali.rent.AlipayRentPayResponse;
|
||||
import com.sczx.pay.service.AlipayRentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(value = "支付宝租赁订单支付接口", tags = "支付宝租赁订单支付接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/alipay/rent")
|
||||
public class AlipayRentController {
|
||||
|
||||
@Autowired
|
||||
private AlipayRentService alipayRentService;
|
||||
|
||||
@ApiOperation(value = "创建支付单")
|
||||
@PostMapping("/pay")
|
||||
public AlipayRentPayResponse pay(@RequestBody AlipayRentPayReq request) {
|
||||
return alipayRentService.rentPay(request);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ public class PaymentController {
|
||||
|
||||
@Autowired
|
||||
private CompanyWechatConfigMapper companyWechatConfigMapper;
|
||||
//
|
||||
|
||||
// /**
|
||||
// * 小程序统一下单接口
|
||||
// */
|
||||
|
||||
@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Update;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface OrderPayMapper {
|
||||
@ -67,8 +68,8 @@ public interface OrderPayMapper {
|
||||
@Select("select suborder_id from zc_order_sub where payment_id = #{paymentId} and suborder_type = 'RENTBATTEY' limit 1")
|
||||
Long getSubOrderIdByTradeNo(@Param("paymentId") String paymentId);
|
||||
|
||||
@Select("select * from zc_order_sub where payment_id = #{paymentId} order by suborder_id desc limit 1")
|
||||
OrderSub getSubOrderByTradeNo(@Param("paymentId") String paymentId);
|
||||
@Select("select * from zc_order_sub where payment_id = #{paymentId}")
|
||||
List<OrderSub> listSubOrderByTradeNo(@Param("paymentId") String paymentId);
|
||||
|
||||
/**
|
||||
* 免押成功,更新子订单状态
|
||||
@ -77,4 +78,8 @@ public interface OrderPayMapper {
|
||||
" where payment_id = #{authNo}")
|
||||
int updateFreezeSubOrderPaymentStatus(@Param("authNo") String authNo,
|
||||
@Param("transactionId") String transactionId);
|
||||
|
||||
@Select("SELECT SHA2 ( CONVERT (concat(u.real_name,u.id_no) USING utf8 ), 256 ) as hashStr FROM zc_order_sub s,zc_order_main m,zc_base_user u WHERE s.payment_id = #{paymentId} AND s.order_id = m.order_id AND m.customer_phone = u.phone_number AND u.authed = '1'")
|
||||
String getHashStrByTradeNo(@Param("paymentId") String paymentId);
|
||||
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -424,10 +425,11 @@ public class WechatPayService {
|
||||
|
||||
if(OrderStatus.equals("WAIT_PAY")){
|
||||
orderPayMapper.updateOrderStatus(orderMain.getOrderNo(),"WAIT_PICK");
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY") || OrderStatus.equals("RENT_ING")){
|
||||
OrderSub orderSub = orderPayMapper.getSubOrderByTradeNo(outTradeNo);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),orderSub.getReturnTime(),0,orderMain.getOrderAmount().add(orderSub.getAmount()),"RENT_ING");
|
||||
//发送租电订单同步
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY")){
|
||||
List<OrderSub> orderSub = orderPayMapper.listSubOrderByTradeNo(outTradeNo);
|
||||
OrderSub rentCarSubOrder = orderSub.stream().filter(x -> x.getSuborderType().equals("RENTCAR")).findFirst().orElse( null);
|
||||
BigDecimal rentCarAmount = orderSub.stream().map(OrderSub::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),rentCarSubOrder.getReturnTime(),0,orderMain.getOrderAmount().add(rentCarAmount),"RENT_ING");
|
||||
//发送租电订单同步
|
||||
Long batterySubOrderId = orderPayMapper.getSubOrderIdByTradeNo(outTradeNo);
|
||||
logger.info("发送租电订单同步: {}", batterySubOrderId);
|
||||
|
||||
@ -55,6 +55,7 @@ public class AlipayRentServiceImpl implements AlipayRentService {
|
||||
@Autowired
|
||||
private SyncInteg syncInteg;
|
||||
|
||||
|
||||
@Override
|
||||
public AlipayRentPayResponse rentPay(AlipayRentPayReq alipayRentPayReq) {
|
||||
AlipayRentPayResponse response = new AlipayRentPayResponse();
|
||||
@ -158,9 +159,12 @@ public class AlipayRentServiceImpl implements AlipayRentService {
|
||||
|
||||
if(OrderStatus.equals("WAIT_PAY")){
|
||||
orderPayMapper.updateOrderStatus(orderMain.getOrderNo(),"WAIT_PICK");
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY") || OrderStatus.equals("RENT_ING")){
|
||||
OrderSub orderSub = orderPayMapper.getSubOrderByTradeNo(outTradeNo);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),orderSub.getReturnTime(),0,orderMain.getOrderAmount().add(orderSub.getAmount()),"RENT_ING");
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY")){
|
||||
List<OrderSub> orderSub = orderPayMapper.listSubOrderByTradeNo(outTradeNo);
|
||||
OrderSub rentCarSubOrder = orderSub.stream().filter(x -> x.getSuborderType().equals("RENTCAR")).findFirst().orElse( null);
|
||||
BigDecimal rentCarAmount = orderSub.stream().map(OrderSub::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),rentCarSubOrder.getReturnTime(),0,orderMain.getOrderAmount().add(rentCarAmount),"RENT_ING");
|
||||
|
||||
//发送租电订单同步
|
||||
Long batterySubOrderId = orderPayMapper.getSubOrderIdByTradeNo(outTradeNo);
|
||||
log.info("发送租电订单同步: {}", batterySubOrderId);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.sczx.pay.service.impl;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.domain.*;
|
||||
@ -25,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@ -53,6 +55,9 @@ public class AlipayServiceImpl implements AlipayService {
|
||||
@Value("${alipay.serviceid}")
|
||||
private String serviceId ;
|
||||
|
||||
@Value("${alipay.rent.rentCategory}")
|
||||
private String rentCategory;
|
||||
|
||||
|
||||
@Autowired
|
||||
private PaymentRecordMapper paymentRecordMapper;
|
||||
@ -341,7 +346,7 @@ public class AlipayServiceImpl implements AlipayService {
|
||||
model.setProductCode("PRE_AUTH_ONLINE");
|
||||
|
||||
// 设置业务扩展参数
|
||||
model.setExtraParam("{\"category\": \"CHARGE_PILE_CAR\",\"serviceId\": \""+serviceId+"\"}");
|
||||
model.setExtraParam("{\"category\": \""+rentCategory+"\",\"serviceId\": \""+serviceId+"\"}");
|
||||
|
||||
// 设置免押受理台模式
|
||||
model.setDepositProductMode("DEPOSIT_ONLY");
|
||||
@ -350,7 +355,7 @@ public class AlipayServiceImpl implements AlipayService {
|
||||
|
||||
// 设置异步通知地址
|
||||
request.setNotifyUrl(freezeNotifyUrl);
|
||||
log.info("免押冻结请求 : {}",request);
|
||||
log.info("免押冻结请求 : {}", JSON.toJSONString(request));
|
||||
AlipayFundAuthOrderAppFreezeResponse fundAuthOrderAppFreezeResponse = alipaySdkUtil.sdkExecute(request);
|
||||
log.info("免押冻结响应 : {}",fundAuthOrderAppFreezeResponse.getBody());
|
||||
|
||||
@ -551,9 +556,11 @@ public class AlipayServiceImpl implements AlipayService {
|
||||
|
||||
if(OrderStatus.equals("WAIT_PAY")){
|
||||
orderPayMapper.updateOrderStatus(orderMain.getOrderNo(),"WAIT_PICK");
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY") || OrderStatus.equals("RENT_ING")){
|
||||
OrderSub orderSub = orderPayMapper.getSubOrderByTradeNo(outTradeNo);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),orderSub.getReturnTime(),0,orderMain.getOrderAmount().add(orderSub.getAmount()),"RENT_ING");
|
||||
}else if (OrderStatus.equals("RERENT_WAIT_PAY")){
|
||||
List<OrderSub> orderSub = orderPayMapper.listSubOrderByTradeNo(outTradeNo);
|
||||
OrderSub rentCarSubOrder = orderSub.stream().filter(x -> x.getSuborderType().equals("RENTCAR")).findFirst().orElse( null);
|
||||
BigDecimal rentCarAmount = orderSub.stream().map(OrderSub::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||
orderPayMapper.updateOrderStatusAndEndRentTime(orderMain.getOrderNo(),rentCarSubOrder.getReturnTime(),0,orderMain.getOrderAmount().add(rentCarAmount),"RENT_ING");
|
||||
//发送租电订单同步
|
||||
Long batterySubOrderId = orderPayMapper.getSubOrderIdByTradeNo(outTradeNo);
|
||||
log.info("发送租电订单同步: {}", batterySubOrderId);
|
||||
|
||||
Reference in New Issue
Block a user