fix
This commit is contained in:
@@ -132,7 +132,7 @@ public class PlayPersonnelGroupInfoServiceImpl extends ServiceImpl<PlayPersonnel
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 返回所有的clerkId
|
// 返回所有的clerkId
|
||||||
idList = clerkUserInfoService.list(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).select(PlayClerkUserInfoEntity::getId)).stream().map(PlayClerkUserInfoEntity::getId).collect(Collectors.toList());
|
idList = clerkUserInfoService.list(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).select(PlayClerkUserInfoEntity::getId).eq(PlayClerkUserInfoEntity::getClerkState, "1")).stream().map(PlayClerkUserInfoEntity::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(idList)) {
|
if (CollectionUtil.isEmpty(idList)) {
|
||||||
|
|||||||
@@ -151,5 +151,7 @@ public class SysTenantEntity extends BaseEntity<SysTenantEntity> {
|
|||||||
private String sdxddtzTemplateId;
|
private String sdxddtzTemplateId;
|
||||||
// 认证申请审核通知模板id
|
// 认证申请审核通知模板id
|
||||||
private String rzsqshtxTemplateId;
|
private String rzsqshtxTemplateId;
|
||||||
|
// 认证申请通知for管理员
|
||||||
|
private String rzsqAdminTemplateId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.starry.admin.modules.weichat.entity.gift.PlayClerkGiftReturnVo;
|
|||||||
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderDetailsReturnVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderDetailsReturnVo;
|
||||||
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderInfoQueryVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderInfoQueryVo;
|
||||||
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderListReturnVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayClerkOrderListReturnVo;
|
||||||
|
import com.starry.admin.modules.weichat.service.WxCustomMpService;
|
||||||
import com.starry.admin.modules.weichat.service.WxCustomUserService;
|
import com.starry.admin.modules.weichat.service.WxCustomUserService;
|
||||||
import com.starry.admin.utils.SecurityUtils;
|
import com.starry.admin.utils.SecurityUtils;
|
||||||
import com.starry.admin.utils.SmsUtils;
|
import com.starry.admin.utils.SmsUtils;
|
||||||
@@ -103,6 +104,8 @@ public class WxClerkController {
|
|||||||
private IPlayPersonnelGroupInfoService playPersonnelGroupInfoService;
|
private IPlayPersonnelGroupInfoService playPersonnelGroupInfoService;
|
||||||
@Resource
|
@Resource
|
||||||
private SmsUtils smsUtils;
|
private SmsUtils smsUtils;
|
||||||
|
@Resource
|
||||||
|
private WxCustomMpService wxCustomMpService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,6 +211,14 @@ public class WxClerkController {
|
|||||||
entity.setClerkId(clerkId);
|
entity.setClerkId(clerkId);
|
||||||
entity.setAddTime(LocalDateTime.now());
|
entity.setAddTime(LocalDateTime.now());
|
||||||
playClerkUserReviewInfoService.create(entity);
|
playClerkUserReviewInfoService.create(entity);
|
||||||
|
wxCustomMpService.sendClerkApplyNoticeForAdmin(userInfo);
|
||||||
|
return R.ok("申请成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/user/add/test")
|
||||||
|
public R test() {
|
||||||
|
PlayClerkUserInfoEntity userInfo = playClerkUserInfoService.selectById("ILbjarTt");
|
||||||
|
wxCustomMpService.sendClerkApplyNoticeForAdmin(userInfo);
|
||||||
return R.ok("申请成功");
|
return R.ok("申请成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.starry.admin.modules.weichat.service;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||||
import com.github.binarywang.wxpay.service.WxPayService;
|
import com.github.binarywang.wxpay.service.WxPayService;
|
||||||
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
||||||
@@ -9,9 +10,12 @@ import com.starry.admin.common.exception.CustomException;
|
|||||||
import com.starry.admin.common.play.wx.WeChatConstants;
|
import com.starry.admin.common.play.wx.WeChatConstants;
|
||||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserReviewInfoEntity;
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserReviewInfoEntity;
|
||||||
|
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
|
||||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||||
|
import com.starry.admin.modules.personnel.module.entity.PlayPersonnelAdminInfoEntity;
|
||||||
|
import com.starry.admin.modules.personnel.service.IPlayPersonnelAdminInfoService;
|
||||||
import com.starry.admin.modules.platform.entity.SysTenantEntity;
|
import com.starry.admin.modules.platform.entity.SysTenantEntity;
|
||||||
import com.starry.admin.modules.platform.service.impl.SysTenantServiceImpl;
|
import com.starry.admin.modules.platform.service.impl.SysTenantServiceImpl;
|
||||||
import com.starry.admin.utils.SecurityUtils;
|
import com.starry.admin.utils.SecurityUtils;
|
||||||
@@ -25,10 +29,10 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author admin
|
* @author admin
|
||||||
@@ -44,6 +48,10 @@ public class WxCustomMpService {
|
|||||||
private SysTenantServiceImpl tenantService;
|
private SysTenantServiceImpl tenantService;
|
||||||
@Resource
|
@Resource
|
||||||
private IPlayCustomUserInfoService customUserInfoService;
|
private IPlayCustomUserInfoService customUserInfoService;
|
||||||
|
@Resource
|
||||||
|
private IPlayPersonnelAdminInfoService playPersonnelAdminInfoService;
|
||||||
|
@Resource
|
||||||
|
private IPlayClerkUserInfoService clerkUserInfoService;
|
||||||
|
|
||||||
|
|
||||||
public WxMpService proxyWxMpService() {
|
public WxMpService proxyWxMpService() {
|
||||||
@@ -219,6 +227,36 @@ public class WxCustomMpService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendClerkApplyNoticeForAdmin(PlayClerkUserInfoEntity entity) {
|
||||||
|
SysTenantEntity tenant = tenantService.selectSysTenantByTenantId(entity.getTenantId());
|
||||||
|
String template_id = tenant.getRzsqAdminTemplateId();
|
||||||
|
String tenantKey = tenant.getTenantKey();
|
||||||
|
String url = "http://" + tenantKey + ".july.hucs.top/clerk/";
|
||||||
|
List<PlayPersonnelAdminInfoEntity> adminInfoEntityList = playPersonnelAdminInfoService.list(Wrappers.lambdaQuery(PlayPersonnelAdminInfoEntity.class).select(PlayPersonnelAdminInfoEntity::getSysUserId));
|
||||||
|
for (PlayPersonnelAdminInfoEntity adminInfoEntity : adminInfoEntityList) {
|
||||||
|
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.getOne(Wrappers.lambdaQuery(PlayClerkUserInfoEntity.class).eq(PlayClerkUserInfoEntity::getSysUserId, adminInfoEntity.getSysUserId()), false);
|
||||||
|
if (Objects.isNull(clerkUserInfo)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
|
||||||
|
templateMessage.setTemplateId(template_id);
|
||||||
|
templateMessage.setToUser(clerkUserInfo.getOpenid());
|
||||||
|
templateMessage.setUrl(url);
|
||||||
|
List<WxMpTemplateData> data = new ArrayList<>();
|
||||||
|
data.add(new WxMpTemplateData("phone_number15", entity.getPhone()));
|
||||||
|
data.add(new WxMpTemplateData("thing11", entity.getNickname()));
|
||||||
|
data.add(new WxMpTemplateData("thing3", "有新的店员提交了审核,请前去查看"));
|
||||||
|
templateMessage.setData(data);
|
||||||
|
try {
|
||||||
|
proxyWxMpService().getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||||
|
} catch (WxErrorException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 发送新订单通知给店员
|
// 发送新订单通知给店员
|
||||||
// public void sendNewOrderMessageForClerk(PlayClerkUserInfoEntity clerkUserInfo, String orderNo, String commodityName, BigDecimal money) {
|
// public void sendNewOrderMessageForClerk(PlayClerkUserInfoEntity clerkUserInfo, String orderNo, String commodityName, BigDecimal money) {
|
||||||
// String touser = clerkUserInfo.getOpenid();
|
// String touser = clerkUserInfo.getOpenid();
|
||||||
|
|||||||
Reference in New Issue
Block a user