From cc1fe1eda5ec0626257342ad76639ad83d8553f1 Mon Sep 17 00:00:00 2001 From: liwen Date: Fri, 22 Mar 2024 16:51:29 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=BC=94=E7=BB=83=E3=80=81=E4=BC=9A?= =?UTF-8?q?=E8=AE=AE=E3=80=81=E5=9F=B9=E8=AE=AD=E8=AE=B0=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=8D=95=E4=BD=8D=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/safeproduct/vo/ConferenceRecordVO.java | 7 ++-- .../hzims/safeproduct/vo/RehearsalRecordlVO.java | 6 +-- .../hnac/hzims/safeproduct/vo/TrainRecordVO.java | 7 +--- .../controller/ConferenceController.java | 3 +- .../controller/RehearsalController.java | 3 +- .../safeproduct/controller/TrainController.java | 3 +- .../safeproduct/mapper/ConferenceRecordMapper.java | 12 ++++++ .../safeproduct/mapper/ConferenceRecordMapper.xml | 25 +++++++++++++ .../safeproduct/mapper/RehearsalRecordMapper.java | 12 ++++++ .../safeproduct/mapper/RehearsalRecordMapper.xml | 25 +++++++++++++ .../safeproduct/mapper/TrainRecordMapper.java | 3 +- .../hzims/safeproduct/mapper/TrainRecordMapper.xml | 22 +++++++---- .../service/impl/ConferenceRecordServiceImpl.java | 40 +------------------- .../service/impl/RehearsalRecordServiceImpl.java | 43 +--------------------- .../service/impl/TrainRecordServiceImpl.java | 28 +------------- 15 files changed, 108 insertions(+), 131 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java index 615c5aa..2e65929 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java @@ -1,13 +1,11 @@ package com.hnac.hzims.safeproduct.vo; -import cn.afterturn.easypoi.entity.ImageEntity; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; -import java.util.List; /** * @author liwen @@ -29,17 +27,19 @@ public class ConferenceRecordVO { @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("会议计划开始时间") private Date scheduledStartTime; + @JsonFormat(pattern = "yyyy-MM-dd") @ApiModelProperty("会议计划开始时间") private Date scheduledEndTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @ApiModelProperty("会议实际开始时间") private Date actualStartTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @ApiModelProperty("会议实际开始时间") private Date actualEndTime; - @ApiModelProperty("会议地点") private String location; @@ -60,5 +60,4 @@ public class ConferenceRecordVO { @ApiModelProperty("会议内容") private String content; - } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java index f92966e..965a5c7 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java @@ -19,6 +19,7 @@ public class RehearsalRecordlVO { @ApiModelProperty("编码") private String code; + @ApiModelProperty("id") private String id; @@ -28,12 +29,10 @@ public class RehearsalRecordlVO { @ApiModelProperty("演练科目") private String subject; - @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划开始时间") private Date scheduledStartTime; - @JsonFormat(pattern = DateUtil.PATTERN_DATE) @ApiModelProperty("演练计划结束时间") private Date scheduledEndTime; @@ -44,7 +43,6 @@ public class RehearsalRecordlVO { @ApiModelProperty("参演人员") private String peopleNum; - @ApiModelProperty("演练地点") private String location; @@ -61,11 +59,9 @@ public class RehearsalRecordlVO { @ApiModelProperty("演练状态") private String rehearsalStatus; - @ApiModelProperty("演练记录") private String record; @ApiModelProperty("演练评价") private String comment; - } diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java index b1e8744..0cd273a 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java @@ -1,15 +1,12 @@ package com.hnac.hzims.safeproduct.vo; - import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.validation.constraints.Size; import java.util.Date; - /** * @author liwen * @date 2024-01-15 @@ -31,6 +28,7 @@ public class TrainRecordVO { @ApiModelProperty("单位") private String unit; + @ApiModelProperty("记录名称") private String trainRecordName; @@ -48,14 +46,13 @@ public class TrainRecordVO { @ApiModelProperty("实际培训结束时间") private Date actualEndTime; + @ApiModelProperty("实际培训开始时间") private Date actualStartTime; - @ApiModelProperty("关联考试:0-否,1-是") private Integer isTest; - @ApiModelProperty("培训状态") private String trainStatus; 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 9310bc6..093945f 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 @@ -112,7 +112,8 @@ public class ConferenceController extends BladeController { @ApiImplicitParams({ @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") + @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string") }) @ApiOperation(value = "会议记录分页") @ApiOperationSupport(order = 10) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java index 50175f4..7637966 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java @@ -114,7 +114,8 @@ public class RehearsalController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "rehearsalPlanId", value = "演练计划id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "actualStartTime", value = "开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "actualEndTime", value = "结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string") }) @ApiOperation(value = "演练记录分页") @ApiOperationSupport(order = 10) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java index de236ad..2dbe973 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java @@ -123,7 +123,8 @@ public class TrainController extends BladeController { @ApiImplicitParams({ @ApiImplicitParam(name = "trainPlanId", value = "培训计划id", dataType = "query", paramType = "string"), @ApiImplicitParam(name = "startTime", value = "计划开始时间", dataType = "query", paramType = "string"), - @ApiImplicitParam(name = "endTime", value = "计划结束时间", dataType = "query", paramType = "string") + @ApiImplicitParam(name = "endTime", value = "计划结束时间", dataType = "query", paramType = "string"), + @ApiImplicitParam(name = "unit", value = "单位", dataType = "query", paramType = "string") }) @ApiOperation(value = "培训记录分页") @ApiOperationSupport(order = 10) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java index 85d3c62..6c5bb95 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java @@ -1,10 +1,14 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; +import com.hnac.hzims.safeproduct.vo.ConferenceRecordVO; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + /** * 会议记录Mapper类 * @@ -20,4 +24,12 @@ public interface ConferenceRecordMapper extends BaseMapper getConferenceRecordPage(IPage page, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml index a2cc05e..88c5b1d 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml @@ -13,4 +13,29 @@ t1.is_deleted = 0 AND t1.id = #{id} + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java index 9a55888..ea66a80 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java @@ -1,10 +1,14 @@ package com.hnac.hzims.safeproduct.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; +import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import org.apache.ibatis.annotations.Mapper; +import java.util.Map; + /** * 演练记录Mapper类 * @@ -20,4 +24,12 @@ public interface RehearsalRecordMapper extends BaseMapper * @return 演练记录表VO类 */ RehearsalRecordDetailVO getRecordDetailVOById(Long id); + + /** + * 获取演练记录分页 + * @param page 分页类 + * @param param 参数 + * @return 演练记录分页 + */ + IPage getRehearsalRecordPage(IPage page, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml index 63a048e..1a7e130 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml @@ -13,4 +13,29 @@ t1.is_deleted = 0 AND t1.id = #{id} + + \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java index 5586ec0..28419b3 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.safeproduct.dto.TrainRecordDTO; import com.hnac.hzims.safeproduct.entity.TrainRecordEntity; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; +import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -39,5 +40,5 @@ public interface TrainRecordMapper extends BaseMapper { * @param page 分页类 * @return 培训记录数据 */ - IPage trainRecordPage(IPage page, Map param); + IPage trainRecordPage(IPage page, Map param); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml index b4052fe..5201998 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml @@ -28,23 +28,29 @@ AND t1.id = #{id} - SELECT - * + t1.id, t2.scheduled_start_time, t2.scheduled_end_time, t2.unit, t1.train_record_name, t2.location, t2.train_method, + t2.teacher, t2.lesson, t1.actual_start_time, t1.actual_end_time, t2.is_test, t2.train_status, t1.code, t1.content, + t1.command FROM - hzims_train_record + hzims_train_record t1 + LEFT JOIN hzims_train_plan t2 ON t1.train_plan_id = t2.id WHERE - is_deleted = 0 + t1.is_deleted = 0 - AND train_plan_id = #{param.trainPlanId} + AND t1.train_plan_id = #{param.trainPlanId} - AND actual_start_time >= #{param.startTime} + AND t1.actual_start_time >= #{param.startTime} - AND actual_end_time <= #{param.endTime} + AND t1.actual_end_time <= #{param.endTime} + + + AND t2.unit like concat('%', #{param.unit}, '%') ORDER BY - create_time DESC + t1.create_time DESC \ No newline at end of file diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java index 0977dff..444952b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.ConferencePlanEntity; import com.hnac.hzims.safeproduct.entity.ConferenceRecordEntity; @@ -22,7 +21,6 @@ import com.hnac.hzims.safeproduct.utils.TimeUtils; import com.hnac.hzims.safeproduct.vo.ConferenceRecordDetailVO; import com.hnac.hzims.safeproduct.vo.ConferenceRecordVO; import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.utils.BeanUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -154,42 +152,8 @@ 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); - IPage page = this.page(Condition.getPage(query), queryWrapper); - IPage res=new Page<>(); - res.setSize(page.getSize()); - res.setTotal(page.getTotal()); - res.setPages(page.getPages()); - List records = page.getRecords(); - List recordlVOS =new ArrayList<>(); - for (ConferenceRecordEntity record : records) { - ConferenceRecordVO trainRecordVO = new ConferenceRecordVO(); - Long planId = record.getConferencePlanId(); - ConferencePlanEntity conferencePlanEntity = conferencePlanMapper.selectById(planId); - BeanUtil.copy(conferencePlanEntity,trainRecordVO); - trainRecordVO.setActualStartTime(record.getActualStartTime()); - trainRecordVO.setActualEndTime(record.getActualEndTime()); - trainRecordVO.setRecorder(record.getRecorder()); - trainRecordVO.setContent(record.getContent()); - trainRecordVO.setCode(record.getCode()); - trainRecordVO.setId(record.getId().toString()); - recordlVOS.add(trainRecordVO); - } - res.setRecords(recordlVOS); - return res; + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.getConferenceRecordPage(page, param); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java index d5f79c6..a269bf6 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.logs.utils.StringUtils; -import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.RehearsalRecordEntity; @@ -23,7 +22,6 @@ import com.hnac.hzims.safeproduct.vo.RehearsalRecordDetailVO; import com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.utils.BeanUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -197,44 +195,7 @@ public class RehearsalRecordServiceImpl extends ServiceImpl rehearsalRecordPage(Map param, Query query) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - String rehearsalPlanId = String.valueOf(param.get("rehearsalPlanId")); - String actualStartTime = String.valueOf(param.get("actualStartTime")); - String actualEndTime = String.valueOf(param.get("actualEndTime")); - if (!rehearsalPlanId.equals("null") && !rehearsalPlanId.equals("")) { - queryWrapper.lambda().eq(RehearsalRecordEntity::getRehearsalPlanId, rehearsalPlanId); - } - if (!actualStartTime.equals("null") && !actualStartTime.equals("")) { - queryWrapper.lambda().ge(RehearsalRecordEntity::getActualStartTime, actualStartTime); - } - if (!actualEndTime.equals("null") && !actualEndTime.equals("")) { - queryWrapper.lambda().le(RehearsalRecordEntity::getActualEndTime, actualEndTime); - } - queryWrapper.lambda().orderByDesc(RehearsalRecordEntity::getCreateTime); - IPage rehearsalRecordList = this.page(Condition.getPage(query), queryWrapper); - IPage res=new Page<>(); - res.setSize(rehearsalRecordList.getSize()); - res.setTotal(rehearsalRecordList.getTotal()); - res.setPages(rehearsalRecordList.getPages()); - List records = rehearsalRecordList.getRecords(); - List recordlVOS =new ArrayList<>(); - for (RehearsalRecordEntity record : records) { - RehearsalRecordlVO rehearsalRecordlVO = new RehearsalRecordlVO(); - Long rehearsalPlanId1 = record.getRehearsalPlanId(); - RehearsalPlanEntity rehearsalPlanEntity = rehearsalPlanMapper.selectById(rehearsalPlanId1); - BeanUtil.copy(rehearsalPlanEntity,rehearsalRecordlVO); - rehearsalRecordlVO.setPeopleName(record.getPeopleName()); - int length = record.getPeopleName().split(",").length; - rehearsalRecordlVO.setPeopleNum(String.valueOf(length)); - rehearsalRecordlVO.setActualStartTime(record.getActualStartTime()); - rehearsalRecordlVO.setActualEndTime(record.getActualEndTime()); - rehearsalRecordlVO.setCode(record.getCode()); - rehearsalRecordlVO.setComment(record.getComment()); - rehearsalRecordlVO.setRecord(record.getRecord()); - rehearsalRecordlVO.setId(record.getId().toString()); - recordlVOS.add(rehearsalRecordlVO); - } - res.setRecords(recordlVOS); - return res; + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.getRehearsalRecordPage(page, param); } } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java index 866364c..e12b15f 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java @@ -23,7 +23,6 @@ import com.hnac.hzims.safeproduct.utils.TimeUtils; import com.hnac.hzims.safeproduct.vo.TrainRecordDetailVO; import com.hnac.hzims.safeproduct.vo.TrainRecordVO; import org.springblade.core.mp.support.Query; -import org.springblade.core.tool.utils.BeanUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -191,31 +190,8 @@ public class TrainRecordServiceImpl extends ServiceImpl trainRecordPage(Map param, Query query) { - IPage page = new Page<>(query.getCurrent(), query.getSize()); - IPage trainRecordList = baseMapper.trainRecordPage(page, param); - IPage res=new Page<>(); - res.setSize(trainRecordList.getSize()); - res.setTotal(trainRecordList.getTotal()); - res.setPages(trainRecordList.getPages()); - List records = trainRecordList.getRecords(); - List recordlVOS =new ArrayList<>(); - for (TrainRecordEntity record : records) { - TrainRecordVO trainRecordVO = new TrainRecordVO(); - Long getTrainPlanId = record.getTrainPlanId(); - TrainPlanEntity trainPlanEntity = trainPlanMapper.selectById(getTrainPlanId); - BeanUtil.copy(trainPlanEntity,trainRecordVO); - trainRecordVO.setActualEndTime(record.getActualEndTime()); - trainRecordVO.setActualStartTime(record.getActualStartTime()); - trainRecordVO.setScheduledStartTime(record.getActualStartTime()); - trainRecordVO.setTrainRecordName(record.getTrainRecordName()); - trainRecordVO.setContent(record.getContent()); - trainRecordVO.setCommand(record.getCommand()); - trainRecordVO.setCode(record.getCode()); - trainRecordVO.setId(record.getId().toString()); - recordlVOS.add(trainRecordVO); - } - res.setRecords(recordlVOS); - return res; + IPage page = new Page<>(query.getCurrent(), query.getSize()); + return baseMapper.trainRecordPage(page, param); } /**