Pārlūkot izejas kodu

值周排班导出样式调整

dzx 1 gadu atpakaļ
vecāks
revīzija
cb5cc0f970

+ 1 - 0
src/main/java/com/xjrsoft/module/weekly/controller/WeeklyDutyScheduleController.java

@@ -78,6 +78,7 @@ public class WeeklyDutyScheduleController {
 
     @GetMapping("/export")
     @ApiOperation(value = "导出")
+
     public ResponseEntity<byte[]> exportData(@Valid WeeklyDutySchedulePageDto dto, @RequestParam(defaultValue = "false") Boolean isTemplate) {
         List<WeeklyDutySchedule> list = weeklyDutyScheduleService.list();
         List<WeeklyDutyScheduleListVo> customerList = new ArrayList<>();

+ 0 - 3
src/main/java/com/xjrsoft/module/weekly/service/impl/WeeklyDutyScheduleServiceImpl.java

@@ -1,9 +1,7 @@
 package com.xjrsoft.module.weekly.service.impl;
 
 import cn.dev33.satoken.stp.StpUtil;
-import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
@@ -11,7 +9,6 @@ import com.xjrsoft.common.exception.MyException;
 import com.xjrsoft.module.weekly.entity.WeeklyDutySchedule;
 import com.xjrsoft.module.weekly.mapper.WeeklyDutyScheduleMapper;
 import com.xjrsoft.module.weekly.service.IWeeklyDutyScheduleService;
-import com.xjrsoft.module.weekly.vo.WeeklyDutySchedulePageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 

+ 20 - 0
src/main/java/com/xjrsoft/module/weekly/vo/WeeklyDutyScheduleListVo.java

@@ -1,7 +1,12 @@
 package com.xjrsoft.module.weekly.vo;
 
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentFontStyle;
 import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.alibaba.excel.annotation.write.style.HeadFontStyle;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -12,8 +17,10 @@ import lombok.Data;
 * @Version 1.0
 */
 @Data
+@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 40)
 public class WeeklyDutyScheduleListVo {
 
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("序号")
     @ApiModelProperty("序号")
@@ -22,6 +29,8 @@ public class WeeklyDutyScheduleListVo {
     /**
     * 学号/工号
     */
+    @ColumnWidth(20)
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 60)
     @ExcelProperty("工号")
     @ApiModelProperty("工号")
@@ -29,6 +38,8 @@ public class WeeklyDutyScheduleListVo {
     /**
     * 姓名
     */
+    @ColumnWidth(15)
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 60)
     @ExcelProperty("姓名")
     @ApiModelProperty("姓名")
@@ -36,6 +47,8 @@ public class WeeklyDutyScheduleListVo {
     /**
     * 性别
     */
+    @ColumnWidth(15)
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("性别")
     @ApiModelProperty("性别")
@@ -43,12 +56,16 @@ public class WeeklyDutyScheduleListVo {
     /**
      * 出生日期
      */
+    @ColumnWidth(20)
+    @HeadFontStyle(color = 9)
     @ApiModelProperty("出生日期")
     @ExcelProperty("出生日期")
     private String dateBirth;
     /**
     * 证件号码
     */
+    @ColumnWidth(20)
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 200)
     @ExcelProperty("证件号码")
     @ApiModelProperty("证件号码")
@@ -56,6 +73,7 @@ public class WeeklyDutyScheduleListVo {
     /**
     * 年龄
     */
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("年龄")
     @ApiModelProperty("年龄")
@@ -63,6 +81,8 @@ public class WeeklyDutyScheduleListVo {
     /**
     * 备注
     */
+    @ColumnWidth(100)
+    @HeadFontStyle(color = 9)
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("值周情况")
     @ApiModelProperty("值周情况")