@@ -16,6 +16,8 @@ public interface MsgwSendDetailsRepo extends AbstractJpaRepo<MsgwSendDetails, St | |||
@Query("from MsgwSendDetails where applyId=?1 and sendResult=?2") | |||
List<MsgwSendDetails> findByApplyIdAndSendResult(String applyId, MessageResult messageResult); | |||
@Query("from MsgwSendDetails where applyId=?1") | |||
List<MsgwSendDetails> findByApplyId(String applyId); | |||
@Query("SELECT count(*) FROM MsgwSendDetails m WHERE 1 = 1 " + | |||
"AND (:messageType IS NULL OR m.messageType = :messageType) " + |
@@ -40,6 +40,13 @@ public class MessageSharedController { | |||
return ApiResponse.of(response); | |||
} | |||
@ApiOperation(value = "全部明细(包含主表)") | |||
@PostMapping(value = "/view") | |||
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 { |
@@ -0,0 +1,17 @@ | |||
package cn.com.taiji.msgw.dto; | |||
import javax.validation.constraints.NotBlank; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@Getter | |||
@Setter | |||
public class MessageSendApplyViewAllRequestDto extends AbstractStaffBizRequestDTO { | |||
@ApiModelProperty(value = "applyId",required = true) | |||
@NotBlank(message = "applyId不能为空") | |||
private String applyId; | |||
} |
@@ -0,0 +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 MessageSendApplyViewAllResponseDto extends BaseEntity { | |||
private MsgwSendApply sendApply; | |||
private List<MsgwSendDetails> sendDetails; | |||
} |
@@ -26,6 +26,9 @@ public interface MessageWaitSendManager { | |||
/**消息明细*/ | |||
MessageSendDetailsResponseDto view(MessageSendDetailsRequestDto request); | |||
/**消息明细*/ | |||
MessageSendApplyViewAllResponseDto viewAll(MessageSendApplyViewAllRequestDto request); | |||
/**分页查询*/ | |||
Pagination page(SendDetailsRequestDto request) throws ManagerException; | |||
@@ -6,6 +6,7 @@ import java.util.List; | |||
import java.util.Map; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import cn.com.taiji.core.entity.msgw.MsgwSendApply; | |||
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.WxMiniSendMessageResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ats.weiXin.WxMpSendMessageResponse; | |||
import cn.com.taiji.core.model.comm.protocol.ias.message.HltSendShortResponse; | |||
@@ -217,6 +218,16 @@ public class MessageWaitSendManagerImpl extends AbstractCommManager implements M | |||
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); | |||
return response; | |||
} | |||
@Override | |||
public Pagination page(SendDetailsRequestDto request) throws ManagerException { | |||
if (request.getMessageType().equals(null)){ |