Commit 2e8088f6 by gonglei

加入框架代码

1 parent 53b6e965
......@@ -8,16 +8,19 @@ import com.glsx.usedcar.export.converter.AccountTypeConverter;
import com.glsx.usedcar.export.converter.BooleanConverter;
import com.glsx.usedcar.export.converter.CertifiedStateConverter;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.account.entity.AccountTag;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import org.summerframework.orm.validator.CreateValidGroup;
import org.summerframework.orm.validator.UpdateValidGroup;
import org.summerframework.storage.converter.FileInfoConverter;
import org.summerframework.storage.domain.FileInfo;
import java.time.LocalDateTime;
import java.util.List;
import static jakarta.persistence.GenerationType.IDENTITY;
......@@ -87,8 +90,13 @@ public class AccountBean {
@ExcelProperty(value = "账户类型", converter = AccountTypeConverter.class)
@ColumnWidth(15)
private Account.AccountType accountType;
@ExcelProperty("用户标签")
@ColumnWidth(30)
private String tags;
public AccountBean(Account account) {
this.accountId = account.getAccountId();
this.accountName = account.getAccountName();
......@@ -105,6 +113,10 @@ public class AccountBean {
this.bankMobile = account.getBankMobile();
this.accountType = account.getAccountType();
this.frozenDeposit = account.getFrozenDeposit();
if (!CollectionUtils.isEmpty(account.getAccountTags())) {
List<String> list = account.getAccountTags().stream().map(AccountTag::getTagName).toList();
tags = String.join("、", list);
}
}
......
......@@ -296,6 +296,7 @@ public class AccountController {
@PostMapping("exportAccount")
public void exportAccount(@RequestBody Pagination<Account> pagination, HttpServletResponse response) throws IOException {
pagination.setLimit(9999);
pagination.addFetch(root -> root.fetch(Account_.accountTags, JoinType.LEFT));
List<Account> vehicles = pageAccount(pagination).getContent();
List<AccountBean> vehicleBeans = vehicles.stream().map(AccountBean::new).toList();
ExcelExporter.exportExcel(response, "用户列表", "用户列表", AccountBean.class, vehicleBeans);
......
......@@ -68,9 +68,9 @@ spring:
data:
redis:
database: 6
host: localhost
host: 192.168.0.20
port: 6379
password:
password: Ml1234..
# 连接超时时间 单位 ms(毫秒)
timeout: 3000ms
jedis:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!