|
@@ -144,12 +144,51 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AbstractPageResultBean<CheckStandard> selectPageInfo(CheckStandardDTO record, int pageNum, int pageSize) {
|
|
|
+ public AbstractPageResultBean<CheckStandardVO> selectPage(CheckStandardDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
- AbstractPageResultBean<CheckStandard> pageInfo = new MyPage(mapper.selectList(record));
|
|
|
+ AbstractPageResultBean<CheckStandardVO> pageInfo = new MyPage(mapper.selectList(record));
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public CheckStandardVO getVOById(String id) {
|
|
|
+ CheckStandard checkStandard = super.getModelById(id);
|
|
|
+ /* Weekend<CheckStandardParam> weekend = new Weekend<>(CheckStandardParam.class);
|
|
|
+ weekend.weekendCriteria().andEqualTo(CheckStandardParam::getStandardId, id);
|
|
|
+ List<CheckStandardParam> paramList = paramMapper.selectByExample(weekend);
|
|
|
+ checkStandard.setParamList(paramList);*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(checkStandard == null){
|
|
|
+ throw new BusinessException("保养标准已经删除,该任务无需执行,请删除该任务");
|
|
|
+ }
|
|
|
+ CheckStandardVO vo = BeanConverterUtil.copyObjectProperties(checkStandard,CheckStandardVO.class);
|
|
|
+ Weekend<SysFile> weekendFile = new Weekend<>(SysFile.class);
|
|
|
+ weekendFile.weekendCriteria().andEqualTo(SysFile::getTargetId, checkStandard.getId());
|
|
|
+ List<SysFile> sysFiles = sysFileService.getListByTargetAndType(checkStandard.getId(), null);
|
|
|
+ List<SysFile> checkImgList = ListUtils.newArrayList();
|
|
|
+ List<SysFile> checkFileList = ListUtils.newArrayList();
|
|
|
+ sysFiles.forEach(item -> {
|
|
|
+ if (item.getType().equals( SysFileTypeEnum.CHECK_STANDARD_IMGS.getValue())) {
|
|
|
+ checkImgList.add(item);
|
|
|
+ }
|
|
|
+ if (item.getType().equals( SysFileTypeEnum.CHECK_STANDARD_FILES.getValue())) {
|
|
|
+ checkFileList.add(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ vo.setCheckImgList(checkImgList);
|
|
|
+ vo.setCheckFileList(checkFileList);
|
|
|
+ SbInfo sbInfo = sbInfoMapper.selectByPrimaryKey(vo.getSbId());
|
|
|
+ if(sbInfo != null){
|
|
|
+ vo.setPositionNo(sbInfo.getPositionNo());
|
|
|
+ }
|
|
|
+ // 备件列表
|
|
|
+ List<CheckStandardSpareVO> spareList = spareService.selectVOListByCheckId(checkStandard.getId());
|
|
|
+ vo.setDetailList(spareList);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 编码需要查询最大的编码,然后+1,
|
|
|
* 编码格式:五位,补零,00001
|