|
@@ -16,6 +16,7 @@ import cn.com.ty.lift.common.constants.RedisConstants;
|
|
|
import cn.com.ty.lift.common.export.ExportUtils;
|
|
|
import cn.com.ty.lift.common.model.AreaCode;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
@@ -66,9 +67,12 @@ public class ProjectService {
|
|
|
*/
|
|
|
public RestResponse list(ProjectRequest request) {
|
|
|
IPage<ProjectResponse> page = new Page<>(request.getPageNum(), request.getPageSize());
|
|
|
- List<ProjectResponse> projectList = projectMapper.findByCondition(page, request);
|
|
|
+ if (request.getCondition() != null) {
|
|
|
+ request.setCondition(StrUtil.format("%{}%", request.getCondition()));
|
|
|
+ }
|
|
|
+ IPage<ProjectResponse> projects = projectMapper.findByCondition(page, request);
|
|
|
+ List<ProjectResponse> projectList = projects.getRecords();
|
|
|
if (projectList.isEmpty()) {
|
|
|
- page.setRecords(new ArrayList<>());
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
}
|
|
|
page.setRecords(projectList);
|
|
@@ -81,14 +85,13 @@ public class ProjectService {
|
|
|
* @description 查询公司项目列表
|
|
|
* @date 2019/12/9 10:32 AM
|
|
|
*/
|
|
|
- public RestResponse companyProjectList(ProjectRequest request) {
|
|
|
+ public RestResponse companyList(ProjectRequest request) {
|
|
|
IPage<ProjectResponse> page = new Page<>(request.getPageNum(), request.getPageSize());
|
|
|
- List<ProjectResponse> projectList = projectMapper.findCompanyListByCondition(page, request);
|
|
|
+ IPage<ProjectResponse> companyProjects = projectMapper.findCompanyListByCondition(page, request);
|
|
|
+ List<ProjectResponse> projectList = companyProjects.getRecords();
|
|
|
if (projectList.isEmpty()) {
|
|
|
- page.setRecords(new ArrayList<>());
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
}
|
|
|
- page.setRecords(projectList);
|
|
|
return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
|
|
|
}
|
|
|
|
|
@@ -100,14 +103,28 @@ public class ProjectService {
|
|
|
*/
|
|
|
public RestResponse list(ProjectHistoryRequest request) {
|
|
|
IPage<ProjectHistory> page = new Page<>(request.getPageNum(), request.getPageSize());
|
|
|
- List<ProjectHistory> historyList = projectHistoryMapper.findByCondition(page, request);
|
|
|
+ IPage<ProjectHistory> historys = projectHistoryMapper.findByCondition(page, request);
|
|
|
+ List<ProjectHistory> historyList = historys.getRecords();
|
|
|
if (historyList.isEmpty()) {
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
}
|
|
|
- page.setRecords(historyList);
|
|
|
return RestResponse.ok(page, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param request projectId 项目ID
|
|
|
+ * @return RestResponse userList项目组成员列表
|
|
|
+ * @description 查询项目组成员
|
|
|
+ * @date 2019/12/13 2:40 PM
|
|
|
+ */
|
|
|
+ public RestResponse userList(ProjectRequest request) {
|
|
|
+ List<ProjectUser> userList = projectUserMapper.findUserListById(request.getProjectId());
|
|
|
+ if (userList.isEmpty()) {
|
|
|
+ return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
+ }
|
|
|
+ return RestResponse.ok(userList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param id 项目id
|
|
|
* @return RestResponse 项目详情
|