@@ -40,13 +40,6 @@ public class MessageSharedController { | |||
return ApiResponse.of(response); | |||
} | |||
@ApiOperation(value = "全部明细(包含主表)") | |||
@PostMapping(value = "/viewAll") | |||
public ApiResponse<MessageSendApplyViewAllResponseDto> viewAll(@RequestBody @Valid MessageSendApplyViewAllRequestDto request) throws ManagerException { | |||
MessageSendApplyViewAllResponseDto response = messageWaitSendManager.viewAll(request); | |||
return ApiResponse.of(response); | |||
} | |||
@ApiOperation(value = "消息重发") | |||
@PostMapping(value = "/retry") | |||
public ApiResponse<MessageRetryResponseDto> retry(@RequestBody @Valid MessageRetryRequestDto request) throws ManagerException { |
@@ -11,7 +11,8 @@ import lombok.Setter; | |||
@Setter | |||
public class MessageSendDetailsRequestDto extends AbstractStaffBizRequestDTO { | |||
@ApiModelProperty(value = "子表id",required = true) | |||
@NotBlank(message = "id不能为空") | |||
private String id; | |||
@ApiModelProperty(value = "detailsId") | |||
private String detailsId; | |||
@ApiModelProperty(value = "applyId") | |||
private String applyId; | |||
} |
@@ -1,13 +1,17 @@ | |||
package cn.com.taiji.msgw.dto; | |||
import cn.com.taiji.common.entity.BaseEntity; | |||
import cn.com.taiji.core.entity.msgw.MsgwSendApply; | |||
import cn.com.taiji.core.entity.msgw.MsgwSendDetails; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import java.util.List; | |||
@Getter | |||
@Setter | |||
public class MessageSendDetailsResponseDto extends BaseEntity { | |||
private MsgwSendDetails sendDetails; | |||
private MsgwSendApply sendApply; | |||
private List<MsgwSendDetails> sendDetails; | |||
} |
@@ -26,9 +26,6 @@ public interface MessageWaitSendManager { | |||
/**消息明细*/ | |||
MessageSendDetailsResponseDto view(MessageSendDetailsRequestDto request); | |||
/**消息明细*/ | |||
MessageSendApplyViewAllResponseDto viewAll(MessageSendApplyViewAllRequestDto request); | |||
/**分页查询*/ | |||
Pagination page(SendDetailsRequestDto request) throws ManagerException; | |||
@@ -212,19 +212,18 @@ public class MessageWaitSendManagerImpl extends AbstractCommManager implements M | |||
@Override | |||
public MessageSendDetailsResponseDto view(MessageSendDetailsRequestDto request) { | |||
MsgwSendDetails sendDetails = sendDetailsRepo.findById(request.getId()).orElse(null); | |||
MessageSendDetailsResponseDto response = new MessageSendDetailsResponseDto(); | |||
response.setSendDetails(sendDetails); | |||
return response; | |||
} | |||
@Override | |||
public MessageSendApplyViewAllResponseDto viewAll(MessageSendApplyViewAllRequestDto request) { | |||
MsgwSendApply apply = sendApplyRepo.findById(request.getApplyId()).orElse(null); | |||
List<MsgwSendDetails> list = sendDetailsRepo.findByApplyId(request.getApplyId()); | |||
MessageSendApplyViewAllResponseDto response = new MessageSendApplyViewAllResponseDto(); | |||
response.setSendApply(apply); | |||
response.setSendDetails(list); | |||
List<MsgwSendDetails> list = new ArrayList<>(); | |||
if (request.getApplyId() != null){ | |||
MsgwSendApply apply = sendApplyRepo.findById(request.getApplyId()).orElse(null); | |||
response.setSendApply(apply); | |||
list = sendDetailsRepo.findByApplyId(request.getApplyId()); | |||
response.setSendDetails(list); | |||
}else { | |||
MsgwSendDetails sendDetails = sendDetailsRepo.findById(request.getDetailsId()).orElse(null); | |||
list.add(sendDetails); | |||
response.setSendDetails(list); | |||
} | |||
return response; | |||
} | |||