Commit 43f129b9 by 水库浪子

Merge remote-tracking branch 'origin/back_end_dev' into back_end_dev

2 parents 1cd505d8 68147648
...@@ -16,6 +16,7 @@ import java.util.List; ...@@ -16,6 +16,7 @@ import java.util.List;
/** /**
* 聊天工具侧边栏 * 聊天工具侧边栏
*
* @author kewen * @author kewen
*/ */
@RequestMapping(value = "/wecom/chat/item") @RequestMapping(value = "/wecom/chat/item")
...@@ -41,9 +42,10 @@ public class WeChatItemController extends BaseController { ...@@ -41,9 +42,10 @@ public class WeChatItemController extends BaseController {
*/ */
//@PreAuthorize("@ss.hasPermi('chat:item:list')") //@PreAuthorize("@ss.hasPermi('chat:item:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestParam(value = "sideId") Long sideId) { public TableDataInfo list(@RequestParam(value = "sideId") Long sideId
, @RequestParam(value = "keyword", required = false) String keyword) {
startPage(); startPage();
List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId); List<WeChatSideVo> weChatSideVos = weChatItemService.chatItems(sideId,keyword);
return getDataTable(weChatSideVos); return getDataTable(weChatSideVos);
} }
......
...@@ -87,10 +87,21 @@ public class WeCustomerMessagePushController extends BaseController { ...@@ -87,10 +87,21 @@ public class WeCustomerMessagePushController extends BaseController {
*/ */
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:pushResults')") @PreAuthorize("@ss.hasPermi('customerMessagePush:push:pushResults')")
@GetMapping(value = "/pushResults") @GetMapping(value = "/pushResults")
public TableDataInfo customerMessagePushResult(@RequestParam(value = "messageId") Long messageId,@RequestParam(value = "status") String status){ public TableDataInfo customerMessagePushResult(@RequestParam(value = "messageId") Long messageId, @RequestParam(value = "status") String status) {
startPage(); startPage();
List<WeCustomerMessageResultVo> weCustomerMessageResuls = weCustomerMessgaeResultService.customerMessagePushs(messageId, status); List<WeCustomerMessageResultVo> weCustomerMessageResuls = weCustomerMessgaeResultService.customerMessagePushs(messageId, status);
return getDataTable(weCustomerMessageResuls); return getDataTable(weCustomerMessageResuls);
} }
/**
* 同步消息发送结果
*/
@PreAuthorize("@ss.hasPermi('customerMessagePush:push:asyncResult')")
@PostMapping(value = "asyncResult")
public AjaxResult asyncResult(@RequestParam(value = "msgid") String msgid, @RequestParam(value = "messageId") Long messageId) {
weCustomerMessageOriginalService.asyncResult(msgid, messageId);
return AjaxResult.success();
}
} }
...@@ -10,12 +10,14 @@ import java.util.List; ...@@ -10,12 +10,14 @@ import java.util.List;
/** /**
* 聊天工具侧边栏 * 聊天工具侧边栏
*
* @author kewen * @author kewen
*/ */
public interface WeChatItemMapper extends BaseMapper<WeChatItem> { public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/** /**
* 批量添加侧边栏素材 * 批量添加侧边栏素材
*
* @param items 侧边栏素材列表 * @param items 侧边栏素材列表
* @return 结果 * @return 结果
*/ */
...@@ -23,6 +25,7 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -23,6 +25,7 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
/** /**
* 删除侧边栏素材 * 删除侧边栏素材
*
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @return 结果 * @return 结果
*/ */
...@@ -33,7 +36,8 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> { ...@@ -33,7 +36,8 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* h5素材列表 * h5素材列表
* *
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @param keyword 关键词
* @return * @return
*/ */
public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId); public List<WeChatSideVo> findChatItems(@Param("sideId") Long sideId, @Param("keyword") String keyword);
} }
...@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> { ...@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> {
* @param sideId 侧边栏id * @param sideId 侧边栏id
* @return * @return
*/ */
public List<WeChatSideVo> chatItems(Long sideId); public List<WeChatSideVo> chatItems(Long sideId,String keyword);
} }
...@@ -40,4 +40,12 @@ public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMe ...@@ -40,4 +40,12 @@ public interface IWeCustomerMessageOriginalService extends IService<WeCustomerMe
*/ */
CustomerMessagePushVo CustomerMessagePushDetail(Long messageId); CustomerMessagePushVo CustomerMessagePushDetail(Long messageId);
/**
* 同步发送结果
*
* @param msgid 可以用于获取发送结果
*/
void asyncResult(String msgid, Long messageId);
} }
...@@ -96,8 +96,8 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI ...@@ -96,8 +96,8 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
} }
@Override @Override
public List<WeChatSideVo> chatItems(Long sideId) { public List<WeChatSideVo> chatItems(Long sideId,String keyword) {
return weChatItemMapper.findChatItems(sideId); return weChatItemMapper.findChatItems(sideId,keyword);
} }
/** /**
......
...@@ -63,20 +63,31 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer ...@@ -63,20 +63,31 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer
CustomerMessagePushVo customerMessagePushDetail = weCustomerMessageOriginalMapper.findCustomerMessagePushDetail(messageId); CustomerMessagePushVo customerMessagePushDetail = weCustomerMessageOriginalMapper.findCustomerMessagePushDetail(messageId);
AtomicInteger atomicInteger=new AtomicInteger();
//拉取消息发送结果 //拉取消息发送结果
CompletableFuture.runAsync(()->{ CompletableFuture.runAsync(() -> syncSendResult(customerMessagePushDetail.getMsgid(), messageId));
return customerMessagePushDetail;
}
@Override
public void asyncResult(String msgid, Long messageId) {
syncSendResult(msgid, messageId);
}
String msgid = customerMessagePushDetail.getMsgid(); public void syncSendResult(String msgid, Long messageId) {
if(StringUtils.isNotEmpty(msgid)){ AtomicInteger atomicInteger = new AtomicInteger();
if (StringUtils.isNotEmpty(msgid)) {
List<String> msgIds = null; List<String> msgIds = null;
try { try {
msgIds = objectMapper.readValue(msgid,new TypeReference<List<String>>() { }); msgIds = objectMapper.readValue(msgid, new TypeReference<List<String>>() {
});
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
...@@ -84,11 +95,11 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer ...@@ -84,11 +95,11 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer
} }
if(CollectionUtils.isNotEmpty(msgIds)){ if (CollectionUtils.isNotEmpty(msgIds)) {
msgIds.forEach(m->{ msgIds.forEach(m -> {
QueryCustomerMessageStatusResultDataObjectDto dataObjectDto=new QueryCustomerMessageStatusResultDataObjectDto(); QueryCustomerMessageStatusResultDataObjectDto dataObjectDto = new QueryCustomerMessageStatusResultDataObjectDto();
dataObjectDto.setMsgid(m); dataObjectDto.setMsgid(m);
...@@ -100,15 +111,15 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer ...@@ -100,15 +111,15 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer
List<DetailMessageStatusResultDto> detailList = queryCustomerMessageStatusResultDto.getDetail_list(); List<DetailMessageStatusResultDto> detailList = queryCustomerMessageStatusResultDto.getDetail_list();
detailList.forEach(d-> { detailList.forEach(d -> {
if(d.getStatus().equals("1")){ if (d.getStatus().equals("1")) {
atomicInteger.incrementAndGet(); atomicInteger.incrementAndGet();
} }
weCustomerMessgaeResultMapper.updateWeCustomerMessgaeResult(messageId,d.getChat_id(),d.getExternal_userid(),d.getStatus(),d.getSend_time()); weCustomerMessgaeResultMapper.updateWeCustomerMessgaeResult(messageId, d.getChat_id(), d.getExternal_userid(), d.getStatus(), d.getSend_time());
}); });
...@@ -121,11 +132,7 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer ...@@ -121,11 +132,7 @@ public class WeCustomerMessageOriginalServiceImpl extends ServiceImpl<WeCustomer
} }
//更新微信实际发送条数 //更新微信实际发送条数
weCustomerMessageService.updateWeCustomerMessageActualSend(messageId,atomicInteger.get()); weCustomerMessageService.updateWeCustomerMessageActualSend(messageId, atomicInteger.get());
});
return customerMessagePushDetail;
} }
} }
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
LEFT JOIN we_category wc ON wm.category_id = wc.id LEFT JOIN we_category wc ON wm.category_id = wc.id
<where> <where>
wci.side_id=#{sideId} wci.side_id=#{sideId}
<if test="keyword!=null and keyword!=''">
AND wm.material_name LIKE CONCAT('%',#{keyword},'%')
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!