提交 e46b30b8 作者: gh

Merge remote-tracking branch 'origin/master'

...@@ -71,8 +71,9 @@ public class CustomerDelayGraphicsController { ...@@ -71,8 +71,9 @@ public class CustomerDelayGraphicsController {
public BaseResult copy(@RequestParam String appId, public BaseResult copy(@RequestParam String appId,
@RequestParam(required = false) String bookId, @RequestParam(required = false) String bookId,
@RequestParam(required = false) String bookName, @RequestParam(required = false) String bookName,
@RequestParam(required = false) Integer chapterIdx,
@RequestBody List<String> targetAppList) { @RequestBody List<String> targetAppList) {
return customerGraphicsDelayService.copy(appId, bookId, bookName, targetAppList); return customerGraphicsDelayService.copy(appId, bookId, bookName, chapterIdx, targetAppList);
} }
@ApiOperation("所有公众号") @ApiOperation("所有公众号")
......
...@@ -90,10 +90,11 @@ public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsD ...@@ -90,10 +90,11 @@ public interface CustomerGraphicsDelayService extends IService<CustomerGraphicsD
* @param appId 应用程序id * @param appId 应用程序id
* @param bookId 选择目标书 * @param bookId 选择目标书
* @param bookName 书名 * @param bookName 书名
* @param chapterIdx 章节
* @param targetAppList 目标应用程序列表 * @param targetAppList 目标应用程序列表
* @return {@link BaseResult} * @return {@link BaseResult}
*/ */
BaseResult copy(String appId, String bookId, String bookName, List<String> targetAppList); BaseResult copy(String appId, String bookId, String bookName, Integer chapterIdx, List<String> targetAppList);
/** /**
* 获得认证列表 * 获得认证列表
......
...@@ -8,6 +8,8 @@ import com.yaoyaozw.customer.service.CustomerGraphicsDelayService; ...@@ -8,6 +8,8 @@ import com.yaoyaozw.customer.service.CustomerGraphicsDelayService;
import com.yaoyaozw.customer.service.wechat.service.WeChatService; import com.yaoyaozw.customer.service.wechat.service.WeChatService;
import com.yaoyaozw.customer.utils.YYZWDateUtil; import com.yaoyaozw.customer.utils.YYZWDateUtil;
import com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO; import com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -29,6 +31,7 @@ import com.yaoyaozw.customer.service.CustomerDelayPublishService; ...@@ -29,6 +31,7 @@ import com.yaoyaozw.customer.service.CustomerDelayPublishService;
@Service @Service
public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPublishMapper, CustomerDelayPublish> implements CustomerDelayPublishService{ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPublishMapper, CustomerDelayPublish> implements CustomerDelayPublishService{
private final static Logger localLog = LoggerFactory.getLogger(CustomerDelayPublishServiceImpl.class);
@Autowired @Autowired
private CustomerGraphicsDelayService customerGraphicsDelayService; private CustomerGraphicsDelayService customerGraphicsDelayService;
...@@ -47,6 +50,7 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu ...@@ -47,6 +50,7 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu
//涉及的appid //涉及的appid
Set<String> appidSet = allPostUser.stream().map(CustomerDelayPublish::getAppId).collect(Collectors.toSet()); Set<String> appidSet = allPostUser.stream().map(CustomerDelayPublish::getAppId).collect(Collectors.toSet());
try {
if (!allPostUser.isEmpty()){ if (!allPostUser.isEmpty()){
//号-用户 //号-用户
Map<String, Map<String,CustomerDelayPublish>> userMap = allPostUser.stream().filter(a->a.getCustomerSort()!=null).collect(Collectors.groupingBy(CustomerDelayPublish::getAppId,Collectors.toMap(CustomerDelayPublish::getOpenId,a->a,(v1,v2)->v1))); Map<String, Map<String,CustomerDelayPublish>> userMap = allPostUser.stream().filter(a->a.getCustomerSort()!=null).collect(Collectors.groupingBy(CustomerDelayPublish::getAppId,Collectors.toMap(CustomerDelayPublish::getOpenId,a->a,(v1,v2)->v1)));
...@@ -90,12 +94,7 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu ...@@ -90,12 +94,7 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu
List<CustomerDelayPublish> registerUserEntities = new ArrayList<>(); List<CustomerDelayPublish> registerUserEntities = new ArrayList<>();
//更新下次延时排期 //更新下次延时排期
for (Future<CustomerDelayPublish> delayPublishFuture : futureList) { for (Future<CustomerDelayPublish> delayPublishFuture : futureList) {
try {
registerUserEntities.add(delayPublishFuture.get()) ; registerUserEntities.add(delayPublishFuture.get()) ;
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
} }
if (!registerUserEntities.isEmpty()){ if (!registerUserEntities.isEmpty()){
...@@ -109,5 +108,8 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu ...@@ -109,5 +108,8 @@ public class CustomerDelayPublishServiceImpl extends ServiceImpl<CustomerDelayPu
} }
} }
} catch (Exception e) {
localLog.error("发生异常: {}, 位置: {}", e.getMessage(), e.getStackTrace()[0]);
}
} }
} }
...@@ -238,7 +238,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi ...@@ -238,7 +238,7 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
} }
@Override @Override
public BaseResult copy(String appId, String bookId, String bookName, List<String> targetAppList) { public BaseResult copy(String appId, String bookId, String bookName, Integer chapterIdx, List<String> targetAppList) {
List<AuthorizerInfo> authorizerInfoList = authorizerInfoService.list(); List<AuthorizerInfo> authorizerInfoList = authorizerInfoService.list();
Map<String, AuthorizerInfo> authMap = authorizerInfoList.stream().collect(Collectors.toMap(AuthorizerInfo::getAppid, Function.identity())); Map<String, AuthorizerInfo> authMap = authorizerInfoList.stream().collect(Collectors.toMap(AuthorizerInfo::getAppid, Function.identity()));
...@@ -258,9 +258,13 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi ...@@ -258,9 +258,13 @@ public class CustomerGraphicsDelayServiceImpl extends ServiceImpl<CustomerGraphi
Stream<ReferralEntity> stream = referralEntityList.stream(); Stream<ReferralEntity> stream = referralEntityList.stream();
if (StringUtil.isNotBlank(bookId)) { if (StringUtil.isNotBlank(bookId)) {
stream = stream.peek(item -> { stream = stream.peek(item -> {
if (StringUtil.isNotBlank(item.getBookId())) { // 选了书,将推广类型的链接书籍换成选择的书籍
if (StringUtil.isNotBlank(item.getBookId()) && CustomerCommonConstant.BOOK_NEWS_TYPE.equals(item.getNewsType())) {
item.setBookId(bookId); item.setBookId(bookId);
item.setBookName(bookName); item.setBookName(bookName);
if (ObjectUtil.isNotNull(chapterIdx)) {
item.setChapterIdx(chapterIdx);
}
} }
}); });
} }
......
...@@ -8,6 +8,7 @@ import com.yaoyaozw.customer.entity.CustomerDelayPublish; ...@@ -8,6 +8,7 @@ import com.yaoyaozw.customer.entity.CustomerDelayPublish;
import com.yaoyaozw.customer.entity.CustomerGraphics; import com.yaoyaozw.customer.entity.CustomerGraphics;
import com.yaoyaozw.customer.service.AuthorizerTokenService; import com.yaoyaozw.customer.service.AuthorizerTokenService;
import com.yaoyaozw.customer.service.ReferralEntityService; import com.yaoyaozw.customer.service.ReferralEntityService;
import com.yaoyaozw.customer.service.impl.CustomerDelayPublishServiceImpl;
import com.yaoyaozw.customer.service.wechat.entity.WeChatResponseEntity; import com.yaoyaozw.customer.service.wechat.entity.WeChatResponseEntity;
import com.yaoyaozw.customer.service.wechat.entity.customerRequest.CustomerNewsArticleItem; import com.yaoyaozw.customer.service.wechat.entity.customerRequest.CustomerNewsArticleItem;
import com.yaoyaozw.customer.service.wechat.entity.customerRequest.CustomerNewsItem; import com.yaoyaozw.customer.service.wechat.entity.customerRequest.CustomerNewsItem;
...@@ -15,6 +16,8 @@ import com.yaoyaozw.customer.service.wechat.entity.customerRequest.WeChatCustome ...@@ -15,6 +16,8 @@ import com.yaoyaozw.customer.service.wechat.entity.customerRequest.WeChatCustome
import com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO; import com.yaoyaozw.customer.vo.customer.CrowdPackageUserVO;
import com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO; import com.yaoyaozw.customer.vo.customer.CustomerDelayItemVO;
import com.yaoyaozw.customer.vo.referral.ReferralEntityVo; import com.yaoyaozw.customer.vo.referral.ReferralEntityVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
...@@ -30,6 +33,8 @@ import java.util.stream.Collectors; ...@@ -30,6 +33,8 @@ import java.util.stream.Collectors;
@Service @Service
public class WeChatServiceImpl implements WeChatService{ public class WeChatServiceImpl implements WeChatService{
private final static Logger localLog = LoggerFactory.getLogger(WeChatServiceImpl.class);
private String customerPath="https://api.weixin.qq.com/cgi-bin/message/custom/send"; private String customerPath="https://api.weixin.qq.com/cgi-bin/message/custom/send";
private static final String CUSTOMER_TEXT="text"; private static final String CUSTOMER_TEXT="text";
...@@ -100,7 +105,7 @@ public class WeChatServiceImpl implements WeChatService{ ...@@ -100,7 +105,7 @@ public class WeChatServiceImpl implements WeChatService{
return sendCustomerDelayMessage(updateToken,user,delaySortMap,needUpdateVoList); return sendCustomerDelayMessage(updateToken,user,delaySortMap,needUpdateVoList);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); localLog.error("发生异常: {}, 位置: {}", e.getMessage(), e.getStackTrace()[0]);
} }
} }
} }
......
...@@ -41,6 +41,9 @@ public class CustomerMessageListVO implements Serializable { ...@@ -41,6 +41,9 @@ public class CustomerMessageListVO implements Serializable {
@ApiModelProperty("人数") @ApiModelProperty("人数")
private Integer peopleNum; private Integer peopleNum;
@ApiModelProperty("人数")
private Integer sendNum;
@ApiModelProperty("发送状态值") @ApiModelProperty("发送状态值")
private Integer sendStatus; private Integer sendStatus;
......
...@@ -18,6 +18,7 @@ mybatis-plus: ...@@ -18,6 +18,7 @@ mybatis-plus:
call-setters-on-nulls: true call-setters-on-nulls: true
jdbc-type-for-null: 'null' jdbc-type-for-null: 'null'
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
logging: logging:
level: level:
com.example.material.mapper: debug com.example.material.mapper: debug
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
cg.post_time as postTime, cg.post_time as postTime,
cg.extend_title as extendTitle, cg.extend_title as extendTitle,
cg.send_status as sendStatus, cg.send_status as sendStatus,
cg.send_num as sendNum,
dic.dic_value as sendStatusStr, dic.dic_value as sendStatusStr,
cpm.id as packId, cpm.id as packId,
cpm.package_name as packName, cpm.package_name as packName,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论