|
@@ -0,0 +1,61 @@
|
|
|
+package com.pj.api.jh.service;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import cn.hutool.log.StaticLog;
|
|
|
+import com.pj.api.wx.bo.Attach;
|
|
|
+import com.pj.project.tb_business.TbBusiness;
|
|
|
+import com.pj.project.tb_business.TbBusinessService;
|
|
|
+import com.pj.project.tb_business_car.TbBusinessCar;
|
|
|
+import com.pj.project.tb_business_car.TbBusinessCarService;
|
|
|
+import com.pj.project.tb_fee_details.TbFeeDetails;
|
|
|
+import com.pj.project.tb_fee_details.TbFeeDetailsService;
|
|
|
+import com.pj.project.tb_order.TbOrder;
|
|
|
+import com.pj.project.tb_order.TbOrderService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+//@Component
|
|
|
+//@Slf4j
|
|
|
+public class TestTask {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private TbBusinessCarService tbBusinessCarService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private TbBusinessService tbBusinessService;
|
|
|
+ @Resource
|
|
|
+ private TbFeeDetailsService tbFeeDetailsService;
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JhService jhService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private TbOrderService tbOrderService;
|
|
|
+
|
|
|
+// @Scheduled(fixedDelay = 20000)
|
|
|
+ public void test() {
|
|
|
+ List<TbOrder> orderList = tbOrderService.list();
|
|
|
+ List<String> bIds = new ArrayList<>();
|
|
|
+ orderList.stream().filter(tbOrder -> !tbOrder.getOrderStatus().equals("SUCCESS")).forEach(tbOrder -> {
|
|
|
+ JSONObject result= jhService.checkPayResult(tbOrder.getOutTradeNo());
|
|
|
+ StaticLog.error("info:{}",JSONUtil.toJsonStr(result));
|
|
|
+ Attach attach = JSONUtil.toBean(tbOrder.getAttach(), Attach.class);
|
|
|
+ StrUtil.splitTrim(attach.getB(), ",").forEach(id -> {
|
|
|
+ if (bIds.contains(id)) {
|
|
|
+ System.out.println(id);
|
|
|
+ }
|
|
|
+ bIds.add(id);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|