|
@@ -20,15 +20,11 @@ import com.caimei.util.PayUtils;
|
|
import com.caimei.util.RandomCodeGenerator;
|
|
import com.caimei.util.RandomCodeGenerator;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
-import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import java.io.IOException;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.net.URI;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -356,7 +352,7 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
GregorianCalendar calendar = new GregorianCalendar();
|
|
GregorianCalendar calendar = new GregorianCalendar();
|
|
calendar.setTime(date);
|
|
calendar.setTime(date);
|
|
- calendar.add(Calendar.DATE, 1);
|
|
|
|
|
|
+ calendar.add(Calendar.DATE, 3);
|
|
orderPayLink.setGenerateTime(date);
|
|
orderPayLink.setGenerateTime(date);
|
|
orderPayLink.setEffectiveTime(calendar.getTime());
|
|
orderPayLink.setEffectiveTime(calendar.getTime());
|
|
orderPayLink.setPayStatus("0");
|
|
orderPayLink.setPayStatus("0");
|
|
@@ -372,50 +368,6 @@ public class PayOrderServiceImpl implements PayOrderService {
|
|
return ResponseJson.success(link);
|
|
return ResponseJson.success(link);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void jumpPage(String linkLogo, String linkPage, ServerHttpResponse response) throws IOException {
|
|
|
|
- String linkUrl = linkPage + "?linkLogo=" + linkLogo;
|
|
|
|
- response.setStatusCode(HttpStatus.FOUND);
|
|
|
|
- response.getHeaders().setLocation(URI.create(linkUrl));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public ResponseJson<Map<String, Object>> linkData(String linkLogo) {
|
|
|
|
- Map<String, Object> map = new HashMap<>(3);
|
|
|
|
- OrderPayLinkVo orderPayLink = payOrderMapper.getOrderPayLink(linkLogo);
|
|
|
|
- //链接状态,0成功
|
|
|
|
- int code = 0;
|
|
|
|
- if (null == orderPayLink) {
|
|
|
|
- //已重新生成链接
|
|
|
|
- return ResponseJson.error("链接更新,请重新获取", null);
|
|
|
|
- } else {
|
|
|
|
- OrderVo order = orderMapper.findOrder(orderPayLink.getOrderId().intValue());
|
|
|
|
- List<DiscernReceiptVo> discernReceiptList = payOrderMapper.getDiscernReceipt(order);
|
|
|
|
- if (orderPayLink.getEffectiveTime().compareTo(new Date()) < 0) {
|
|
|
|
- //链接失效
|
|
|
|
- code = -3;
|
|
|
|
- }
|
|
|
|
- if (null != discernReceiptList && discernReceiptList.size() > 0) {
|
|
|
|
- for (DiscernReceiptVo discernReceipt : discernReceiptList) {
|
|
|
|
- if ("2".equals(discernReceipt.getPayWay())) {
|
|
|
|
- // 已线下支付
|
|
|
|
- code = -2;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if ("1".equals(orderPayLink.getPayStatus())) {
|
|
|
|
- //链接已支付
|
|
|
|
- code = 5;
|
|
|
|
- }
|
|
|
|
- SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
- String time = dateFormat.format(orderPayLink.getEffectiveTime());
|
|
|
|
- map.put("orderPayLink", orderPayLink);
|
|
|
|
- map.put("code", code);
|
|
|
|
- map.put("time", time);
|
|
|
|
- }
|
|
|
|
- return ResponseJson.success(map);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public ResponseJson<String> payWhetherSuccess(Integer orderId, Integer paySuccessCounter) {
|
|
public ResponseJson<String> payWhetherSuccess(Integer orderId, Integer paySuccessCounter) {
|
|
OrderVo order = orderMapper.findOrder(orderId);
|
|
OrderVo order = orderMapper.findOrder(orderId);
|