|
@@ -753,7 +753,6 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
|
|
//订单总价(商品的售价总和)
|
|
//订单总价(商品的售价总和)
|
|
|
BigDecimal sumPrice = BigDecimal.ZERO;
|
|
BigDecimal sumPrice = BigDecimal.ZERO;
|
|
|
- ;
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= createOrderForm.getAmount(); i++) {
|
|
for (int i = 1; i <= createOrderForm.getAmount(); i++) {
|
|
|
|
|
|
|
@@ -1121,10 +1120,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
|
|
//构建支付表单返回给前端支撑JsApi支付调用
|
|
//构建支付表单返回给前端支撑JsApi支付调用
|
|
|
UserPayForm payForm = new UserPayForm();
|
|
UserPayForm payForm = new UserPayForm();
|
|
|
- payForm
|
|
|
|
|
- .setOrderId(appOrder.getId())
|
|
|
|
|
- .setOrderCode(orderCode)
|
|
|
|
|
- ;
|
|
|
|
|
|
|
+ payForm.setOrderId(appOrder.getId()).setOrderCode(orderCode);
|
|
|
|
|
|
|
|
//判断是否试听课(试听课不走订单)
|
|
//判断是否试听课(试听课不走订单)
|
|
|
if (ObjectUtil.isNotEmpty(appOrder.getOrderOrFree()) && appOrder.getOrderOrFree() == 1) {
|
|
if (ObjectUtil.isNotEmpty(appOrder.getOrderOrFree()) && appOrder.getOrderOrFree() == 1) {
|
|
@@ -1138,26 +1134,31 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
|
|
|
|
|
//构建微信支付参数
|
|
//构建微信支付参数
|
|
|
JSONObject params = new JSONObject();
|
|
JSONObject params = new JSONObject();
|
|
|
- params.put("appid", WechatConstants.WECHAT_MP_APPID); //小程序appid
|
|
|
|
|
-// params.put("sub_appid", WechatConstants.WECHAT_MP_APPID); //小程序appid
|
|
|
|
|
- params.put("mchid", WechatConstants.WECHAT_MCH_ID); //商户号
|
|
|
|
|
|
|
+ params.put("sp_appid", WechatConstants.WECHAT_SP_APPID); //服务商appid
|
|
|
|
|
+ params.put("sp_mchid", WechatConstants.WECHAT_SP_MCH_ID);//服务商商户号
|
|
|
|
|
+ params.put("sub_appid", WechatConstants.WECHAT_SUB_APPID); //小程序appid
|
|
|
|
|
+ params.put("sub_mchid", WechatConstants.WECHAT_SUB_MCH_ID); //特约商户商户号
|
|
|
|
|
+
|
|
|
params.put("description", "全龄运动"); //商品描述
|
|
params.put("description", "全龄运动"); //商品描述
|
|
|
params.put("out_trade_no", appOrder.getOrderCode()); //商户订单号
|
|
params.put("out_trade_no", appOrder.getOrderCode()); //商户订单号
|
|
|
params.put("time_expire", sdf.format(calendar.getTime())); //交易结束时间 选填 时间到了之后将不能再支付 遵循rfc3339标准格式
|
|
params.put("time_expire", sdf.format(calendar.getTime())); //交易结束时间 选填 时间到了之后将不能再支付 遵循rfc3339标准格式
|
|
|
params.put("attach", appOrder.getOrderCode()); //附加数据 选填
|
|
params.put("attach", appOrder.getOrderCode()); //附加数据 选填
|
|
|
// 在查询API和支付通知中原样返回 可作为自定义参数使用
|
|
// 在查询API和支付通知中原样返回 可作为自定义参数使用
|
|
|
params.put("notify_url", WechatUrlConstants.PAY_V3_NOTIFY); //支付结果异步通知接口
|
|
params.put("notify_url", WechatUrlConstants.PAY_V3_NOTIFY); //支付结果异步通知接口
|
|
|
- params.put("trade_type", WechatConstants.WECHAT_MP_TRADE_TYPE);//JSAPI
|
|
|
|
|
|
|
+ params.put("trade_type", WechatConstants.WECHAT_TRADE_TYPE);//JSAPI
|
|
|
//分账必传参数
|
|
//分账必传参数
|
|
|
JSONObject settleInfo = new JSONObject();
|
|
JSONObject settleInfo = new JSONObject();
|
|
|
settleInfo.put("profit_sharing", Boolean.TRUE);
|
|
settleInfo.put("profit_sharing", Boolean.TRUE);
|
|
|
params.put("settle_info", settleInfo);
|
|
params.put("settle_info", settleInfo);
|
|
|
|
|
+ //电子发票入口
|
|
|
|
|
+ params.put("support_fapiao ", Boolean.TRUE);
|
|
|
|
|
|
|
|
//订单金额信息
|
|
//订单金额信息
|
|
|
JSONObject amount_json = new JSONObject();
|
|
JSONObject amount_json = new JSONObject();
|
|
|
//支付金额 单位:分
|
|
//支付金额 单位:分
|
|
|
|
|
+ //amount_json.put("total", Integer.parseInt(amount_fee(appOrder.getPrice())));
|
|
|
amount_json.put("total", Integer.parseInt(amount_fee(new BigDecimal("0.01"))));//测试0.01元
|
|
amount_json.put("total", Integer.parseInt(amount_fee(new BigDecimal("0.01"))));//测试0.01元
|
|
|
-// amount_json.put("total", Integer.parseInt(amount_fee(appOrder.getPrice())));
|
|
|
|
|
|
|
+ amount_json.put("currency", "CNY");//固定传:CNY,代表人民币
|
|
|
params.put("amount", amount_json);
|
|
params.put("amount", amount_json);
|
|
|
|
|
|
|
|
//支付者信息
|
|
//支付者信息
|
|
@@ -1167,8 +1168,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
params.put("payer", payer);
|
|
params.put("payer", payer);
|
|
|
|
|
|
|
|
//拉起支付-返回JSAPI参数
|
|
//拉起支付-返回JSAPI参数
|
|
|
-// Map<String, String> result = weChatPayService.wechatPay(params);
|
|
|
|
|
-// payForm.setParams(result);
|
|
|
|
|
|
|
+// Map<String, String> result = weChatPayService.wechatPay(params);
|
|
|
|
|
+// payForm.setParams(result);
|
|
|
|
|
|
|
|
//发布任务到redission延迟队列
|
|
//发布任务到redission延迟队列
|
|
|
String task = CommonConstant.ORDER_TIME_OUT_TASK_PREFIX + appOrder.getId();
|
|
String task = CommonConstant.ORDER_TIME_OUT_TASK_PREFIX + appOrder.getId();
|
|
@@ -1374,6 +1375,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderInfoDTO.setSiteName(site.getName());
|
|
appOrderInfoDTO.setSiteName(site.getName());
|
|
|
appOrderInfoDTO.setRunStatus(site.getRunStatus());
|
|
appOrderInfoDTO.setRunStatus(site.getRunStatus());
|
|
|
//退改规则、温馨提示
|
|
//退改规则、温馨提示
|
|
|
|
|
+ appOrderInfoDTO.setRefundType(appSitePlace.getRefundType());
|
|
|
|
|
+ appOrderInfoDTO.setEarlyRefundTime(appSitePlace.getEarlyRefundTime());
|
|
|
appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
appOrderInfoDTO.setReminder(appSitePlace.getReminder());
|
|
|
appOrderInfoDTO.setAdvanceTime(appSitePlace.getAdvanceTime());
|
|
appOrderInfoDTO.setAdvanceTime(appSitePlace.getAdvanceTime());
|
|
|
|
|
|
|
@@ -1427,6 +1430,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
appOrderInfoDTO.setReminder(appGame.getReminder());
|
|
appOrderInfoDTO.setReminder(appGame.getReminder());
|
|
|
//开始时间
|
|
//开始时间
|
|
|
appOrderInfoDTO.setStartTime(appGame.getStartTime());
|
|
appOrderInfoDTO.setStartTime(appGame.getStartTime());
|
|
|
|
|
+ //结束时间
|
|
|
|
|
+ appOrderInfoDTO.setEndTime(appGame.getEndTime());
|
|
|
//赛程安排
|
|
//赛程安排
|
|
|
List<AppGameScheduleVO> appGameScheduleVOList = appGameScheduleMapper.getListVo(appGame.getId());
|
|
List<AppGameScheduleVO> appGameScheduleVOList = appGameScheduleMapper.getListVo(appGame.getId());
|
|
|
appOrderInfoDTO.setAppGameScheduleVOList(appGameScheduleVOList);
|
|
appOrderInfoDTO.setAppGameScheduleVOList(appGameScheduleVOList);
|