|
@@ -7,6 +7,7 @@ import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
@@ -1536,6 +1537,29 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
return "SUCCESS";
|
|
return "SUCCESS";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void synchronizePayStatus() {
|
|
|
|
|
+ FsStorePayment queryParam = new FsStorePayment();
|
|
|
|
|
+ queryParam.setStatus(0);//未支付
|
|
|
|
|
+ queryParam.setBeginTime(DateUtils.addDateDays(-1));
|
|
|
|
|
+ queryParam.setEndTime(DateUtils.getNowDate().toString());
|
|
|
|
|
+ List<FsStorePayment> list = selectFsStorePaymentList(queryParam);
|
|
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
|
|
+ List<CompletableFuture<Void>> futures = new ArrayList<>();
|
|
|
|
|
+ for (FsStorePayment fsStorePayment : list) {
|
|
|
|
|
+ if (fsStorePayment.getPayCode().equals("1974233163920048128")){
|
|
|
|
|
+ System.out.println(fsStorePayment.getPayCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
|
|
|
|
|
+ updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId());
|
|
|
|
|
+ logger.info("定时任务:同步支付状态,payment_id:{}",fsStorePayment.getPaymentId());
|
|
|
|
|
+ });
|
|
|
|
|
+ futures.add(future);
|
|
|
|
|
+ }
|
|
|
|
|
+ CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public R paymentByWxaCode(FsStorePaymentPayParam param) {
|
|
public R paymentByWxaCode(FsStorePaymentPayParam param) {
|
|
|
FsUser user = userMapper.selectFsUserById(param.getUserId());
|
|
FsUser user = userMapper.selectFsUserById(param.getUserId());
|