|
|
|
@@ -6,8 +6,11 @@ import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import com.simple.common.Result; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
import com.simple.domain.po.WxCUser; |
|
|
|
import com.simple.domain.po.WxMsg; |
|
|
|
import com.simple.domain.po.WxMsgConfig; |
|
|
|
import com.simple.mapper.WxCUserMapper; |
|
|
|
import com.simple.mapper.WxCUserTagsMapper; |
|
|
|
import com.simple.mapper.WxMsgConfigMapper; |
|
|
|
import com.simple.mapper.WxMsgMapper; |
|
|
|
import com.simple.service.WxMsgService; |
|
|
|
@@ -29,6 +32,12 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
@Autowired |
|
|
|
WxMsgConfigMapper wxMsgConfigMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCUserTagsMapper wxCUserTagsMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCUserMapper wxCUserMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgMapper.findList(record)); |
|
|
|
@@ -55,7 +64,7 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
} |
|
|
|
|
|
|
|
if(phones.equals("")){ |
|
|
|
return new ResultData(Result.SUCCESS, "您需要添 加要发送的手机号"); |
|
|
|
return new ResultData(Result.SUCCESS, "您需要添加要发送的手机号"); |
|
|
|
} |
|
|
|
|
|
|
|
if (wxMsg.getId() == null) { |
|
|
|
@@ -108,8 +117,26 @@ public class WxMsgServiceImpl implements WxMsgService { |
|
|
|
} |
|
|
|
|
|
|
|
private String parselabel(String label) { |
|
|
|
|
|
|
|
return null; |
|
|
|
String[] arys = label.split(","); |
|
|
|
List<Long> tagids = new ArrayList<>(); |
|
|
|
for (int i = 0; i < arys.length; i++) { |
|
|
|
tagids.add(Long.parseLong(arys[i])); |
|
|
|
} |
|
|
|
List<Long> userIds = wxCUserTagsMapper.findUserByTag(tagids); |
|
|
|
if(userIds.size()==0) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
WxCUser wxCUser = new WxCUser(); |
|
|
|
wxCUser.setIds(userIds); |
|
|
|
List<WxCUser> list = wxCUserMapper.findList(wxCUser); |
|
|
|
StringBuilder sb=new StringBuilder(); |
|
|
|
if(list.size()>0){ |
|
|
|
for(WxCUser cuser:list){ |
|
|
|
sb.append(cuser.getPhone()).append(","); |
|
|
|
} |
|
|
|
return sb.toString(); |
|
|
|
} |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
private String parseexcle(String excelpath) { |
|
|
|
|