|
@@ -9,8 +9,10 @@ import com.tourism.common.core.object.*;
|
|
|
import com.tourism.common.core.util.MyModelUtil;
|
|
|
import com.tourism.common.core.util.MyPageUtil;
|
|
|
import com.tourism.webadmin.back.dto.JobProjectDto;
|
|
|
+import com.tourism.webadmin.back.model.DirectoryInfo;
|
|
|
import com.tourism.webadmin.back.model.JobProject;
|
|
|
import com.tourism.webadmin.back.service.JobProjectService;
|
|
|
+import com.tourism.webadmin.back.service.TourismProjectService;
|
|
|
import com.tourism.webadmin.back.vo.JobProjectVo;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
+import static java.util.stream.Collectors.toList;
|
|
|
+
|
|
|
/**
|
|
|
* 网页劳务项目管理操作控制器类。
|
|
|
*
|
|
@@ -34,7 +38,8 @@ public class JobProjectToWebController {
|
|
|
|
|
|
@Autowired
|
|
|
private JobProjectService jobProjectService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private TourismProjectService tourismProjectService;
|
|
|
/**
|
|
|
* 列出符合过滤条件的劳务项目管理列表。
|
|
|
*
|
|
@@ -48,16 +53,25 @@ public class JobProjectToWebController {
|
|
|
@MyRequestBody JobProjectDto jobProjectDtoFilter,
|
|
|
@MyRequestBody MyOrderParam orderParam,
|
|
|
@MyRequestBody MyPageParam pageParam) {
|
|
|
- if (pageParam != null) {
|
|
|
- PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
|
|
|
- }
|
|
|
if(jobProjectDtoFilter.getBelongTab() == null){
|
|
|
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST,"所属分类(belongTab)不能为空!");
|
|
|
}
|
|
|
+ //如果belongTab小于1000并且大于10.则表明查询的是一级菜单
|
|
|
+ if(jobProjectDtoFilter.getBelongTab()>=10 && jobProjectDtoFilter.getBelongTab()<1000){
|
|
|
+ DirectoryInfo filter = new DirectoryInfo();
|
|
|
+ filter.setParentId(jobProjectDtoFilter.getBelongTab());
|
|
|
+ filter.setEnable(1);
|
|
|
+ List<DirectoryInfo> directoryInfoList = tourismProjectService.getDirectoryInfoList(filter, null);
|
|
|
+ jobProjectDtoFilter.setBelongTab(null);
|
|
|
+ jobProjectDtoFilter.setDirectoryInfoIds(directoryInfoList.stream().map(DirectoryInfo::getId).collect(toList()));
|
|
|
+ }
|
|
|
JobProject jobProjectFilter = MyModelUtil.copyTo(jobProjectDtoFilter, JobProject.class);
|
|
|
//首页展示的为启用的内容
|
|
|
jobProjectFilter.setEnable(1);
|
|
|
String orderBy = MyOrderParam.buildOrderBy(orderParam, JobProject.class);
|
|
|
+ if (pageParam != null) {
|
|
|
+ PageMethod.startPage(pageParam.getPageNum(), pageParam.getPageSize(), pageParam.getCount());
|
|
|
+ }
|
|
|
List<JobProject> jobProjectList = jobProjectService.getJobProjectListWithRelation(jobProjectFilter, orderBy);
|
|
|
return ResponseResult.success(MyPageUtil.makeResponseData(jobProjectList, JobProjectVo.class));
|
|
|
}
|