5-27 fix
parent
b6b8a98676
commit
0c6ed4cdd4
|
|
@ -46,8 +46,8 @@ public class FeedbackController {
|
|||
|
||||
@ApiOperation("获取反馈列表")
|
||||
@PostMapping("/list")
|
||||
public MultiResponse<FeedbackCO> feedbackList(@Validated @RequestBody FeedbackListQry qry) {
|
||||
return taskListService.feedbackList(qry);
|
||||
public PageResponse<FeedbackCO> feedbackList(@Validated @RequestBody FeedbackListQry qry) {
|
||||
return taskListService.feedbackPage(qry);
|
||||
}
|
||||
|
||||
@ApiOperation("获取反馈详情")
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.zcloud.safetyDutyList.command.query.tasklist;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.safetyDutyList.dto.clientobject.tasklist.*;
|
||||
import com.zcloud.safetyDutyList.dto.tasklist.FeedbackListQry;
|
||||
import com.zcloud.safetyDutyList.dto.tasklist.FeedbackPeriodGroupQry;
|
||||
|
|
@ -10,7 +12,6 @@ import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.FeedbackDO;
|
|||
import com.zcloud.safetyDutyList.persistence.dataobject.tasklist.TaskDetailDO;
|
||||
import com.zcloud.safetyDutyList.persistence.repository.tasklist.FeedbackRepository;
|
||||
import com.zcloud.safetyDutyList.persistence.repository.tasklist.TaskDetailRepository;
|
||||
import jodd.util.StringUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -53,21 +54,19 @@ public class FeedbackQueryExe {
|
|||
return MultiResponse.of(result);
|
||||
}
|
||||
|
||||
public MultiResponse<FeedbackCO> feedbackList(FeedbackListQry qry) {
|
||||
List<FeedbackDO> feedbackList = feedbackRepository.listByTaskDetailId(qry.getTaskDetailId());
|
||||
if (feedbackList == null || feedbackList.isEmpty()) {
|
||||
return MultiResponse.of(new ArrayList<>());
|
||||
public PageResponse<FeedbackCO> feedbackPage(FeedbackListQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<FeedbackDO> pageResponse = feedbackRepository.feedbackPage(params);
|
||||
List<FeedbackDO> doList = pageResponse.getData();
|
||||
if (doList == null || doList.isEmpty()) {
|
||||
return PageResponse.of(new ArrayList<>(), pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
List<FeedbackCO> coList = new ArrayList<>();
|
||||
for (FeedbackDO feedbackDO : feedbackList) {
|
||||
if (!StringUtil.isEmpty(qry.getFeedbackPeriodFlag()) && !qry.getFeedbackPeriodFlag().equals(feedbackDO.getFeedbackPeriodFlag())) {
|
||||
continue;
|
||||
}
|
||||
List<FeedbackCO> coList = doList.stream().map(feedbackDO -> {
|
||||
FeedbackCO co = new FeedbackCO();
|
||||
BeanUtils.copyProperties(feedbackDO, co);
|
||||
coList.add(co);
|
||||
}
|
||||
return MultiResponse.of(coList);
|
||||
return co;
|
||||
}).collect(Collectors.toList());
|
||||
return PageResponse.of(coList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
public SingleResponse<FeedbackInfoCO> getByFeedbackId(String feedbackId) {
|
||||
|
|
|
|||
|
|
@ -171,8 +171,8 @@ public class TaskListServiceImpl implements TaskListServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public MultiResponse<FeedbackCO> feedbackList(FeedbackListQry qry) {
|
||||
return feedbackQueryExe.feedbackList(qry);
|
||||
public PageResponse<FeedbackCO> feedbackPage(FeedbackListQry qry) {
|
||||
return feedbackQueryExe.feedbackPage(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -164,12 +164,12 @@ public interface TaskListServiceI {
|
|||
MultiResponse<FeedbackPeriodGroupCO> feedbackPeriodGroupList(FeedbackPeriodGroupQry qry);
|
||||
|
||||
/**
|
||||
* 查询指定周期的反馈列表
|
||||
* 分页查询反馈列表
|
||||
*
|
||||
* @param qry 查询参数(含taskDetailId和feedbackPeriodFlag)
|
||||
* @return 反馈列表
|
||||
* @param qry 分页查询参数(含taskDetailId、taskListId、feedbackPeriodFlag等)
|
||||
* @return 反馈分页结果
|
||||
*/
|
||||
MultiResponse<FeedbackCO> feedbackList(FeedbackListQry qry);
|
||||
PageResponse<FeedbackCO> feedbackPage(FeedbackListQry qry);
|
||||
|
||||
/**
|
||||
* 根据反馈ID获取反馈详情(含关联任务信息)
|
||||
|
|
|
|||
|
|
@ -13,9 +13,12 @@ import javax.validation.constraints.NotEmpty;
|
|||
*/
|
||||
@Data
|
||||
public class FeedbackListQry extends PageQuery {
|
||||
@ApiModelProperty(value = "任务ID", required = true)
|
||||
@NotEmpty(message = "任务ID不能为空")
|
||||
@ApiModelProperty(value = "任务详情ID")
|
||||
private String taskDetailId;
|
||||
@ApiModelProperty(value = "周期标识", required = true)
|
||||
@ApiModelProperty(value = "任务清单ID")
|
||||
private String taskListId;
|
||||
@ApiModelProperty(value = "周期标识")
|
||||
private String feedbackPeriodFlag;
|
||||
@ApiModelProperty(value = "反馈人公司ID")
|
||||
private Long feedbackCorpId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue