Browse Source

教材管理员确认领取全校教材

大数据与最优化研究所 5 tháng trước cách đây
mục cha
commit
f978d74609

+ 57 - 8
src/main/java/com/xjrsoft/module/textbook/controller/TextbookStudentClaimController.java

@@ -15,6 +15,7 @@ import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseCourseSubject;
+import com.xjrsoft.module.base.entity.BaseSemester;
 import com.xjrsoft.module.base.entity.CourseSubjectDetail;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
@@ -26,6 +27,7 @@ import com.xjrsoft.module.textbook.vo.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.*;
 
@@ -80,6 +82,53 @@ public class TextbookStudentClaimController {
         return RT.ok(baseClasses);
     }
 
+    @GetMapping(value = "/all-detail-semester-list")
+    @ApiOperation(value = "全校学生教材领取情况学期列表")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    @XjrLog(value = "全校学生教材领取情况学期列表")
+    public RT<List<Semester2AllDetailListVo>> semester2AllDetailList() {
+        MPJLambdaWrapper<TextbookStudentClaim> textbookStudentClaimMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        textbookStudentClaimMPJLambdaWrapper
+                .selectAs(TextbookStudentClaim::getBaseSemesterId, Semester2AllDetailListVo::getBaseSemesterId)
+                .innerJoin(BaseSemester.class, BaseSemester::getId, TextbookStudentClaim::getBaseSemesterId,
+                    wrapper -> wrapper
+                            .selectAs(BaseSemester::getName, Semester2AllDetailListVo::getBaseSemesterIdCn)
+                )
+        ;
+
+        List<Semester2AllDetailListVo> baseSemester = textbookStudentClaimService.selectJoinList(Semester2AllDetailListVo.class, textbookStudentClaimMPJLambdaWrapper);
+        return RT.ok(baseSemester);
+    }
+
+    @GetMapping(value = "/all-detail-class-list")
+    @ApiOperation(value = "全校学生教材领取情况班级列表")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    @XjrLog(value = "全校学生教材领取情况班级列表")
+    public RT<List<Class2AllDetailListVo>> class2AllDetailList(@Valid Class2AllDetailListDto dto) {
+        MPJLambdaWrapper<TextbookStudentClaim> textbookStudentClaimMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        textbookStudentClaimMPJLambdaWrapper
+                .selectAs(TextbookStudentClaim::getClassId, Class2AllDetailListVo::getBaseClassId)
+                .innerJoin(BaseClass.class, BaseClass::getId, TextbookStudentClaim::getBaseSemesterId,
+                        wrapper -> wrapper
+                                .selectAs(BaseClass::getName, Class2AllDetailListVo::getBaseClassIdCn)
+                )
+                .eq(ObjectUtils.isNotEmpty(dto.getBaseSemesterId()), TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
+        ;
+
+        List<Class2AllDetailListVo> baseClass = textbookStudentClaimService.selectJoinList(Class2AllDetailListVo.class, textbookStudentClaimMPJLambdaWrapper);
+        return RT.ok(baseClass);
+    }
+
+    @GetMapping(value = "/all-detail-page")
+    @ApiOperation(value = "全校学生教材领取情况列表(分页)")
+    @SaCheckPermission("textbookstudentclaim:detail")
+    @XjrLog(value = "全校学生教材领取情况列表(分页)")
+    public RT<PageOutput<AllDetailPageVo>> AllDetailPage(@Valid AllDetailPageDto dto) {
+        IPage<AllDetailPageVo> page = textbookStudentClaimService.allDetailPage(dto);
+        PageOutput<AllDetailPageVo> pageOutput = ConventPage.getPageOutput(page, AllDetailPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
     @GetMapping(value = "/head-tea-look-class-book")
     @ApiOperation(value = "班主任查看班级教材页面")
     @SaCheckPermission("textbookstudentclaim:detail")
@@ -250,15 +299,15 @@ public class TextbookStudentClaimController {
         return RT.ok(textbookStudentClaimService.removeBatchByIds(ids));
     }
 
-    @PostMapping("/all-stu-claim-export-query")
-    @ApiOperation(value = "某一学期全校学生领取记录条件导出")
-    @XjrLog(value = "某一学期全校学生领取记录条件导出")
-    public ResponseEntity<byte[]> allStuClaimExportQuery(@Valid @RequestBody AllStuClaimExportQueryDto dto) throws IOException {
-//    @GetMapping("/all-stu-claim-export-query")
-//    @ApiOperation(value = "全校学生领取记录条件导出")
-//    public ResponseEntity<byte[]> allStuClaimExportQuery(@Valid AllStuClaimExportQueryDto dto) throws IOException {
+//    @PostMapping("/all-stu-claim-export-query")
+//    @ApiOperation(value = "某一学期全校学生领取记录条件导出")
+//    @XjrLog(value = "某一学期全校学生领取记录条件导出")
+//    public ResponseEntity<byte[]> allStuClaimExportQuery(@Valid @RequestBody AllStuClaimExportQueryDto dto) throws IOException {
+    @GetMapping("/all-stu-claim-export-query")
+    @ApiOperation(value = "全校学生领取记录条件导出")
+    public ResponseEntity<byte[]> allStuClaimExportQuery(@Valid AllStuClaimExportQueryDto dto) throws IOException {
         ByteArrayOutputStream bot = textbookStudentClaimService.allStuClaimExportQuery(dto);
-        String fileName = "某一学期全校学生领取记录条件导出";
+        String fileName = "学生领取记录条件导出";
         fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8);
         return RT.fileStream(bot.toByteArray(), fileName + ExcelTypeEnum.XLSX.getValue());
     }

+ 10 - 1
src/main/java/com/xjrsoft/module/textbook/service/ITextbookStudentClaimService.java

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -35,6 +36,14 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
      */
     IPage<HeadTeaLookClassBookSemesterVo> headTeaLookClassBookSemester(HeadTeaLookClassBookSemesterDto dto);
 
+    /**
+     * 全校学生教材领取情况列表(分页)
+     *
+     * @param
+     * @return
+     */
+    IPage<AllDetailPageVo> allDetailPage(AllDetailPageDto dto);
+
     /**
      * 获取页面
      *
@@ -104,5 +113,5 @@ public interface ITextbookStudentClaimService extends MPJBaseService<TextbookStu
      * @param dto
      * @return
      */
-    ByteArrayOutputStream allStuClaimExportQuery(AllStuClaimExportQueryDto dto) ;
+    ByteArrayOutputStream allStuClaimExportQuery(AllStuClaimExportQueryDto dto) throws IOException;
 }

+ 181 - 7
src/main/java/com/xjrsoft/module/textbook/service/impl/TextbookStudentClaimServiceImpl.java

@@ -23,9 +23,11 @@ import com.xjrsoft.module.base.mapper.BaseClassCourseMapper;
 import com.xjrsoft.module.base.mapper.BaseSemesterMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
 import com.xjrsoft.module.base.service.IBaseSemesterService;
+import com.xjrsoft.module.generator.entity.ImportConfig;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
+import com.xjrsoft.module.student.vo.BaseClassMajorSetVo;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.teacher.entity.XjrUser;
 import com.xjrsoft.module.teacher.mapper.XjrUserMapper;
@@ -37,19 +39,27 @@ import com.xjrsoft.module.textbook.mapper.WfTextbookClaimItemMapper;
 import com.xjrsoft.module.textbook.mapper.WfTextbookClaimMapper;
 import com.xjrsoft.module.textbook.service.ITextbookStudentClaimService;
 import com.xjrsoft.module.textbook.vo.*;
+import com.xjrsoft.module.veb.util.ImportExcelUtil;
 import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.camunda.bpm.engine.history.HistoricProcessInstance;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -64,12 +74,8 @@ import java.util.stream.Stream;
 @AllArgsConstructor
 public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<TextbookStudentClaimMapper, TextbookStudentClaim> implements ITextbookStudentClaimService {
 
-    private final XjrUserMapper xjrUserMapper;
-
     private final TextbookStudentClaimMapper textbookStudentClaimMapper;
 
-    private final IBaseSemesterService baseSemesterService;
-
     private final IBaseClassService baseClassService;
 
     private final BaseClassAdminCourseMapper baseClassAdminCourseMapper;
@@ -203,6 +209,12 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         return baseClassAdminCourseMapper.selectJoinPage(ConventPage.getPage(dto), HeadTeaLookClassBookSemesterVo.class, baseClassAdminCourseMPJLambdaWrapper);
     }
 
+    @Override
+    public IPage<AllDetailPageVo> allDetailPage(AllDetailPageDto dto) {
+
+        return null;
+    }
+
     @Override
     public TextbookClaimStudentConfirmVo getStudentConfirmList(TextbookClaimStudentConfirmDto dto) {
         // 获取学期
@@ -1276,7 +1288,7 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
     }
 
     @Override
-    public ByteArrayOutputStream allStuClaimExportQuery(AllStuClaimExportQueryDto dto) {
+    public ByteArrayOutputStream allStuClaimExportQuery(AllStuClaimExportQueryDto dto) throws IOException {
         if(StringUtils.isEmpty(dto.getBaseSemesterId())){
             throw new MyException("请选择学期");
         }
@@ -1288,9 +1300,171 @@ public class TextbookStudentClaimServiceImpl extends MPJBaseServiceImpl<Textbook
         }
 
         // 获取所有学生信息
-//        AllStuClaimExportQueryVo
+        MPJLambdaWrapper<TextbookStudentClaim> textbookStudentClaimMPJLambdaWrapper = new MPJLambdaWrapper<>();
+        textbookStudentClaimMPJLambdaWrapper
+                .select(TextbookStudentClaim.class, x -> VoToColumnUtil.fieldsToColumns(AllStuClaimExportQueryVo.class).contains(x.getProperty()))
+                .leftJoin(BaseClass.class, BaseClass::getId, TextbookStudentClaim::getClassId,
+                        wrapper -> wrapper
+                                .selectAs(BaseClass::getName, AllStuClaimExportQueryVo::getClassIdCn)
+                )
+                .leftJoin(XjrUser.class, XjrUser::getId, TextbookStudentClaim::getStudentUserId,
+                        wrapper -> wrapper
+                                .selectAs(XjrUser::getName, AllStuClaimExportQueryVo::getStudentUserIdCn)
+                )
+                .leftJoin(Textbook.class, Textbook::getId, TextbookStudentClaim::getTextbookId,
+                        wrapper -> wrapper
+                                .selectAs(Textbook::getBookName, AllStuClaimExportQueryVo::getTextbookIdCn)
+                )
+                .eq(ObjectUtils.isNotEmpty(dto.getClassId()), TextbookStudentClaim::getBaseSemesterId, dto.getBaseSemesterId())
+                .eq(ObjectUtils.isNotEmpty(dto.getClassId()), TextbookStudentClaim::getClassId, dto.getClassId())
+                .eq(ObjectUtils.isNotEmpty(dto.getUserId()), TextbookStudentClaim::getStudentUserId, dto.getUserId())
+        ;
 
+        List<AllStuClaimExportQueryVo> allStuClaimExportQueryVos = this.selectJoinList(AllStuClaimExportQueryVo.class, textbookStudentClaimMPJLambdaWrapper);
 
-        return null;
+        if(CollectionUtils.isEmpty(allStuClaimExportQueryVos)){
+            throw new MyException("当前搜索条件没有领取确认数据。");
+        }
+
+        // 处理特殊字符
+        for (AllStuClaimExportQueryVo vo : allStuClaimExportQueryVos) {
+
+            if (ObjectUtils.isNotEmpty(vo.getPrice())) {
+                vo.setPriceStr(vo.getPrice().stripTrailingZeros().toPlainString());
+            }
+
+            if (ObjectUtils.isNotEmpty(vo.getIsClaim())) {
+                if (vo.getIsClaim() == 0) {
+                    vo.setIsClaimStr("未领取");
+                }
+                if (vo.getIsClaim() == 1) {
+                    vo.setIsClaimStr("已领取");
+                }
+                if (vo.getIsClaim() == 2) {
+                    vo.setIsClaimStr("退书");
+                }
+            }
+
+            if (ObjectUtils.isNotEmpty(vo.getClaimSource())) {
+                if (vo.getClaimSource() == 1) {
+                    vo.setClaimSourceStr("学生申领");
+                }
+                if (vo.getClaimSource() == 2) {
+                    vo.setClaimSourceStr("班级申领");
+                }
+            }
+        }
+
+        // 开始分组,现根据班级分组,再根据学生分组
+        Map<Long, Map<Long, List<AllStuClaimExportQueryVo>>> groupByClassIsByStuId =
+                Optional.of(allStuClaimExportQueryVos)
+                        .orElse(Collections.emptyList())
+                        .stream()
+                        .filter(Objects::nonNull) // 过滤掉元素本身为null的情况
+                        .filter(vo -> vo.getClassId() != null)
+                        .filter(vo -> vo.getStudentUserId() != null)
+                        .collect(Collectors.groupingBy(
+                                AllStuClaimExportQueryVo::getClassId,
+                                Collectors.groupingBy(AllStuClaimExportQueryVo::getStudentUserId)
+                        ));
+
+        // 开始写入
+        Workbook workbook = new XSSFWorkbook();
+        // 创建一个工作表(sheet)
+        String sheetName = "sheet1";
+        Sheet sheet = workbook.createSheet(sheetName);
+
+        // 出参vo字段数量
+        AllStuClaimExportQueryVo obj = new AllStuClaimExportQueryVo();
+        List<ImportConfig> importConfigs = ImportExcelUtil.allFields(obj);
+
+        // 写大标题
+        int rowNumber = 0;
+        ImportExcelUtil.createBigHead(workbook, sheet, baseSemester.getName() + "教材领取确认情况", rowNumber++, importConfigs.size() - 1);
+
+        // 表头
+        ImportExcelUtil.createHead(workbook, sheet, importConfigs, IndexedColors.YELLOW.getIndex(), IndexedColors.RED.getIndex(), rowNumber++);
+
+        // 字体内容格式
+        Font font = workbook.createFont();
+        font.setBold(false);// 设置为粗体
+        font.setFontName("宋体");
+        font.setFontHeightInPoints((short) 12);
+
+        // 单元格样式
+        CellStyle cellStyle = workbook.createCellStyle();
+        cellStyle.setFont(font); // 将字体应用到样式
+        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        cellStyle.setAlignment(HorizontalAlignment.CENTER);
+
+        // 设置边框样式为细线
+        cellStyle.setBorderTop(BorderStyle.THIN);
+        cellStyle.setTopBorderColor(IndexedColors.BLACK.getIndex()); // 设置顶部边框颜色
+
+        cellStyle.setBorderBottom(BorderStyle.THIN);
+        cellStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex()); // 设置底部边框颜色
+
+        cellStyle.setBorderLeft(BorderStyle.THIN);
+        cellStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex()); // 设置左边框颜色
+
+        cellStyle.setBorderRight(BorderStyle.THIN);
+        cellStyle.setRightBorderColor(IndexedColors.BLACK.getIndex()); // 设置右边框颜色
+
+        // 记录写入
+        List<String> stuVo;
+        // 处理特殊字符
+        for (Map.Entry<Long, Map<Long, List<AllStuClaimExportQueryVo>>>  entryByClassId : groupByClassIsByStuId.entrySet()) {
+            Long classId = entryByClassId.getKey();
+            Map<Long, List<AllStuClaimExportQueryVo>> groupByStu = entryByClassId.getValue();
+
+            int mergeClass = 0;
+            for (Map.Entry<Long, List<AllStuClaimExportQueryVo>> entryByStuId : groupByStu.entrySet()) {
+                Long sruId = entryByStuId.getKey();
+                List<AllStuClaimExportQueryVo> vos = entryByStuId.getValue();
+
+                int mergeStu = 0;
+                for (AllStuClaimExportQueryVo vo : vos) {
+                    stuVo = new ArrayList<>();
+                    stuVo.add(vo.getClassIdCn());
+                    stuVo.add(vo.getStudentUserIdCn());
+                    stuVo.add(vo.getTextbookIdCn());
+                    stuVo.add(vo.getPriceStr());
+                    stuVo.add(vo.getIsClaimStr());
+                    stuVo.add(vo.getClaimSourceStr());
+
+                    Row dataRow = sheet.createRow(rowNumber++);
+                    for (int j = 0; j < stuVo.size(); j++) {
+                        String content = stuVo.get(j);
+                        Cell cell = dataRow.createCell(j);
+                        cell.setCellValue(content);
+                        cell.setCellStyle(cellStyle);
+                    }
+                    mergeStu++;
+                    mergeClass++;
+                }
+
+                // 合并申领项
+                if (mergeStu > 1) {
+                    sheet.addMergedRegion(new CellRangeAddress(rowNumber - mergeStu, rowNumber - 1, 1, 1));
+                }
+            }
+
+            if (mergeClass > 1) {
+                sheet.addMergedRegion(new CellRangeAddress(rowNumber - mergeClass, rowNumber - 1, 0, 0));
+            }
+        }
+
+        // 自动列宽s
+        for (int i = 0; i < importConfigs.size(); i++) {
+            if(importConfigs.get(i).getWidth() != 0){
+                sheet.setColumnWidth(i, importConfigs.get(i).getWidth());
+            }else {
+                sheet.autoSizeColumn(i);
+            }
+        }
+
+        ByteArrayOutputStream bot = new ByteArrayOutputStream();
+        workbook.write(bot);
+        return bot;
     }
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/textbook/service/impl/WfTextbookClaimServiceImpl.java

@@ -1353,7 +1353,6 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
             if (MapUtils.isNotEmpty(itemMap) && CollectionUtils.isNotEmpty(itemMap.get(claimId))) {
                 List<WfTextbookClaimItemVo> items = itemMap.get(claimId);
                 for (WfTextbookClaimItemVo item : items) {
-                    mergeClaim++;
                     claimItemVo = new ArrayList<>(claimVo);
                     claimItemVo.add(item.getTextbookIdCN());
                     claimItemVo.add(item.getIssn());
@@ -1365,6 +1364,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
                         List<DistributeRecordVo> issues = recordMap.get(item.getId());
                         for (DistributeRecordVo issue : issues) {
                             mergeClaimItem++;
+                            mergeClaim++;
                             claimItemIssueVo = new ArrayList<>(claimItemVo);
                             LocalDateTime localDateTime = issue.getIssueDate().toInstant()
                                     .atZone(ZoneId.systemDefault())
@@ -1389,6 +1389,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
                             }
                         }
                     } else {
+                        mergeClaim++;
                         Row dataRow = sheet.createRow(rowNumber++);
                         for (int j = 0; j < claimItemVo.size(); j++) {
                             String content = claimItemVo.get(j);

+ 37 - 63
src/main/java/com/xjrsoft/module/textbook/vo/AllStuClaimExportQueryVo.java

@@ -3,98 +3,72 @@ package com.xjrsoft.module.textbook.vo;
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.xjrsoft.common.annotation.FiledWidth;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 public class AllStuClaimExportQueryVo {
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("学期")
-    @ApiModelProperty("学期ID(base_semester)")
-    private String baseSemesterIdCn;
-
-    @ContentStyle(dataFormat = 49)
-    @ExcelIgnore
-    @ApiModelProperty("申领类型(xjr_dictionary_item[claim_type])")
-    private String claimType;
-
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("申领类型")
-    @ApiModelProperty("申领类型(xjr_dictionary_item[claim_type])")
-    private String claimTypeCn;
-
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("领取人")
-    @ApiModelProperty("领取人")
-    private String receiver;
-
     @ContentStyle(dataFormat = 49)
     @ExcelIgnore
-    @ApiModelProperty("申请人")
-    private String applicantUserIdCn;
+    @ApiModelProperty("班级ID")
+    private Long classId;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("班级名称")
-    @ApiModelProperty("班级名称")
+    @ExcelProperty("班级")
+    @ApiModelProperty("班级")
+    @FiledWidth(255 * 16)
     private String classIdCn;
 
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("申请数量")
-    @ApiModelProperty("申请总数量")
-    private Integer applicantTatolNumber;
-
     @ContentStyle(dataFormat = 49)
     @ExcelIgnore
-    @ApiModelProperty("状态()")
-    private Integer status;
-
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("发放状态")
-    @ApiModelProperty("状态()")
-    private String statusStr;
+    @ApiModelProperty("学生ID")
+    private Long studentUserId;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("发放数量")
-    @ApiModelProperty("已经发放总数量")
-    private Integer issueTatolNumber;
+    @ExcelProperty("学生姓名")
+    @ApiModelProperty("学生姓名")
+    private String studentUserIdCn;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("教材名称")
-    @ApiModelProperty("教材名称")
-    private String textbookIdCN;
+    @ExcelIgnore
+    @ApiModelProperty("教材ID")
+    private Long textbookId;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("国际标准刊号")
-    @ApiModelProperty("国际标准刊号")
-    private String issn;
+    @ExcelProperty("教材")
+    @ApiModelProperty("教材")
+    private String textbookIdCn;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("申请数量")
-    @ApiModelProperty("申请数量")
-    private Integer applicantNumber;
+    @ExcelIgnore
+    @ApiModelProperty("教材确认领取的价格")
+    private BigDecimal price;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("已发放数量")
-    @ApiModelProperty("已发放数量")
-    private Integer issueNumber;
+    @ExcelProperty("教材价格")
+    @ApiModelProperty("教材价格")
+    private String priceStr;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("出库时间")
-    @ApiModelProperty("出库时间")
-    private String issueDate;
+    @ExcelIgnore
+    @ApiModelProperty("是否领取(1:已领取 0:未领取 2:领取后退还教务处了)")
+    private Integer isClaim;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("出库人员")
-    @ApiModelProperty("出库人员")
-    private String issueUser;
+    @ExcelProperty("领取状态")
+    @ApiModelProperty("是否领取")
+    private String isClaimStr;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("出库单号")
-    @ApiModelProperty("出库单号(标识+当前时间(YYYYMMDDHHmmss)+三位序号+当前申领项出库次数(-n))")
-    private String orderNumber;
+    @ExcelIgnore
+    @ApiModelProperty("确认领取来源(1:个人申领发放,当确认领取不能被修改未领取,2:班级申领发放,可以修改为未领取)")
+    private Integer claimSource;
 
     @ContentStyle(dataFormat = 49)
-    @ExcelProperty("单次出库数量")
-    @ApiModelProperty("单次出库数量")
-    private Integer onceIssueNumber;
+    @ExcelProperty("申领方式")
+    @ApiModelProperty("领取来源")
+    private String claimSourceStr;
 }

+ 10 - 1
src/main/java/com/xjrsoft/module/veb/util/ImportExcelUtil.java

@@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.common.annotation.FiledWidth;
 import com.xjrsoft.common.annotation.Required;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.YesOrNoEnum;
@@ -107,7 +108,15 @@ public class ImportExcelUtil {
             }
             importConfig.setFieldName(field.getName());
             importConfig.setSortCode(index++);
-            importConfig.setWidth(0);
+
+            if (field.isAnnotationPresent(FiledWidth.class)) {
+                FiledWidth excelProperty = field.getAnnotation(FiledWidth.class);
+                int annotationValue = excelProperty.value();
+                importConfig.setWidth(annotationValue);
+            }else {
+                importConfig.setWidth(0);
+            }
+
             importConfigs.add(importConfig);
         }