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