|
@@ -197,22 +197,23 @@ public class WechatCallbackController {
|
|
|
.eq("openid", scanRecord.getOpenId()).eq("user_id",salesmanId));
|
|
|
|
|
|
if (miniBindUserList.isEmpty()){
|
|
|
- int count = customService.count(new QueryWrapper<Custom>().eq("custom_name", openId));
|
|
|
- if(count==0) {
|
|
|
- Custom custom = new Custom();
|
|
|
- custom.setCustomName(openId);//用户的openId
|
|
|
- custom.setIsDelete(0);
|
|
|
- custom.setCreateTime(new Date());
|
|
|
- if (StringUtils.isNotEmpty(salesmanId)) {
|
|
|
- custom.setInchargerId(salesmanId);
|
|
|
- User user = userService.getById(salesmanId);
|
|
|
- custom.setCompanyId(user != null ? user.getCompanyId() : null);
|
|
|
- customService.save(custom);
|
|
|
- log.info("新增客户成功");
|
|
|
- }
|
|
|
- }else {
|
|
|
- log.info("已存在custom_name为"+openId+"的客户");
|
|
|
- }
|
|
|
+ //此处不生成custom,只有关注了后续的订阅号才算正式关注成功
|
|
|
+// int count = customService.count(new QueryWrapper<Custom>().eq("custom_name", openId));
|
|
|
+// if(count==0) {
|
|
|
+// Custom custom = new Custom();
|
|
|
+// custom.setCustomName(openId);//用户的openId
|
|
|
+// custom.setIsDelete(0);
|
|
|
+// custom.setCreateTime(new Date());
|
|
|
+// if (StringUtils.isNotEmpty(salesmanId)) {
|
|
|
+// custom.setInchargerId(salesmanId);
|
|
|
+// User user = userService.getById(salesmanId);
|
|
|
+// custom.setCompanyId(user != null ? user.getCompanyId() : null);
|
|
|
+// customService.save(custom);
|
|
|
+// log.info("新增客户成功");
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// log.info("已存在custom_name为"+openId+"的客户");
|
|
|
+// }
|
|
|
MiniBindUser miniBindUser = new MiniBindUser();
|
|
|
miniBindUser.setUserId(salesmanId)
|
|
|
.setOpenid(openId)
|
|
@@ -220,7 +221,6 @@ public class WechatCallbackController {
|
|
|
.setCreateTime(LocalDateTime.now());
|
|
|
miniBindUserService.save(miniBindUser);
|
|
|
log.info("用户关注服务号销售人员的二维码,绑定销售人员和用户id成功");
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -228,12 +228,9 @@ public class WechatCallbackController {
|
|
|
|
|
|
//取消关注
|
|
|
private void handleUnsubscribe(String openId) {
|
|
|
-
|
|
|
followMapper.delete(new QueryWrapper<WechatUserFollow>().eq("open_id", openId));
|
|
|
- customService.remove(new QueryWrapper<Custom>().eq("custom_name", openId));
|
|
|
miniBindUserService.remove(new QueryWrapper<MiniBindUser>().eq("openid", openId));
|
|
|
log.info("用户取消绑定销售人员成功");
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private String successResponse(Element root) {
|