Commit f8d1acb0 by 徐高华

群发

parent ac1159a7
......@@ -74,7 +74,6 @@ public class QywxSendServiceImpl implements QywxSendService {
@Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
@Override
public ServiceResponse<String> sendMessage(String wxEnterpriseId, String staffId, List<String> extendUserList,
List<String> materialIdList) {
......@@ -112,13 +111,13 @@ public class QywxSendServiceImpl implements QywxSendService {
JSONResponse respon = qywxSuiteApiService.sendExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
messageDTO);
log.info("群发消息={},返回={}", JSON.toJSONString(messageDTO), JSON.toJSONString(respon));
String error = respon.getErrorMessage() ;
Map<String, Object> returnMap = respon.getReturnMap();
String msgIdKey = "msgid";
String msgId = returnMap.get(msgIdKey) == null ? "" : returnMap.get(msgIdKey).toString();
if (StringUtils.isNotEmpty(msgId)) {
return ServiceResponse.success(msgId);
}
String error = respon.getErrorMessage();
return ServiceResponse.failure("9999", error);
}
......@@ -128,7 +127,7 @@ public class QywxSendServiceImpl implements QywxSendService {
String imageUrl = dto.getImgUrl();
int type = dto.getMaterialType();
String md5 = Md5Util.MD5(imageUrl);
TabMaterialContent tab = this.tabMaterialContentMapper.selectByUrl(wxEnterpriseId, md5,mediaType);
TabMaterialContent tab = this.tabMaterialContentMapper.selectByUrl(wxEnterpriseId, md5, mediaType);
if (null != tab) {
materialIdList.add(tab.getMaterialId());
} else {
......@@ -159,8 +158,8 @@ public class QywxSendServiceImpl implements QywxSendService {
text.setContent(dto.getContent());
moment.setText(text);
List<String> sendUser = new ArrayList<>();
if(CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure("9999", "无导购") ;
if (CollectionUtils.isEmpty(clerkIdList)) {
return ServiceResponse.failure("9999", "无导购");
}
List<StaffClerkRelationDTO> clerkList = this.tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIdList,
wxEnterpriseId);
......@@ -199,7 +198,7 @@ public class QywxSendServiceImpl implements QywxSendService {
if (CollectionUtils.isNotEmpty(materialIdList)) {
materialIdList.forEach(materialId -> {
MaterialDTO material = materialService.getHasChangeMadieMaterialById(materialId, from);
log.info("JSON={}",JSON.toJSONString(material));
log.info("JSON={}", JSON.toJSONString(material));
if (material == null) {
return;
}
......
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