|
@@ -115,19 +115,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
List<Integer> targetRoleIds = sysRoleMapper.selectList(new QueryWrapper<SysRole>().eq("company_id", user.getCompanyId()).in("id", roleIds))
|
|
List<Integer> targetRoleIds = sysRoleMapper.selectList(new QueryWrapper<SysRole>().eq("company_id", user.getCompanyId()).in("id", roleIds))
|
|
.stream().map(sl -> sl.getId()).distinct().collect(Collectors.toList());
|
|
.stream().map(sl -> sl.getId()).distinct().collect(Collectors.toList());
|
|
List<User> targetUserList = userMapper.selectList(new QueryWrapper<User>().in("role_id", targetRoleIds));
|
|
List<User> targetUserList = userMapper.selectList(new QueryWrapper<User>().in("role_id", targetRoleIds));
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
|
- if(CollectionUtils.isNotEmpty(targetUserList)) {
|
|
|
|
- for (int i = 0; i < targetUserList.size(); i++) {
|
|
|
|
- if(targetUserList.get(i).getCorpwxUserid()==null){
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- if (i == 0) {
|
|
|
|
- sb.append(targetUserList.get(i).getCorpwxUserid());
|
|
|
|
- } else {
|
|
|
|
- sb.append("|").append(targetUserList.get(i).getCorpwxUserid());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ String corpUserString = targetUserList.stream().map(tl -> tl.getCorpwxUserid()).collect(Collectors.joining("|"));
|
|
User targetUser = userMapper.selectById(sheet.getOwnerId());
|
|
User targetUser = userMapper.selectById(sheet.getOwnerId());
|
|
//推送到企业微信
|
|
//推送到企业微信
|
|
JSONObject json=new JSONObject();
|
|
JSONObject json=new JSONObject();
|
|
@@ -155,7 +143,7 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
|
|
json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
|
|
json.put("template_id","tty9TkCAAALUiWvjdoDg_PZf48gwucZA");
|
|
json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=expense#wechat_redirect");
|
|
json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=expense#wechat_redirect");
|
|
json.put("content_item",dataJson);
|
|
json.put("content_item",dataJson);
|
|
- wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,sb.toString(), json);
|
|
|
|
|
|
+ wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo,corpUserString, json);
|
|
List<Information> informationList=new ArrayList<>();
|
|
List<Information> informationList=new ArrayList<>();
|
|
for (User item : targetUserList) {
|
|
for (User item : targetUserList) {
|
|
Information information=new Information();
|
|
Information information=new Information();
|