提交 32795867 authored 作者: jiangwujie's avatar jiangwujie

Merge branch 'v20.9_settlement_20240805' into test

......@@ -1296,7 +1296,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Override
public SXSSFWorkbook exportPrepaidFreightList(PageOwnerAccountListParam param) {
param.setPage(1);
param.setPageSize(1000000);
IPage<OwnerAccountVO> page = ownerAccountDao.pageList(param);
List<OwnerAccountVO> list = page.getRecords();
......@@ -1306,7 +1307,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
fieldList.add(new ExcelField(1, "货主名称", "ownerUserNo", 5000));
fieldList.add(new ExcelField(2, "联系电话", "ownerName", 5000));
fieldList.add(new ExcelField(3, "账户类型", "mobile", 5000));
fieldList.add(new ExcelField(4, "账户余额", "accountType", 15000));
fieldList.add(new ExcelField(4, "账户余额", "accountType", 5000));
fieldList.add(new ExcelField(5, "可用余额", "runningWaterType", 5000));
fieldList.add(new ExcelField(6, "冻结余额", "orderNo", 5000));
fieldList.add(new ExcelField(7, "创建人", "alterationBalance", 5000));
......
......@@ -92,8 +92,6 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS
@Autowired
private FileUploadFeign fileUploadFeign;
@Override
public Integer saveSettlementDetail(OrderChild orderChild, OrderGoods orderGoods, SettlementDriverDetail settlementDriverDetail) {
......
package com.clx.performance;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.clx.performance.dao.OwnerAccountDao;
import com.clx.performance.param.pc.PageOwnerAccountListParam;
import com.clx.performance.service.impl.OwnerAccountServiceImpl;
import com.clx.performance.vo.pc.OwnerAccountVO;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class OwnerAccountServiceImplTest {
@Mock
private OwnerAccountDao ownerAccountDao;
@InjectMocks
private OwnerAccountServiceImpl ownerAccountService;
private PageOwnerAccountListParam param;
@Before
public void setUp() {
param = new PageOwnerAccountListParam();
// Assuming there's a default page size set in PageOwnerAccountListParam
param.setPageSize(10);
param.setPage(1);
}
@Test
public void testExportPrepaidFreightList() throws IOException {
List<OwnerAccountVO> records = new ArrayList<>();
OwnerAccountVO accountVO = new OwnerAccountVO();
accountVO.setId(18);
accountVO.setOwnerUserNo("188888");
accountVO.setOwnerUserName("owner88");
accountVO.setMobile("18888888888");
accountVO.setAccountType(1);
accountVO.setAccountBalance(new BigDecimal("8888.88"));
accountVO.setUsableBalance(new BigDecimal("8888.88"));
accountVO.setFrozenBalance(new BigDecimal("8888.88"));
accountVO.setCreateBy("domino.j");
accountVO.setCreateTime("2024-08-07 14:15:18");
accountVO.setModifiedTime("2024-08-07 14:15:18");
records.add(accountVO);
PageDTO page = new PageDTO(1, 10000);
page.setRecords(records);
// Mock the behavior of the ownerAccountDao
when(ownerAccountDao.pageList(param)).thenReturn(page);
// Perform the test
SXSSFWorkbook workbook = ownerAccountService.exportPrepaidFreightList(param);
workbook.write(new java.io.FileOutputStream("ccc.xlsx"));
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论