update 校验支付单

This commit is contained in:
2023-10-24 13:14:33 +08:00
parent 15ae09fcad
commit 7dabdf73ec
3 changed files with 58 additions and 0 deletions

View File

@@ -452,4 +452,20 @@ public class TempController extends BaseController {
}
return response;
}
/**
* 根据时间范围查询支付对象列表,并查询分账情况
*/
@PostMapping("/checkPayment")
public RestApiResponse<?> checkPayment(@RequestBody QueryOrderDTO dto) {
RestApiResponse<?> response;
try {
tempService.checkPayment(dto);
response = new RestApiResponse<>();
} catch (Exception e) {
logger.error("校验未分账的支付单error", e);
response = new RestApiResponse<>();
}
return response;
}
}

View File

@@ -6,6 +6,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.huifu.adapay.model.Payment;
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
import com.jsowell.adapay.response.PaymentConfirmResponse;
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
@@ -14,6 +15,7 @@ import com.jsowell.adapay.vo.OrderSettleResult;
import com.jsowell.adapay.vo.PaymentInfo;
import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.*;
import com.jsowell.pile.dto.ApplyRefundDTO;
@@ -493,7 +495,30 @@ public class TempService {
logger.info("校验未分账的支付单-支付id:{}, 执行分账结果:{}", paymentId, JSON.toJSONString(paymentConfirmRequest));
}
}
}
/**
* 检查支付单
* @param dto
*/
public void checkPayment(QueryOrderDTO dto) throws BaseAdaPayException {
String wechatAppId = "wxbb3e0d474569481d";
String appId = "app_d0c80cb1-ffc8-48cb-a030-fe9bec823aaa";
long begin = DateUtils.dateStrToTimestamp(dto.getStartTime()); // 13位时间戳
long end = DateUtils.dateStrToTimestamp(dto.getEndTime()); // 13位时间戳
// 根据时间段查询支付对象列表
Map<String, Object> queryListParam = Maps.newHashMap();
queryListParam.put("app_id", appId);
queryListParam.put("page_index", "1");
queryListParam.put("page_size", "20");
queryListParam.put("created_gte", begin);
queryListParam.put("created_lte", end);
System.out.println("查询支付对象列表请求参数:" + JSON.toJSONString(queryListParam));
Map<String, Object> paymentListResult = Payment.queryList(queryListParam, wechatAppId);
System.out.println("查询支付对象列表result" + JSON.toJSONString(paymentListResult));
// 查询退款信息
// 查询分账信息
}
}

View File

@@ -71,6 +71,7 @@ import com.jsowell.pile.vo.web.PileDetailVO;
import com.jsowell.service.MemberService;
import com.jsowell.service.OrderService;
import com.jsowell.service.PileService;
import com.jsowell.service.TempService;
import com.jsowell.thirdparty.amap.service.AMapService;
import com.jsowell.thirdparty.lianlian.dto.CommonParamsDTO;
import com.jsowell.thirdparty.lianlian.service.LianLianService;
@@ -230,6 +231,22 @@ public class SpringBootTestController {
@Autowired
private OrderPayRecordService orderPayRecordService;
@Autowired
private TempService tempService;
@Test
public void checkPaymentTest() {
QueryOrderDTO dto = new QueryOrderDTO();
dto.setStartTime("2023-07-01 00:00:00");
dto.setEndTime("2023-07-01 23:59:59");
try {
tempService.checkPayment(dto);
} catch (BaseAdaPayException e) {
throw new RuntimeException(e);
}
}
@Test
public void toStringTest() {
String jsonString = "{\"business\":\"00\",\"communicationVersion\":\"v1.5\",\"connectorNum\":\"01\",\"iccid\":\"89860620180085681816\",\"internetConnection\":\"00\",\"pileSn\":\"88230000000259\",\"pileType\":\"01\",\"programVersion\":\"gyk-V29\\u0000\"}";