|
@@ -13,7 +13,9 @@ import cn.com.ty.lift.business.project.dao.entity.model.ProjectRequest;
|
|
|
import cn.com.ty.lift.business.project.service.ProjectService;
|
|
|
import cn.com.ty.lift.common.base.ExportRequest;
|
|
|
import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
+import cn.com.ty.lift.common.model.AreaCode;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -89,12 +91,8 @@ public class ProjectController {
|
|
|
*/
|
|
|
@PostMapping("projectIDList")
|
|
|
public RestResponse projectIDList(@RequestBody ProjectRequest request) {
|
|
|
- Long regionId = request.getRegionId();
|
|
|
- if (regionId == null) {
|
|
|
- return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.param.empty"));
|
|
|
- }
|
|
|
- List<ProjectIDResponse> projectIDList = projectService.projectIDList(regionId);
|
|
|
- if (projectIDList.isEmpty()) {
|
|
|
+ List<ProjectIDResponse> projectIDList = projectService.projectIDList(request);
|
|
|
+ if (ObjectUtil.isEmpty(projectIDList)) {
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
}
|
|
|
return RestResponse.ok(projectIDList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
|
|
@@ -108,11 +106,11 @@ public class ProjectController {
|
|
|
*/
|
|
|
@PostMapping("detail")
|
|
|
public RestResponse detail(@RequestBody ProjectRequest request) {
|
|
|
- if (request.getProjectId() == null) {
|
|
|
- return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.param.empty"));
|
|
|
+ if (ObjectUtil.isEmpty(request.getProjectId())) {
|
|
|
+ return RestResponse.ok(null, ApiConstants.RESULT_NO_PARAM, MessageUtils.get("msg.param.empty"));
|
|
|
}
|
|
|
Project project = projectService.detail(request.getProjectId());
|
|
|
- if (project == null) {
|
|
|
+ if (ObjectUtil.isEmpty(project)) {
|
|
|
return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
}
|
|
|
return RestResponse.ok(project, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.detail.success"));
|
|
@@ -125,7 +123,11 @@ public class ProjectController {
|
|
|
*/
|
|
|
@PostMapping("area/list")
|
|
|
public RestResponse areaList() {
|
|
|
- return projectService.areaList();
|
|
|
+ List<AreaCode> areaCodeList = projectService.areaList();
|
|
|
+ if (ObjectUtil.isEmpty(areaCodeList)) {
|
|
|
+ return RestResponse.ok(null, ApiConstants.RESULT_NO_DATA, MessageUtils.get("msg.data.empty"));
|
|
|
+ }
|
|
|
+ return RestResponse.ok(areaCodeList, ApiConstants.RESULT_SUCCESS, MessageUtils.get("msg.query.success"));
|
|
|
}
|
|
|
|
|
|
/**
|