|
|
@@ -0,0 +1,51 @@ |
|
|
|
package com.ningdatech.pmapi.projectdeclared.manage; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.entity.IrsApplication; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.entity.NdPiotTasks; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.service.INdPiotTasksService; |
|
|
|
import com.ningdatech.pmapi.projectdeclared.service.IrsApplicationService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Classname IrsManage |
|
|
|
* @Description |
|
|
|
* @Date 2023/3/1 14:48 |
|
|
|
* @Author PoffyZhang |
|
|
|
*/ |
|
|
|
@Component |
|
|
|
@Slf4j |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class IrsManage { |
|
|
|
|
|
|
|
private final IrsApplicationService irsApplicationService; |
|
|
|
|
|
|
|
private final INdPiotTasksService piotTasksService; |
|
|
|
|
|
|
|
|
|
|
|
public List<IrsApplicationVO> applicationList() { |
|
|
|
List<IrsApplication> list = irsApplicationService.list(); |
|
|
|
if(CollUtil.isEmpty(list)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
return CollUtils.convert(list,app -> BeanUtil.copyProperties(app,IrsApplicationVO.class)); |
|
|
|
} |
|
|
|
|
|
|
|
public List<PiotTasksVO> listPiotTasks() { |
|
|
|
List<NdPiotTasks> list = piotTasksService.list(); |
|
|
|
if(CollUtil.isEmpty(list)){ |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
return CollUtils.convert(list,task -> BeanUtil.copyProperties(task,PiotTasksVO.class)); |
|
|
|
} |
|
|
|
} |