Parcourir la source

验证测试

shuiqilin-optimize
JianShengFei il y a 9 mois
Parent
révision
12e2daaec4

+ 0
- 2
src/main/java/com/qtzl/alterSales/dao/repo/jpa/primary/WechatPayApplyResultLogRepo.java Voir le fichier

@@ -82,6 +82,4 @@ public interface WechatPayApplyResultLogRepo extends
WechatPayApplyLogGroupByTimeCountVO countByYearMonth(String datePrefix);




}

+ 8
- 0
src/main/java/com/qtzl/alterSales/dao/repo/jpa/second/AflServerFeeRefundRepo.java Voir le fichier

@@ -38,5 +38,13 @@ public interface AflServerFeeRefundRepo extends AbstractJpaRepo<AflServerFeeRefu
*/
AflServerFeeRefund findByRefundId(String refundId);

/**
* 根据日期查询退款明细
* @param datePrefix 日期前缀
* @return Integer
*/
@Query("select count(1) from AflServerFeeRefund a where a.refundDate like concat(?1, '%') ")
Integer countByRefundDateLike(String datePrefix);


}

+ 24
- 2
src/test/java/ReportTest.java Voir le fichier

@@ -1,7 +1,11 @@
import cn.hutool.json.JSONUtil;
import com.qtzl.alterSales.UserApplication;

import com.qtzl.alterSales.dao.excelVO.head.serviceFee50.ExcelHead50ServiceFeeVO;
import com.qtzl.alterSales.dao.repo.jpa.second.AflServerFeeRefundRepo;
import com.qtzl.alterSales.dao.repo.jpa.third.EtcApplyOrderRepo;
import com.qtzl.alterSales.manager.vo.WechatPayApplyLogGroupByTimeCountVO;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@@ -16,14 +20,32 @@ public class ReportTest {

@Resource
private EtcApplyOrderRepo etcApplyOrderRepo;
@Resource
private AflServerFeeRefundRepo aflServerFeeRefundRepo;

@Test
public void asd1231s() {
public void findByOrderNoInTest() {
List<String> list = List.of("20240612124808520101889303545925");
List<ExcelHead50ServiceFeeVO> excelHead50ServiceFeeVOS = etcApplyOrderRepo.findByOrderNoIn(list);
Assert.assertNotNull(excelHead50ServiceFeeVOS);
}

System.out.println(excelHead50ServiceFeeVOS.size());
@Test
public void countByRefundDateLikeTest() {
Integer i = aflServerFeeRefundRepo.countByRefundDateLike("2024-10");
Assert.assertNotNull(i);
}

/**
* 根据时间统计退款次数测试
* 数据库存储的是 2024-10-23 格式,根据时间模糊查询
*/
@Test
public void aflServerFeeRefundRepo() {
WechatPayApplyLogGroupByTimeCountVO wechatPayApplyLogGroupByTimeCountVO = aflServerFeeRefundRepo.countByYearMonth("2024-10");
System.out.println("wechatPayApplyLogGroupByTimeCountVO:" + JSONUtil.toJsonStr(wechatPayApplyLogGroupByTimeCountVO));
Assert.assertNotNull(wechatPayApplyLogGroupByTimeCountVO);
}


}

Chargement…
Annuler
Enregistrer