Browse Source

update: 演练、会议、培训记录页面添加单位筛选

zhongwei
liwen 8 months ago
parent
commit
cc1fe1eda5
  1. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/ConferenceRecordVO.java
  2. 6
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/RehearsalRecordlVO.java
  3. 7
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/vo/TrainRecordVO.java
  4. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/ConferenceController.java
  5. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/RehearsalController.java
  6. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/controller/TrainController.java
  7. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.java
  8. 25
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/ConferenceRecordMapper.xml
  9. 12
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.java
  10. 25
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalRecordMapper.xml
  11. 3
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.java
  12. 22
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml
  13. 40
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/ConferenceRecordServiceImpl.java
  14. 43
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalRecordServiceImpl.java
  15. 28
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainRecordServiceImpl.java

7
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;
}

6
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;
}

7
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;

3
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)

3
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)

3
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)

12
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<ConferenceRecordEntit
* @return 会议记录表VO类
*/
ConferenceRecordDetailVO getConferenceRecordDetailById(Long id);
/**
* 获取会议记录分页
* @param page 分页类
* @param param 参数
* @return 会议记录分页
*/
IPage<ConferenceRecordVO> getConferenceRecordPage(IPage<ConferenceRecordVO> page, Map<String, Object> param);
}

25
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}
</select>
<select id="getConferenceRecordPage" resultType="com.hnac.hzims.safeproduct.vo.ConferenceRecordVO">
SELECT
t1.id, t1.code, t2.unit, t2.scheduled_start_time, t2.scheduled_end_time, t1.actual_start_time, t1.actual_end_time,
t2.location, t2.host, t2.conference_method, t2.theme, t2.conference_status, t1.recorder, t1.content
FROM
hzims_conference_record t1
LEFT JOIN hzims_conference_plan t2 ON t1.conference_plan_id = t2.id
WHERE
t1.is_deleted = 0
<if test="param.conferencePlanId != null and param.conferencePlanId != ''">
AND t2.id = #{param.conferencePlanId}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND t1.actualStartTime >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND t1.actualEndTime &lt;= #{param.endTime}
</if>
<if test="param.unit != null and param.unit != ''">
AND t2.unit like concat('%', #{param.unit}, '%')
</if>
ORDER BY
t1.create_time DESC
</select>
</mapper>

12
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<RehearsalRecordEntity>
* @return 演练记录表VO类
*/
RehearsalRecordDetailVO getRecordDetailVOById(Long id);
/**
* 获取演练记录分页
* @param page 分页类
* @param param 参数
* @return 演练记录分页
*/
IPage<RehearsalRecordlVO> getRehearsalRecordPage(IPage<RehearsalRecordlVO> page, Map<String, Object> param);
}

25
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}
</select>
<select id="getRehearsalRecordPage" resultType="com.hnac.hzims.safeproduct.vo.RehearsalRecordlVO">
SELECT
t1.id, t1.code, t2.unit, t2.subject, t2.scheduled_start_time, t2.scheduled_end_time, t1.people_name, t1.people_num,
t2.location, t1.actual_start_time, t1.actual_end_time, t2.rehearsal_status, t1.record, t1.comment
FROM
hzims_rehearsal_record t1
LEFT JOIN hzims_rehearsal_plan t2 ON t1.rehearsal_plan_id = t2.id
WHERE
t1.is_deleted = 0
<if test="param.rehearsalPlanId != null and param.rehearsalPlanId != ''">
AND t2.id = #{param.rehearsalPlanId}
</if>
<if test="param.actualStartTime != null and param.actualStartTime != ''">
AND t1.actual_start_time >= #{param.actualStartTime}
</if>
<if test="param.actualEndTime != null and param.actualEndTime != ''">
AND t1.actual_end_time &lt;= #{param.actualEndTime}
</if>
<if test="param.unit != null and param.unit != ''">
AND t2.unit like concat('%', #{param.unit}, '%')
</if>
ORDER BY
t1.create_time DESC
</select>
</mapper>

3
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<TrainRecordEntity> {
* @param page 分页类
* @return 培训记录数据
*/
IPage<TrainRecordEntity> trainRecordPage(IPage<TrainRecordEntity> page, Map<String, Object> param);
IPage<TrainRecordVO> trainRecordPage(IPage<TrainRecordVO> page, Map<String, Object> param);
}

22
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/TrainRecordMapper.xml

@ -28,23 +28,29 @@
AND t1.id = #{id}
</select>
<select id="trainRecordPage" resultType="com.hnac.hzims.safeproduct.entity.TrainRecordEntity">
<select id="trainRecordPage" resultType="com.hnac.hzims.safeproduct.vo.TrainRecordVO">
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
<if test="param.trainPlanId != null and param.trainPlanId != ''">
AND train_plan_id = #{param.trainPlanId}
AND t1.train_plan_id = #{param.trainPlanId}
</if>
<if test="param.startTime != null and param.startTime != ''">
AND actual_start_time >= #{param.startTime}
AND t1.actual_start_time >= #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
AND actual_end_time &lt;= #{param.endTime}
AND t1.actual_end_time &lt;= #{param.endTime}
</if>
<if test="param.unit != null and param.unit != ''">
AND t2.unit like concat('%', #{param.unit}, '%')
</if>
ORDER BY
create_time DESC
t1.create_time DESC
</select>
</mapper>

40
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<ConferenceRecordMap
*/
@Override
public IPage<ConferenceRecordVO> recordPage(Map<String, Object> param, Query query) {
QueryWrapper<ConferenceRecordEntity> 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<ConferenceRecordEntity> page = this.page(Condition.getPage(query), queryWrapper);
IPage<ConferenceRecordVO> res=new Page<>();
res.setSize(page.getSize());
res.setTotal(page.getTotal());
res.setPages(page.getPages());
List<ConferenceRecordEntity> records = page.getRecords();
List<ConferenceRecordVO> 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<ConferenceRecordVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getConferenceRecordPage(page, param);
}
/**

43
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<RehearsalRecordMappe
*/
@Override
public IPage<RehearsalRecordlVO> rehearsalRecordPage(Map<String, Object> param, Query query) {
QueryWrapper<RehearsalRecordEntity> 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<RehearsalRecordEntity> rehearsalRecordList = this.page(Condition.getPage(query), queryWrapper);
IPage<RehearsalRecordlVO> res=new Page<>();
res.setSize(rehearsalRecordList.getSize());
res.setTotal(rehearsalRecordList.getTotal());
res.setPages(rehearsalRecordList.getPages());
List<RehearsalRecordEntity> records = rehearsalRecordList.getRecords();
List<RehearsalRecordlVO> 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<RehearsalRecordlVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.getRehearsalRecordPage(page, param);
}
}

28
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<TrainRecordMapper, Train
*/
@Override
public IPage<TrainRecordVO> trainRecordPage(Map<String, Object> param, Query query) {
IPage<TrainRecordEntity> page = new Page<>(query.getCurrent(), query.getSize());
IPage<TrainRecordEntity> trainRecordList = baseMapper.trainRecordPage(page, param);
IPage<TrainRecordVO> res=new Page<>();
res.setSize(trainRecordList.getSize());
res.setTotal(trainRecordList.getTotal());
res.setPages(trainRecordList.getPages());
List<TrainRecordEntity> records = trainRecordList.getRecords();
List<TrainRecordVO> 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<TrainRecordVO> page = new Page<>(query.getCurrent(), query.getSize());
return baseMapper.trainRecordPage(page, param);
}
/**

Loading…
Cancel
Save