diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java index e72d988..b232cc4 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/ConferenceExportDTO.java @@ -22,11 +22,9 @@ public class ConferenceExportDTO { private String unit; @ApiModelProperty("会议计划开始时间") - @ExcelProperty(value = "会议计划开始时间", index = 1) private Date scheduledStartTime; @ApiModelProperty("会议计划结束时间") - @ExcelProperty(value = "会议计划结束时间", index = 2) private Date scheduledEndTime; @ApiModelProperty("会议主题") @@ -48,4 +46,12 @@ public class ConferenceExportDTO { @ApiModelProperty("会议状态") @ExcelProperty(value = "会议状态", index = 7) private String conferenceStatus; + + @ApiModelProperty("计划开始时间") + @ExcelProperty(value = "计划开始时间", index = 1) + private String startTime; + + @ApiModelProperty("计划结束时间") + @ExcelProperty(value = "计划结束时间", index = 2) + private String endTime; } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java index 515a252..c876c9a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordDetailVO.java @@ -1,10 +1,12 @@ package com.hnac.hzims.safeproduct.vo; +import cn.afterturn.easypoi.entity.ImageEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @author liwen @@ -52,4 +54,13 @@ public class ConferenceRecordDetailVO { @ApiModelProperty("会议附件") private String filePath; + + @ApiModelProperty("图片列表") + private List images; + + @ApiModelProperty("年份") + private String year; + + @ApiModelProperty("月份") + private String month; } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java index 8b1f328..9856bec 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java @@ -2,7 +2,6 @@ package com.hnac.hzims.safeproduct.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.service.IConferencePlanService; @@ -110,13 +109,14 @@ public class ConferenceController extends BladeController { @GetMapping("/recordPage") @ApiImplicitParams({ - @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "conferencePlanId", value = "会议计划id", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualStartTime", value = "计划开始时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "actualEndTime", value = "计划结束时间", dataType = "query", paramType = "string") }) @ApiOperation(value = "会议记录分页") @ApiOperationSupport(order = 10) public R> recordPage(@ApiIgnore @RequestParam Map param, Query query) { - IPage page = conferenceRecordService.page(Condition.getPage(query), Condition.getQueryWrapper( - param, ConferenceRecordEntity.class).lambda().orderByDesc(ConferenceRecordEntity::getCreateTime)); + IPage page = conferenceRecordService.recordPage(param, query); return R.data(page); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java index a792243..569623e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/IConferenceRecordService.java @@ -1,10 +1,13 @@ package com.hnac.hzims.safeproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 会议记录服务类 @@ -41,4 +44,12 @@ public interface IConferenceRecordService extends IService recordPage(Map param, Query query); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java index 6a2dcf8..dbfb3cb 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferencePlanServiceImpl.java @@ -18,6 +18,7 @@ import com.hnac.hzims.safeproduct.service.IConferencePlanService; import com.hnac.hzims.safeproduct.service.IConferenceRecordService; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -89,7 +90,7 @@ public class ConferencePlanServiceImpl extends ServiceImpl conferenceList = getConferenceByUnitAndDate(unit, startTime, endTime); - // 处理会议数据信息 + // 数据处理 conferenceList.forEach(conference -> { // 会议方式 String method; @@ -111,6 +112,9 @@ public class ConferencePlanServiceImpl extends ServiceImpl list = new ArrayList<>(); + for (String img : imgArr) { + ImageEntity imageEntity = new ImageEntity(BaseUtil.imgToByte(savePath + + BaseUtil.downloadFileByUrl(img, savePath)), 180, 150); + list.add(imageEntity); + } + conferenceRecordDetailVO.setImages(list); + } Map params = BaseUtil.obj2Map(conferenceRecordDetailVO); String templateFile = "template/会议记录表" + SafeProductConstant.DOCX_SUFFIX; String wordPath = savePath + "/会议记录表" + SafeProductConstant.DOCX_SUFFIX; @@ -110,13 +135,34 @@ public class ConferenceRecordServiceImpl extends ServiceImpl recordPage(Map param, Query query) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + String conferencePlanId = String.valueOf(param.get("conferencePlanId")); + String startTime = String.valueOf(param.get("actualStartTime")); + String endTime = String.valueOf((param.get("actualEndTime"))); + if (!conferencePlanId.equals("null") && !conferencePlanId.equals("")) { + queryWrapper.lambda().eq(ConferenceRecordEntity::getConferencePlanId, conferencePlanId); + } + if (!startTime.equals("null") && !startTime.equals("")) { + queryWrapper.lambda().ge(ConferenceRecordEntity::getActualStartTime, startTime); + } + if (!endTime.equals("null") && !endTime.equals("")) { + queryWrapper.lambda().le(ConferenceRecordEntity::getActualEndTime, endTime); + } + queryWrapper.lambda().orderByDesc(ConferenceRecordEntity::getCreateTime); + return this.page(Condition.getPage(query), queryWrapper); + } + + /** * 查询是否存在同月编号 * @param currentMonth 当月 * @return 存在则返回上一编号,否则返回null */ private String getLastCode(String currentMonth) { - String month = currentMonth.substring(currentMonth.length() - 2); - List list = getConferenceByMonth(month); + List list = getConferenceByMonth(currentMonth); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx index fd5f373..e4af627 100644 Binary files a/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx and b/hzims-service/safeproduct/src/main/resources/template/会议记录表.docx differ