Commit 0f259cc7 by 郑永强

解决导出消息通知收不到的问题

parent 03bda40a
......@@ -42,7 +42,7 @@ public interface SelfRobotKeywordBiz {
PageBeanNew<SelfRobotBookRecordDTO> getSelfRobotBookRecordList(Integer currentPage, Integer numPerPage);
void exportSelfRobotBookRecord(Long partyId);
void exportSelfRobotBookRecord(String systemCode,Long partyId);
Boolean hasKeyword (Long bookGroupId);
......
......@@ -764,7 +764,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
}
@Override
public void exportSelfRobotBookRecord(Long partyId) {
public void exportSelfRobotBookRecord(String systemCode, Long partyId) {
List<SelfRobotBookRecordDTO> list = selfRobotBookRecordDao.getAllSelfRobotBookRecordList();
if(ListUtils.isEmpty(list)) {
return;
......@@ -796,7 +796,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
}
// 发送消息
if (isSuccess) {
sendNotify(partyId, fileUrl, zipTitle);
sendNotify(systemCode, partyId, fileUrl, zipTitle);
}
});
}
......@@ -804,7 +804,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
/**
* 发送站内信
*/
private void sendNotify(Long partyId, String fileUrl, String fileName) {
private void sendNotify(String systemCode, Long partyId, String fileUrl, String fileName) {
JSONObject content = new JSONObject();
content.put("commitTime", DateUtils.formatDate(new Date()));
content.put("type", "书刊收录信息导出");
......@@ -813,7 +813,7 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
sendNotifyDto.setFromId(partyId);
sendNotifyDto.setToId(partyId);
sendNotifyDto.setNotifyContent(content.toJSONString());
sendNotifyDto.setSystemCode(SystemCode.pcloud.code);
sendNotifyDto.setSystemCode(systemCode);
sendNotifyDto.setTypeCode("wechat_learn_export");
sendNotifyDto.setResourceId(fileUrl);
sendNotifyDto.setFileName(fileName);
......
......@@ -5,11 +5,13 @@ import com.pcloud.book.keywords.entity.SelfRobotKeyword;
import com.pcloud.book.keywords.facade.SelfRobotKeywordFacade;
import com.pcloud.book.keywords.vo.LabelVO;
import com.pcloud.book.keywords.vo.SelfRobotReplyVO;
import com.pcloud.common.core.constant.SystemCode;
import com.pcloud.common.dto.ResponseDto;
import com.pcloud.common.exceptions.BizException;
import com.pcloud.common.permission.PermissionException;
import com.pcloud.common.utils.SessionUtil;
import com.pcloud.common.utils.cookie.Cookie;
import com.pcloud.wechatgroup.message.enums.IsSystem;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Description
......@@ -195,8 +198,17 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade {
@Override
public ResponseDto<?> exportSelfRobotBookRecord(@RequestHeader("token") String token) throws BizException, PermissionException {
Long partyId = (Long)SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
selfRobotKeywordBiz.exportSelfRobotBookRecord(partyId);
String systemCode = (String) SessionUtil.getVlaue(token, SessionUtil.SYSTEM_CODE);
if (!SystemCode.pcloud.code.equalsIgnoreCase(systemCode)) {
throw new PermissionException(PermissionException.PERMISSION_NOT_FOUND);
}
Map<String,Object> map = SessionUtil.getToken4Redis(token);
String isSystem = (String)map.get(SessionUtil.IS_SYSTEM);
Long partyId = (Long) map.get(SessionUtil.PARTY_ID);
if (IsSystem.NOT_SYSTEM.code.equals(isSystem)){
partyId = (Long) map.get(SessionUtil.MEMBER_ID);
}
selfRobotKeywordBiz.exportSelfRobotBookRecord(systemCode,partyId);
return new ResponseDto<>();
}
@Override
......
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