Commit 74c39ba4 by 墨竹

feat:空指针判断

parent 935ca2d8
......@@ -5,7 +5,6 @@ import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
......@@ -37,7 +36,6 @@ import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -55,9 +53,6 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
private static final Logger logger = getLogger(NoticeMessageApiServiceImpl.class);
@Autowired
private ClerkService clerkService;
@Autowired
private NoticeMessageTemplateService noticeMessageTemplateService;
@Autowired
......@@ -93,18 +88,8 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger.info("没有模板,无法发送消息:{}", messageQDTO.getTemplateCode());
return;
}
//stff存在 发送到staff上
String staffId = messageQDTO.getStaffId();
String wxUserId = null;
String wxEnterpriseId = null;
String storeId = "-1";
// if (StringUtils.isNotEmpty(messageQDTO.getClerkId())) {
// StaffClerkRelationDTO clerkRelationDTO = staffClerkRelationService.getByClerkId(messageQDTO.getClerkId());
// staffId = staffId == null ? clerkRelationDTO.getStaffId() : staffId;
// storeId = clerkRelationDTO.getStoreId();
// }
StaffClerkRelationDTO clerkRelationDTO = null;
if (StringUtils.isNotBlank(messageQDTO.getStaffId())) {
TabHaobanStaff haobanStaff = staffService.selectById(messageQDTO.getStaffId());
......@@ -252,15 +237,16 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
String corpid = wxEnterpriseDTO.getCorpid();
TabHaobanStaff tabHaobanStaff = staffService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId);
if (tabHaobanStaff == null) {
logger.error("未查询到员工:wxUserId:{}",wxUserId);
return;
}
if (corpid.length() > 20) {
wxUserId = tabHaobanStaff.getWxOpenUseId();
} else {
wxUserId = tabHaobanStaff.getWxUserId();
}
//后续map加判断可加参数
Map<String, String> map = new HashMap<>();
List<ItemDTO> items = contentList.stream().map(bo -> {
ItemDTO item = new ItemDTO();
item.setKey(bo.getKey());
......
......@@ -199,11 +199,14 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
//更新unionid
MemberUnionidRelated memberUnionidRelated = memberUnionidRelatedMapper.selectByPrimaryKey(externalClerkRelated.getMemberUnionidRelatedId());
memberUnionidRelated.setMemberId(memberId);
memberUnionidRelated.setUnionid(unionid);
memberUnionidRelated.setEnterpriseId(enterpriseId);
memberUnionidRelated.setUpdateTime(new Date());
memberUnionidRelatedMapper.updateByPrimaryKeySelective(memberUnionidRelated);
if (memberUnionidRelated != null) {
memberUnionidRelated.setMemberId(memberId);
memberUnionidRelated.setUnionid(unionid);
memberUnionidRelated.setEnterpriseId(enterpriseId);
memberUnionidRelated.setUpdateTime(new Date());
memberUnionidRelatedMapper.updateByPrimaryKeySelective(memberUnionidRelated);
}
//同步标签
pushTagSync(memberId, externalClerkRelated.getWxEnterpriseId(), enterpriseId);
//回调给会员,更新是否为企微好友
......
......@@ -664,9 +664,10 @@ public class MessageApiServiceImpl implements MessageApiService {
public String getNewWxUserId(String wxEnterpriseId, String wxUserId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
String corpid = wxEnterpriseDTO.getCorpid();
TabHaobanStaff tabHaobanStaff = staffService.selectByUserIdAndEnterpriseId(wxUserId, wxEnterpriseId);
if (tabHaobanStaff == null) {
return "";
}
if (corpid.length() > 20) {
wxUserId = tabHaobanStaff.getWxOpenUseId();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment