|
@@ -49,8 +49,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.time.LocalDate;
|
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -184,8 +182,20 @@ public class MaterialTaskController {
|
|
|
|
|
|
@PostMapping("/export-query")
|
|
@PostMapping("/export-query")
|
|
@ApiOperation(value = "导出")
|
|
@ApiOperation(value = "导出")
|
|
- public ResponseEntity<byte[]> exportData(@Valid @RequestBody MaterialTaskPageDto dto) {
|
|
|
|
- List<MaterialTaskPageVo> customerList = ((PageOutput<MaterialTaskPageVo>) page(dto).getData()).getList();
|
|
|
|
|
|
+ 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);
|
|
ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
EasyExcel.write(bot, MaterialTaskPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
|
|
EasyExcel.write(bot, MaterialTaskPageVo.class).automaticMergeHead(false).excelType(ExcelTypeEnum.XLSX).sheet().doWrite(customerList);
|
|
|
|
|