|
|
@@ -100,16 +100,19 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
StringBuffer str2=new StringBuffer();
|
|
|
//如果是白名单只通当事人不审核
|
|
|
if (my.getPublicPurview()==1){
|
|
|
- str2=str2.append("业务员(无需审核),发起对您的企业");
|
|
|
+ str2=str2.append(my.getName()).append("业务员(无需审核),发起对您的企业");
|
|
|
str2=str2.append("[").append(u.getNickname()).append("]发起公出。");
|
|
|
+
|
|
|
+ sendNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
}else {
|
|
|
- str2=str2.append("(需审核),发起对您的企业");
|
|
|
+
|
|
|
+ str2=str2.append(my.getName()).append("(需审核),发起对您的企业");
|
|
|
str2=str2.append("[").append(u.getNickname()).append("]发起公出。");
|
|
|
+ sendEmailAndNoticeAndSoucket(u.getAid(),3,str2.toString());
|
|
|
//不是自己的企业则需要审核并设置非自己客户待审核
|
|
|
addPublicExamine(in.getId(),u.getAid());
|
|
|
- if(in.getPublicType()==0)in.setPublicType(1);
|
|
|
+ if(in.getPublicType()==null||in.getPublicType()==0)in.setPublicType(1);
|
|
|
}
|
|
|
- addWeChatNotice(u.getAid(),1,str2.toString(),in.getId());
|
|
|
}
|
|
|
prd.setPrid(in.getId());
|
|
|
prd.setUid(s);
|
|
|
@@ -185,8 +188,6 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
sendEmail(my, a,1);
|
|
|
}
|
|
|
map.put("code", res);
|
|
|
-
|
|
|
-
|
|
|
}else {
|
|
|
sendEmail(my, a,1);
|
|
|
map.put("code", 2);
|
|
|
@@ -205,11 +206,28 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
return sb.deleteCharAt(sb.length() - 1).toString();
|
|
|
}
|
|
|
|
|
|
+ private void sendEmailAndNoticeAndSoucket(String id,Integer type,String content){
|
|
|
+ sendNoticeAndSoucket(id,type,content);
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(id);
|
|
|
+ String title="暂无标题";
|
|
|
+ if (type==3)title=NoticeStatus.PUBLIC_OTHERS_USER.getDesc();
|
|
|
+ EmailBo emailBo=new EmailBo(title,admin.getEmail(),content);
|
|
|
+ asyncUtils.send(emailBo);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param id 接受者编号
|
|
|
+ * @param type 状态 0驳回 1发起 2同意 3 公出他人企业
|
|
|
+ * @param content 内容
|
|
|
+ */
|
|
|
private void sendNoticeAndSoucket(String id,Integer type,String content) {
|
|
|
Integer noticeType=NoticeStatus.PUBLIC_RELEASE_START.getCode();
|
|
|
if(type==0)noticeType=NoticeStatus.PUBLIC_RELEASE_NO.getCode();
|
|
|
else if (type==2)noticeType=NoticeStatus.PUBLIC_RELEASE_YES.getCode();
|
|
|
+ else if (type==3)noticeType=NoticeStatus.PUBLIC_OTHERS_USER.getCode();
|
|
|
+ //触发通知有未读消息
|
|
|
systemWebSocketHandler.sendMessageToUser(id, new TextMessage("unread"));
|
|
|
Notice n =new Notice();
|
|
|
n.setId(UUID.randomUUID().toString());
|
|
|
@@ -237,6 +255,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public int updatePublicRelease(InputPublicRelease in) {
|
|
|
Date date = new Date();
|