|
|
@@ -16,11 +16,9 @@
|
|
|
*/
|
|
|
package org.springblade.modules.desk.service.impl;
|
|
|
|
|
|
-import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.bank.cardswallow.entity.CardSwallow;
|
|
|
-import org.springblade.bank.checklist.vo.ChecklistVO;
|
|
|
import org.springblade.bank.goodsuse.entity.GoodsUse;
|
|
|
import org.springblade.bank.keypwd.entity.KeyPwd;
|
|
|
import org.springblade.bank.message.entity.Message;
|
|
|
@@ -28,9 +26,6 @@ import org.springblade.bank.postchange.entity.PostChange;
|
|
|
import org.springblade.bank.returns.entity.Returns;
|
|
|
import org.springblade.bank.sealhandover.entity.SealHandover;
|
|
|
import org.springblade.common.utils.hangxin.HangxinUtil;
|
|
|
-import org.springblade.common.utils.hangxin.bean.HangxinResultBean;
|
|
|
-import org.springblade.core.datascope.annotation.DataAuth;
|
|
|
-import org.springblade.core.datascope.enums.DataScopeEnum;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
@@ -40,6 +35,7 @@ import org.springblade.modules.desk.entity.Notice;
|
|
|
import org.springblade.modules.desk.mapper.NoticeMapper;
|
|
|
import org.springblade.modules.desk.service.INoticeService;
|
|
|
import org.springblade.modules.desk.vo.NoticeVO;
|
|
|
+import org.springblade.modules.publishevent.event.HangxinNoticeEvent;
|
|
|
import org.springblade.modules.system.entity.Dept;
|
|
|
import org.springblade.modules.system.entity.Role;
|
|
|
import org.springblade.modules.system.entity.User;
|
|
|
@@ -47,7 +43,7 @@ import org.springblade.modules.system.service.IDeptService;
|
|
|
import org.springblade.modules.system.service.IDictService;
|
|
|
import org.springblade.modules.system.service.IRoleService;
|
|
|
import org.springblade.modules.system.service.IUserService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
@@ -68,6 +64,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
private final IDeptService deptService;
|
|
|
private final IRoleService roleService;
|
|
|
|
|
|
+ private final ApplicationEventPublisher eventPublisher;
|
|
|
+
|
|
|
private HangxinUtil hangxinUtil;
|
|
|
|
|
|
@Override
|
|
|
@@ -103,7 +101,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
String join = StringUtil.join(userIdList);
|
|
|
notice.setTargetIds(join);
|
|
|
}
|
|
|
- /*if (notice.getTargetEhrs() == null){
|
|
|
+ if (notice.getTargetEhrs() == null){
|
|
|
String[] split = notice.getTargetIds().split(",");
|
|
|
List<String> userEhrList = new ArrayList<>();
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
@@ -111,13 +109,12 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
User user = userService.getById(userIdStr);
|
|
|
userEhrList.add(user.getEhr());
|
|
|
}
|
|
|
- notice.setTargetEhrs(userEhrList);
|
|
|
- }*/
|
|
|
-
|
|
|
- /*// 發送行信通知
|
|
|
- HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(notice.getTargetEhrs(), "提示進度", notice.getTitle());
|
|
|
- System.out.println(JSONUtil.toJsonStr(hangxinResultBean));*/
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
|
|
|
+ }
|
|
|
|
|
|
+ // 發送行信通知
|
|
|
+ HangxinNoticeEvent hangxinNoticeEvent = new HangxinNoticeEvent(notice);
|
|
|
+ eventPublisher.publishEvent(hangxinNoticeEvent);
|
|
|
return save(notice);
|
|
|
}
|
|
|
|
|
|
@@ -156,7 +153,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
notice.setTitle(title);
|
|
|
notice.setBusinessType("keypwd");
|
|
|
notice.setTargetIds(StringUtil.join(targetList));
|
|
|
-// notice.setTargetEhrs(userEhrtList);
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrtList, "|"));
|
|
|
+
|
|
|
return sendNotice(notice);
|
|
|
}
|
|
|
|
|
|
@@ -207,6 +205,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
notice.setDeptId(message.getDeptId());
|
|
|
notice.setRoleId(message.getRoleId());
|
|
|
notice.setTargetIds(message.getTargetIds());
|
|
|
+ notice.setContent("標題:" + message.getTitle() + ";內文:" + message.getContent());
|
|
|
|
|
|
String[] split = message.getTargetIds().split(",");
|
|
|
List<String> userEhrList = new ArrayList<>();
|
|
|
@@ -215,7 +214,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
User user = userService.getById(userIdStr);
|
|
|
userEhrList.add(user.getEhr());
|
|
|
}
|
|
|
-// notice.setTargetEhrs(userEhrList);
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
|
|
|
|
|
|
return sendNotice(notice);
|
|
|
}
|
|
|
@@ -251,7 +250,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
notice.setTitle(title);
|
|
|
notice.setBusinessType("sealhandover");
|
|
|
notice.setTargetIds(StringUtil.join(userList));
|
|
|
-// notice.setTargetEhrs(userEhrList);
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
|
|
|
return sendNotice(notice);
|
|
|
}
|
|
|
|
|
|
@@ -271,7 +270,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
User user = userService.getById(postChange.getPersonId());
|
|
|
List<String> userEhrList = new ArrayList<>();
|
|
|
userEhrList.add(user.getEhr());
|
|
|
-// notice.setTargetEhrs(userEhrList);
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
|
|
|
return sendNotice(notice);
|
|
|
}
|
|
|
|
|
|
@@ -291,7 +290,7 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
User user = userService.getById(goodsUse.getPersonId());
|
|
|
List<String> userEhrList = new ArrayList<>();
|
|
|
userEhrList.add(user.getEhr());
|
|
|
-// notice.setTargetEhrs(userEhrList);
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrList, "|"));
|
|
|
return sendNotice(notice);
|
|
|
}
|
|
|
|
|
|
@@ -327,13 +326,8 @@ public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> imp
|
|
|
notice.setDeptId(dept.getId() + "");
|
|
|
notice.setRoleId(StringUtil.join(roleIds));
|
|
|
notice.setTargetIds(StringUtil.join(userIds));
|
|
|
-// notice.setTargetEhrs(userEhrs);
|
|
|
-
|
|
|
- /*// 發送行信通知
|
|
|
- HangxinResultBean hangxinResultBean = hangxinUtil.sendMsg(userEhrs, "提示進度", title);
|
|
|
- System.out.println(JSONUtil.toJsonStr(hangxinResultBean));*/
|
|
|
+ notice.setTargetEhrs(StringUtil.join(userEhrs,"|"));
|
|
|
return sendNotice(notice);
|
|
|
-// return true;
|
|
|
}
|
|
|
|
|
|
private String getCategoryName(KeyPwd keyPwd){
|