|
|
@@ -1,10 +1,7 @@
|
|
|
package com.zsElectric.boot.business.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import cn.hutool.json.JSON;
|
|
|
import com.aliyun.oss.ServiceException;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.google.gson.Gson;
|
|
|
@@ -12,9 +9,9 @@ import com.google.gson.JsonObject;
|
|
|
import com.zsElectric.boot.business.UserRefundsOrderInfo;
|
|
|
import com.zsElectric.boot.business.mapper.*;
|
|
|
import com.zsElectric.boot.business.model.entity.*;
|
|
|
-import com.zsElectric.boot.business.model.form.applet.LevelOrderForm;
|
|
|
-import com.zsElectric.boot.business.model.form.applet.UserPayForm;
|
|
|
-import com.zsElectric.boot.business.model.vo.UserInfoVO;
|
|
|
+import com.zsElectric.boot.business.model.form.applet.AppLevelOrderForm;
|
|
|
+import com.zsElectric.boot.business.model.form.applet.AppUserPayForm;
|
|
|
+import com.zsElectric.boot.business.model.query.applet.AppUserOrderInfoQuery;
|
|
|
import com.zsElectric.boot.business.service.*;
|
|
|
import com.zsElectric.boot.common.constant.SystemConstants;
|
|
|
import com.zsElectric.boot.core.exception.BusinessException;
|
|
|
@@ -24,7 +21,6 @@ import jakarta.servlet.http.HttpServletRequest;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import netscape.javascript.JSObject;
|
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -42,9 +38,7 @@ import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.ThreadLocalRandom;
|
|
|
import java.util.concurrent.locks.ReentrantLock;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.hutool.core.lang.Assert;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
@@ -148,14 +142,28 @@ public class UserOrderInfoServiceImpl extends ServiceImpl<UserOrderInfoMapper, U
|
|
|
return this.removeByIds(idList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IPage<UserOrderInfoVO> getTicketRecords(AppUserOrderInfoQuery queryParams) {
|
|
|
+
|
|
|
+ UserOrderInfoQuery userOrderInfoQuery = new UserOrderInfoQuery();
|
|
|
+ userOrderInfoQuery.setUserId(SecurityUtils.getUserId());
|
|
|
+
|
|
|
+ Page<UserOrderInfoVO> pageVO = this.baseMapper.getUserOrderInfoPage(
|
|
|
+ new Page<>(queryParams.getPageNum(), queryParams.getPageSize()),
|
|
|
+ userOrderInfoQuery
|
|
|
+ );
|
|
|
+ return pageVO;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建订单
|
|
|
*
|
|
|
- * @param levelOrderForm
|
|
|
+ * @param appLevelOrderForm
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public UserPayForm createOrder(LevelOrderForm levelOrderForm) {
|
|
|
+ public AppUserPayForm createOrder(AppLevelOrderForm appLevelOrderForm) {
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
String userOpenId = userInfoMapper.getAppletUserInfo(userId).getOpenid();
|
|
|
String orderNo = createOrderNo("SP", userId);
|
|
|
@@ -163,17 +171,17 @@ public class UserOrderInfoServiceImpl extends ServiceImpl<UserOrderInfoMapper, U
|
|
|
UserOrderInfo orderInfo = new UserOrderInfo();
|
|
|
orderInfo.setUserId(userId);
|
|
|
orderInfo.setOrderNo(orderNo);
|
|
|
- orderInfo.setLevelId(levelOrderForm.getLevelId());
|
|
|
+ orderInfo.setLevelId(appLevelOrderForm.getLevelId());
|
|
|
orderInfo.setOpenid(userOpenId);
|
|
|
|
|
|
this.save(orderInfo);
|
|
|
|
|
|
//构建支付表单返回给前端支撑JsApi支付调用
|
|
|
- UserPayForm payForm = new UserPayForm();
|
|
|
+ AppUserPayForm payForm = new AppUserPayForm();
|
|
|
payForm.setOrderId(orderInfo.getId()).setOrderNo(orderNo);
|
|
|
|
|
|
//查询档位
|
|
|
- RechargeLevel level = rechargeLevelMapper.selectById(levelOrderForm.getLevelId());
|
|
|
+ RechargeLevel level = rechargeLevelMapper.selectById(appLevelOrderForm.getLevelId());
|
|
|
|
|
|
Map<String, Object> result = payment(userOpenId, orderNo, level.getMoney());
|
|
|
payForm.setParams(result);
|
|
|
@@ -187,10 +195,10 @@ public class UserOrderInfoServiceImpl extends ServiceImpl<UserOrderInfoMapper, U
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public UserPayForm payOrder(String orderId) {
|
|
|
+ public AppUserPayForm payOrder(String orderId) {
|
|
|
UserOrderInfo orderInfo = this.getById(orderId);
|
|
|
//构建支付表单
|
|
|
- UserPayForm payForm = new UserPayForm();
|
|
|
+ AppUserPayForm payForm = new AppUserPayForm();
|
|
|
payForm.setOrderId(orderInfo.getId()).setOrderNo(orderInfo.getOrderNo());
|
|
|
|
|
|
//查询档位
|