|
|
@@ -2,12 +2,27 @@ package cn.com.taiji.managew.manager; |
|
|
|
|
|
|
|
|
|
|
|
import cn.com.taiji.common.manager.ManagerException; |
|
|
|
import cn.com.taiji.common.pub.TimeTools; |
|
|
|
import cn.com.taiji.common.pub.json.JsonTools; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServiceHall; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServiceHallBak; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServicehallLocation; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkServicehallLocationBak; |
|
|
|
import cn.com.taiji.core.entity.dict.issue.OrderPayStatus; |
|
|
|
import cn.com.taiji.core.entity.issue.IssueOrderPay; |
|
|
|
import cn.com.taiji.core.entity.issue.IssueOrderinfo; |
|
|
|
import cn.com.taiji.core.manager.tools.issue.QdCallUtil; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.SignJsonRequest; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ats.model.CallbackModel; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ats.model.PayInfoModelQd; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.AtsQueryPayResultV2Request; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.AtsQueryPayResultV2Response; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallBakRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallLocationBakRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallLocationRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkServicehallRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.issue.IssueOrderPayRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.issue.IssueOrderinfoRepo; |
|
|
|
import cn.com.taiji.managew.Application; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@@ -18,7 +33,9 @@ import cn.com.taiji.managew.repo.jpa.SampleRepo; |
|
|
|
import cn.com.taiji.managew.repo.jpa.request.SamplePageRequest1; |
|
|
|
import cn.com.taiji.managew.repo.jpa.request.SamplePageRequest2; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@SpringBootTest(classes = Application.class) |
|
|
|
public class TestSampleRepo extends AbstractCommManager { |
|
|
@@ -77,20 +94,130 @@ public class TestSampleRepo extends AbstractCommManager { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private QtkServicehallRepo qtkServicehallRepo; |
|
|
|
@Autowired |
|
|
|
private QtkServicehallBakRepo qtkServicehallBakRepo; |
|
|
|
@Autowired |
|
|
|
private QtkServicehallLocationRepo qtkServicehallLocationRepo; |
|
|
|
@Autowired |
|
|
|
private QtkServicehallLocationBakRepo qtkServicehallLocationBakRepo; |
|
|
|
@Test |
|
|
|
public void test(){ |
|
|
|
QtkServiceHall serviceHallId = qtkServicehallRepo.findByServiceHallId("5201010600401140003"); |
|
|
|
System.out.println(serviceHallId.toJson(true)); |
|
|
|
List<QtkServiceHall> all = qtkServicehallRepo.findAll(); |
|
|
|
List<QtkServiceHallBak> collect = all.stream().map(t -> { |
|
|
|
QtkServiceHallBak qtkServiceHallBak = t.copyTo(new QtkServiceHallBak()); |
|
|
|
return qtkServiceHallBak; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
qtkServicehallBakRepo.persistAll(collect); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IssueOrderPayRepo orderPayRepo; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IssueOrderinfoRepo issueOrderinfoRepo; |
|
|
|
@Autowired |
|
|
|
private IssueOrderPayRepo issueOrderPayRepo; |
|
|
|
@Autowired |
|
|
|
private QdCallUtil qdCallUtil; |
|
|
|
|
|
|
|
// 通知渠道 |
|
|
|
@Test |
|
|
|
public void te(){ |
|
|
|
List<IssueOrderPay> pays = orderPayRepo.listByOrderNo("20250701213433520101060047900994"); |
|
|
|
System.out.println(pays.toString()); |
|
|
|
// IssueOrderinfo orderinfo = issueOrderinfoRepo.findByOrderNo("20250818094233520101069987157313"); |
|
|
|
// qdCallUtil.callBackQd(orderinfo, ""); |
|
|
|
// System.out.println("通知结束"); |
|
|
|
|
|
|
|
|
|
|
|
ArrayList<String> strings = new ArrayList<>(); |
|
|
|
strings.add("20250819125314520101069983085312"); |
|
|
|
strings.add("20250819142756520101069982769829"); |
|
|
|
strings.add("20250819145320520101069985333300"); |
|
|
|
strings.add("20250819141020520101069989743065"); |
|
|
|
strings.add("20250819145943520101069987460924"); |
|
|
|
strings.add("20250819131025520101069985825276"); |
|
|
|
strings.add("20250819133204520101069981692823"); |
|
|
|
strings.add("20250819133918520101069981506822"); |
|
|
|
strings.add("20250819101831520101069982651837"); |
|
|
|
strings.add("20250819125139520101069982630176"); |
|
|
|
strings.add("20250819094822520101069985813805"); |
|
|
|
strings.add("20250819131128520101069984913148"); |
|
|
|
strings.add("20250819124434520101069981876895"); |
|
|
|
strings.add("20250819165939520101069982170803"); |
|
|
|
strings.add("20250819151715520101069988732580"); |
|
|
|
strings.add("20250818094233520101069987157313"); |
|
|
|
strings.add("20250819142307520101069982163714"); |
|
|
|
strings.add("20250819163601520101069984329487"); |
|
|
|
strings.add("20250819143812520101069988499158"); |
|
|
|
strings.add("20250819162145520101069985840495"); |
|
|
|
strings.add("20250819183537520101069982772533"); |
|
|
|
strings.add("20250819195705520101069986834491"); |
|
|
|
strings.add("20250819160655520101069981655736"); |
|
|
|
strings.add("20250819131604520101069983525713"); |
|
|
|
strings.add("20250819144920520101069982815124"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<CallbackModel> callbackModels = new ArrayList<>(); |
|
|
|
for (String orrr : strings) { |
|
|
|
IssueOrderinfo order = issueOrderinfoRepo.findByOrderNo(orrr); |
|
|
|
if (order == null) continue; |
|
|
|
List<IssueOrderPay> pays = issueOrderPayRepo.listByOrderNo(orrr); |
|
|
|
CallbackModel callbackModel = new CallbackModel(); |
|
|
|
callbackModel.setOrderNo(order.getOrderNo()) |
|
|
|
.setOrderStep(order.getOrderStep().getCode()) |
|
|
|
.setOrderStatus(order.getOrderStatus().getCode()) |
|
|
|
.setCardId(order.getCardId()) |
|
|
|
.setObuId(order.getObuId()) |
|
|
|
.setPlateNum(order.getVehiclePlate()) |
|
|
|
.setPlateColor(order.getVehiclePlateColor()); |
|
|
|
if (order.getActivationTime() != null){ |
|
|
|
callbackModel.setActiveTime(order.getActivationTime().format(TimeTools.ISO_LOCAL_DATE_TIME)); |
|
|
|
} |
|
|
|
List<OrderPayStatus> list = pays.stream().map(IssueOrderPay::getPayStatus).collect(Collectors.toList()); |
|
|
|
|
|
|
|
if (!isEmpty(pays)) { |
|
|
|
boolean b = list.stream().allMatch(t -> t == OrderPayStatus.SUCCESS); |
|
|
|
if (b) { |
|
|
|
//全部支付成功,返回支付信息 |
|
|
|
List<PayInfoModelQd> payInfoList = pays.stream().map(pay -> { |
|
|
|
PayInfoModelQd payInfoModelQd = new PayInfoModelQd(); |
|
|
|
payInfoModelQd.setPayTime(pay.getPayTime().format(TimeTools.ISO_LOCAL_DATE_TIME)); |
|
|
|
payInfoModelQd.setPayOrderNo(pay.getPayOrderNo()); |
|
|
|
payInfoModelQd.setExternalOrderNo(pay.getExternalOrderNo()); |
|
|
|
payInfoModelQd.setFee(pay.getFee()); |
|
|
|
return payInfoModelQd; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
callbackModel.setPayInfoList(payInfoList); |
|
|
|
} |
|
|
|
} |
|
|
|
callbackModels.add(callbackModel); |
|
|
|
} |
|
|
|
String jsonStr = JsonTools.asJsonStr(callbackModels); |
|
|
|
System.out.println(jsonStr); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testRsssepo() { |
|
|
|
SignJsonRequest signJsonRequest = new SignJsonRequest(); |
|
|
|
signJsonRequest.setAppId("52106998") |
|
|
|
.setIfCode("ISSUES_VALID_VEHICLEPLATECHECK") |
|
|
|
.setReqId("52106998_20250821142606150_22711") |
|
|
|
.setEncryptType("SM4") |
|
|
|
.setSignType("SM3") |
|
|
|
.setTimestamp("2025-08-21T14:26:06") |
|
|
|
.setBizContent("uB1CelotmAARNUDxbe60B7IcVO5+2i6MdCv8QWTGsvEc9O6iGD2qilFWdZf2hzUDS3emZKEmtS3FXCPeQ+P+dW" + |
|
|
|
"YJNv9DRXx5WTkXWDlYcx5f22UBschJ0CyFjncX+HXsN0e80GBUDWzDN6WEgSIvER67e86yutb1pOCBBvwV8xMyM5CqP4RKg9" + |
|
|
|
"dQ9Zq/m2jJee3kIIWFzLj7ZMTK+zHqlRmtAtkm5c/q4755opU/" + |
|
|
|
"Zb6b5b4CxJN60aJfsYLYlWxa0wVRshcyVKfGvH70R/ImSFRCbovjeLmrCWyWEBKRcSM=") |
|
|
|
.setSign(signJsonRequest.toSignContent("T1RnME5qUTJaVE5qT0RRNE5HRXdZVGszTWpOa1kyWTFNRE5pWm1ReU5qQmZNakF5TkRBeE1UVT0=")); |
|
|
|
System.out.println(signJsonRequest.toJson(true)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |