浏览代码

材料缴交bug修复

dzx 2 月之前
父节点
当前提交
389ee6b4db

+ 13 - 15
src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java

@@ -17,7 +17,17 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.app.dto.UpdateEnableMarkDto;
 import com.xjrsoft.module.form.dto.FormExecuteInfoDto;
 import com.xjrsoft.module.form.service.IFormExecuteService;
-import com.xjrsoft.module.material.dto.*;
+import com.xjrsoft.module.material.dto.AddMaterialTaskAssignDto;
+import com.xjrsoft.module.material.dto.AddMaterialTaskDto;
+import com.xjrsoft.module.material.dto.FormDataExportQueryDto;
+import com.xjrsoft.module.material.dto.MaterialTaskAssignAppendixDto;
+import com.xjrsoft.module.material.dto.MaterialTaskAssignApprovedDto;
+import com.xjrsoft.module.material.dto.MaterialTaskAssignListDto;
+import com.xjrsoft.module.material.dto.MaterialTaskAssignPageDto;
+import com.xjrsoft.module.material.dto.MaterialTaskPageDto;
+import com.xjrsoft.module.material.dto.MaterialTaskWaitPageDto;
+import com.xjrsoft.module.material.dto.UpdateMaterialTaskDto;
+import com.xjrsoft.module.material.dto.ViewContentDto;
 import com.xjrsoft.module.material.entity.MaterialTask;
 import com.xjrsoft.module.material.entity.MaterialTaskAssign;
 import com.xjrsoft.module.material.entity.MaterialType;
@@ -183,21 +193,9 @@ public class MaterialTaskController {
     @PostMapping("/export-query")
     @ApiOperation(value = "导出")
     public ResponseEntity<byte[]> exportData(@Valid @RequestBody MaterialTaskAssignListDto dto) {
-        MPJLambdaWrapper<MaterialTask> queryWrapper = new MPJLambdaWrapper<>();
-        queryWrapper
-                .orderByDesc(MaterialTask::getId)
-                .eq(MaterialTask::getCreateUserId, StpUtil.getLoginIdAsLong())
-                .like(StrUtil.isNotBlank(dto.getName()), MaterialTask::getName, dto.getName())
-                .select(MaterialTask::getId)
-                .selectAs(MaterialType::getName, MaterialTaskPageVo::getMaterialTypeIdCn)
-                .selectAs(MaterialType::getCreateDate, MaterialTaskPageVo::getCreateDate)
-                .select(MaterialTask.class, x -> VoToColumnUtil.fieldsToColumns(MaterialTaskPageVo.class).contains(x.getProperty()))
-                .leftJoin(MaterialType.class, MaterialType::getId, MaterialTask::getMaterialTypeId);
-
-
-        List<MaterialTaskPageVo> customerList = materialTaskService.selectJoinList(MaterialTaskPageVo.class, queryWrapper);
+        List<MaterialTaskAssignListVo> customerList = materialTaskService.assignList(dto);
         ByteArrayOutputStream bot = new ByteArrayOutputStream();
-        EasyExcel.write(bot, MaterialTaskPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
+        EasyExcel.write(bot, MaterialTaskAssignListVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
 
         return RT.fileStream(bot.toByteArray(), "MaterialTask" + ExcelTypeEnum.XLSX.getValue());
     }

+ 78 - 0
src/main/java/com/xjrsoft/module/material/vo/MaterialTaskExcelVo.java

@@ -0,0 +1,78 @@
+package com.xjrsoft.module.material.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDate;
+
+/**
+* @title: 材料提交任务分页列表出参
+* @Author baicai
+* @Date: 2023-10-31
+* @Version 1.0
+*/
+@Data
+public class MaterialTaskExcelVo {
+
+    /**
+     * 材料提交任务类型(material_type)
+     */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("材料提交任务类型(material_type)")
+    @ApiModelProperty("材料提交任务类型(material_type)")
+    private String materialTypeIdCn;
+    /**
+    * 任务名称
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("任务名称")
+    @ApiModelProperty("任务名称")
+    private String name;
+    /**
+    * 要求完成日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("要求完成日期")
+    @ApiModelProperty("要求完成日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDate requiredCompleteTime;
+    /**
+    * 要求
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("要求")
+    @ApiModelProperty("要求")
+    private String requirement;
+    /**
+    * 指派给几人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("指派给几人")
+    @ApiModelProperty("指派给几人")
+    private Integer assignPerson;
+    /**
+    * 已提交人数
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("已提交人数")
+    @ApiModelProperty("已提交人数")
+    private Integer submitedPerson;
+    /**
+    * 按时提交
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("按时提交")
+    @ApiModelProperty("按时提交")
+    private Integer onTimePerson;
+    /**
+    * 延迟提交
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("延迟提交")
+    @ApiModelProperty("延迟提交")
+    private Integer timeDelay;
+
+}