| | |
| | | .orderByDesc(YwPatrolScheme::getCreateDate) |
| | | ; |
| | | IPage<YwPatrolTaskRecord> iPage = ywPatrolTaskRecordMapper.selectJoinPage(page,YwPatrolTaskRecord.class,queryWrapper); |
| | | if(iPage!=null && iPage.getRecords()!=null){ |
| | | for(YwPatrolTaskRecord m : iPage.getRecords()){ |
| | | getFileListByModel(m); |
| | | } |
| | | } |
| | | return PageData.from(iPage); |
| | | } |
| | | |
| | | private void getFileListByModel(YwPatrolTaskRecord ywPatrolTaskRecord) { |
| | | //附件数据 |
| | | List<Multifile> multifileList = multifileMapper.selectJoinList(Multifile.class,new MPJLambdaWrapper<Multifile>() |
| | | .selectAll(Multifile.class) |
| | | .selectAs(SystemUser::getRealname,Multifile::getUserName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Multifile::getCreator) |
| | | .eq(Multifile::getObjId,ywPatrolTaskRecord.getId()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.FN_PATROL_TASK_RECORD_FILE.getKey())); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_PATROL).getCode(); |
| | | for (Multifile multifile:multifileList) { |
| | | if(StringUtils.isNotBlank(multifile.getFileurl())){ |
| | | multifile.setFileurlFull(path + multifile.getFileurl()); |
| | | } |
| | | } |
| | | ywPatrolTaskRecord.setMultifileList(multifileList); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | if(Objects.isNull(ywPatrolTaskRecord)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未匹配到巡检点!"); |
| | | } |
| | | //附件数据 |
| | | List<Multifile> multifileList = multifileMapper.selectJoinList(Multifile.class,new MPJLambdaWrapper<Multifile>() |
| | | .selectAll(Multifile.class) |
| | | .selectAs(SystemUser::getRealname,Multifile::getUserName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,Multifile::getCreator) |
| | | .eq(Multifile::getObjId,ywPatrolTaskRecord.getId()) |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .eq(Multifile::getObjType,Constants.MultiFile.FN_PATROL_TASK_RECORD_FILE.getKey())); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_PATROL).getCode(); |
| | | for (Multifile multifile:multifileList) { |
| | | if(StringUtils.isNotBlank(multifile.getFileurl())){ |
| | | multifile.setFileurlFull(path + multifile.getFileurl()); |
| | | } |
| | | } |
| | | ywPatrolTaskRecord.setMultifileList(multifileList); |
| | | } |
| | | getFileListByModel(ywPatrolTaskRecord); |
| | | |
| | | return ywPatrolTaskRecord; |
| | | |