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