|
@@ -29,6 +29,7 @@ import static com.citu.framework.common.pojo.CommonResult.success;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.ENTERPRISE_PACKAGE_NOT_EXISTS;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_REQUEST_ILLEGAL;
|
|
|
import static com.citu.module.menduner.system.enums.TradeOrderTypeMq.PAY_APP_ENTERPRISE_KEY;
|
|
|
+import static com.citu.module.menduner.system.enums.TradeOrderTypeMq.PAY_APP_ENTERPRISE_WX_PROGRAM_KEY;
|
|
|
|
|
|
@Tag(name = "招聘端 - 交易订单")
|
|
|
@RestController
|
|
@@ -75,6 +76,31 @@ public class AppRecruitTradeOrderController {
|
|
|
return success(tradeOrderService.createOrder(dto, PAY_APP_ENTERPRISE_KEY));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/wx-program/create")
|
|
|
+ @Operation(summary = "创建订单")
|
|
|
+ @PreAuthenticated
|
|
|
+ @ApiSignature(timeout = 30)
|
|
|
+ public CommonResult<Long> create2(@RequestBody @Valid AppTradeOrderCreateReqVO reqVO) {
|
|
|
+ TradeOrderCreateReqVO dto = new TradeOrderCreateReqVO();
|
|
|
+ dto.setUserType(String.valueOf(MdeUserTypeEnum.ENTERPRISE_USER.getType()));
|
|
|
+ dto.setEnterpriseId(LoginUserContext.getEnterpriseId());
|
|
|
+ dto.setUserId(LoginUserContext.getUserId());
|
|
|
+ dto.setType(reqVO.getType());
|
|
|
+ dto.setSpuId(reqVO.getSpuId());
|
|
|
+ dto.setPrice(reqVO.getPrice());
|
|
|
+ dto.setSpuName(reqVO.getSpuName());
|
|
|
+ if (TradeOrderTypeEnum.ENTERPRISE_USER_MEMBER.getType().equals(dto.getType())) {
|
|
|
+ EnterprisePackageDO packageDO = enterprisePackageService.getEnterprisePackage(reqVO.getSpuId());
|
|
|
+ if (null == packageDO) {
|
|
|
+ throw exception(ENTERPRISE_PACKAGE_NOT_EXISTS);
|
|
|
+ }
|
|
|
+ if (null == reqVO.getPrice() || !reqVO.getPrice().equals(packageDO.getPrice())) {
|
|
|
+ throw exception(MDE_REQUEST_ILLEGAL);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return success(tradeOrderService.createOrder(dto, PAY_APP_ENTERPRISE_WX_PROGRAM_KEY));
|
|
|
+ }
|
|
|
+
|
|
|
@GetMapping("/get/unpaid")
|
|
|
@Operation(summary = "获取待支付的订单")
|
|
|
@PreAuthenticated
|