| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.page.PageData; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.service.impl.CrudServiceImpl; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.model.mpk.dao.MpkFileDao; |
| | |
| | | import com.iailab.module.model.mpk.dto.ProjectModelDTO; |
| | | import com.iailab.module.model.mpk.dto.ProjectPackageHistoryDTO; |
| | | import com.iailab.module.model.mpk.entity.ProjectEntity; |
| | | import com.iailab.module.model.mpk.entity.ProjectPackageHistoryEntity; |
| | | import com.iailab.module.model.mpk.service.ProjectModelService; |
| | | import com.iailab.module.model.mpk.service.ProjectPackageHistoryModelService; |
| | | import com.iailab.module.model.mpk.service.ProjectPackageHistoryService; |
| | |
| | | **/ |
| | | @Service |
| | | @Slf4j |
| | | public class ProjectServiceImpl extends CrudServiceImpl<ProjectDao, ProjectEntity, ProjectDTO> implements ProjectService { |
| | | public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntity> implements ProjectService { |
| | | |
| | | @Autowired |
| | | ProjectModelService projectModelService; |
| | |
| | | |
| | | @Override |
| | | public PageData<ProjectDTO> page(Map<String, Object> params) { |
| | | IPage<ProjectDTO> page = baseDao.getPageList( |
| | | IPage<ProjectEntity> page = baseDao.selectPage( |
| | | getPage(params, null, false), |
| | | params |
| | | getWrapper(params) |
| | | ); |
| | | |
| | | return getPageData(page, ProjectDTO.class); |
| | |
| | | //删除备份文件 |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("projectId",id); |
| | | List<ProjectPackageHistoryDTO> list = projectPackageHistoryService.list(map); |
| | | List<ProjectPackageHistoryEntity> list = projectPackageHistoryService.list(map); |
| | | list.forEach(e -> { |
| | | File file = new File(e.getFilePath()); |
| | | if (file.exists()) { |
| | |
| | | return new PageData<>(list,total); |
| | | } |
| | | |
| | | @Override |
| | | public QueryWrapper<ProjectEntity> getWrapper(Map<String, Object> params){ |
| | | String id = (String)params.get("id"); |
| | | String projectName = (String)params.get("projectName"); |
| | | String projectCode = (String)params.get("projectCode"); |
| | | |
| | | QueryWrapper<ProjectEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq(StringUtils.isNotBlank(id), "id", id) |
| | | .like(StringUtils.isNotBlank(projectName),"project_name",projectName); |
| | | .like(StringUtils.isNotBlank(projectName),"project_name",projectName) |
| | | .like(StringUtils.isNotBlank(projectCode),"project_code",projectCode); |
| | | |
| | | return wrapper; |
| | | } |