Commit 2ab24ae6 by lili

模板消息修改

parent 542cebcc
...@@ -9,6 +9,7 @@ import java.util.Map; ...@@ -9,6 +9,7 @@ import java.util.Map;
import com.pcloud.book.appeal.dao.BookAppealResultDao; import com.pcloud.book.appeal.dao.BookAppealResultDao;
import com.pcloud.book.appeal.entity.BookAppealResult; import com.pcloud.book.appeal.entity.BookAppealResult;
import com.pcloud.book.consumer.user.ChannelConsr; import com.pcloud.book.consumer.user.ChannelConsr;
import com.pcloud.common.utils.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -415,8 +416,8 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -415,8 +416,8 @@ public class BookAppealBizImpl implements BookAppealBiz {
String channelName = channelConsr.getNameById(channelId); String channelName = channelConsr.getNameById(channelId);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "编辑变更"); temParam.put("first", "编辑变更");
temParam.put("keyword1", "RAYS编辑"); temParam.put("keyword2", "RAYS编辑");
temParam.put("keyword2", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "已将您设置为主编辑,请尽快去PC端配置书刊的相关资源等信息"); temParam.put("keyword1", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "已将您设置为主编辑,请尽快去PC端配置书刊的相关资源等信息");
temParam.put("keyword3", "通知"); temParam.put("keyword3", "通知");
temParam.put("remark", "请抽空处理"); temParam.put("remark", "请抽空处理");
templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "", templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "",
...@@ -438,8 +439,8 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -438,8 +439,8 @@ public class BookAppealBizImpl implements BookAppealBiz {
String channelName = channelConsr.getNameById(channelId); String channelName = channelConsr.getNameById(channelId);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "编辑变更"); temParam.put("first", "编辑变更");
temParam.put("keyword1", "RAYS编辑"); temParam.put("keyword2", "RAYS编辑");
temParam.put("keyword2", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "被申诉成功,已被移除,请知悉"); temParam.put("keyword1", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "被申诉成功,已被移除,请知悉");
temParam.put("keyword3", "通知"); temParam.put("keyword3", "通知");
temParam.put("remark", "请抽空处理"); temParam.put("remark", "请抽空处理");
templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "", templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "",
...@@ -461,8 +462,8 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -461,8 +462,8 @@ public class BookAppealBizImpl implements BookAppealBiz {
String channelName = channelConsr.getNameById(channelId); String channelName = channelConsr.getNameById(channelId);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "编辑变更"); temParam.put("first", "编辑变更");
temParam.put("keyword1", "RAYS编辑"); temParam.put("keyword2", "RAYS编辑");
temParam.put("keyword2", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "被申诉成功,已将您设置为副编辑,请知悉"); temParam.put("keyword1", "您在"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "被申诉成功,已将您设置为副编辑,请知悉");
temParam.put("keyword3", "通知"); temParam.put("keyword3", "通知");
temParam.put("remark", "请抽空处理"); temParam.put("remark", "请抽空处理");
templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "", templateConsr.sendManage(SceneCode.PROJECT_TASK_SCENE.value, agentId, adviserId, SystemCode.adviser.code, "",
...@@ -485,9 +486,10 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -485,9 +486,10 @@ public class BookAppealBizImpl implements BookAppealBiz {
String channelName = channelConsr.getNameById(channelId); String channelName = channelConsr.getNameById(channelId);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "恭喜您,您申请的" + channelName + "运营的书刊" + StringUtil.addBracket(bookName) + "申诉成功"); temParam.put("first", "恭喜您,您申请的" + channelName + "运营的书刊" + StringUtil.addBracket(bookName) + "申诉成功");
temParam.put("keyword1", "书刊申诉审核"); temParam.put("keyword2", "书刊申诉审核");
temParam.put("keyword2", "书刊申诉"); temParam.put("keyword1", "书刊申诉");
temParam.put("keyword3", "申诉通过"); temParam.put("keyword3", "申诉通过");
temParam.put("keyword4", DateUtils.formatDate(new Date()));
temParam.put("remark", "书刊已加入您的书刊列表,您是主编辑,请去PC端配置书刊的相关资源"); temParam.put("remark", "书刊已加入您的书刊列表,您是主编辑,请去PC端配置书刊的相关资源");
templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId, adviserId, SystemCode.adviser.code, templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId, adviserId, SystemCode.adviser.code,
"", temParam, SendType.SEND_BY_PARTY_ID.value, false); "", temParam, SendType.SEND_BY_PARTY_ID.value, false);
...@@ -509,9 +511,10 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -509,9 +511,10 @@ public class BookAppealBizImpl implements BookAppealBiz {
String channelName = channelConsr.getNameById(channelId); String channelName = channelConsr.getNameById(channelId);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "恭喜您,您申请的" + channelName + "运营的书刊"+StringUtil.addBracket(bookName)+"申诉成功"); temParam.put("first", "恭喜您,您申请的" + channelName + "运营的书刊"+StringUtil.addBracket(bookName)+"申诉成功");
temParam.put("keyword1", "书刊申诉审核"); temParam.put("keyword2", "书刊申诉审核");
temParam.put("keyword2", "书刊申诉"); temParam.put("keyword1", "书刊申诉");
temParam.put("keyword3", "申诉通过"); temParam.put("keyword3", "申诉通过");
temParam.put("keyword4", DateUtils.formatDate(new Date()));
temParam.put("remark", "书刊已加入您的书刊列表,您是副编辑,可直接共享书刊配套资源"); temParam.put("remark", "书刊已加入您的书刊列表,您是副编辑,可直接共享书刊配套资源");
templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId, adviserId, SystemCode.adviser.code, templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId, adviserId, SystemCode.adviser.code,
"", temParam, SendType.SEND_BY_PARTY_ID.value, false); "", temParam, SendType.SEND_BY_PARTY_ID.value, false);
...@@ -531,9 +534,10 @@ public class BookAppealBizImpl implements BookAppealBiz { ...@@ -531,9 +534,10 @@ public class BookAppealBizImpl implements BookAppealBiz {
Long agentId = adviserConsr.getAgentIdByAdviser(declarant); Long agentId = adviserConsr.getAgentIdByAdviser(declarant);
Map<String, String> temParam = new HashMap<>(); Map<String, String> temParam = new HashMap<>();
temParam.put("first", "很抱歉,您申请的"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "申诉未通过审核"); temParam.put("first", "很抱歉,您申请的"+channelName+"运营的书刊" + StringUtil.addBracket(bookName) + "申诉未通过审核");
temParam.put("keyword1", "书刊申诉审核"); temParam.put("keyword2", "书刊申诉审核");
temParam.put("keyword2", "书刊申诉"); temParam.put("keyword1", "书刊申诉");
temParam.put("keyword3", "申诉不通过"); temParam.put("keyword3", "申诉不通过");
temParam.put("keyword4", DateUtils.formatDate(new Date()));
temParam.put("remark", "申诉不通过,原因:" + auditReason); temParam.put("remark", "申诉不通过,原因:" + auditReason);
templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId, templateConsr.sendManage(SceneCode.TASK_HANDLE_RESULT_SCENE.value, agentId,
declarant, SystemCode.adviser.code, "", temParam, declarant, SystemCode.adviser.code, "", temParam,
......
...@@ -373,18 +373,6 @@ public interface BookBiz { ...@@ -373,18 +373,6 @@ public interface BookBiz {
PageBean listBook4App(Long adviserId, PageParam pageParam, String bookName); PageBean listBook4App(Long adviserId, PageParam pageParam, String bookName);
/** /**
* 更新图书模板
*
* @param book
* 图书基本信息实体类
* @param adviserId
* 编辑标识
* @param agentId
* 代理标识
*/
Long updateBookTemplet(Book book, Long adviserId, Long agentId);
/**
* 获取应用关联图书 * 获取应用关联图书
* *
* @param appId * @param appId
......
...@@ -139,24 +139,7 @@ public class BookBizImpl implements BookBiz { ...@@ -139,24 +139,7 @@ public class BookBizImpl implements BookBiz {
bookDto.setTempletId(book.getTempletId()); bookDto.setTempletId(book.getTempletId());
// 如果是编辑创建的书籍、默认建立编辑与书籍的推广关系 // 如果是编辑创建的书籍、默认建立编辑与书籍的推广关系
if (SystemCode.adviser.code.equalsIgnoreCase(systemCode)) { if (SystemCode.adviser.code.equalsIgnoreCase(systemCode)) {
BookAdviser bookAdviser = new BookAdviser(); setBookAdviserRelation(book);
bookAdviser.setBookId(bookDto.getBookId());
bookAdviser.setAdviserId(book.getCreatedUser());
bookAdviser.setChannelId(book.getChannelId());
bookAdviser.setCreatedUser(book.getCreatedUser());
bookAdviser.setTempletId(book.getTempletId());
bookAdviserBiz.create(bookAdviser);
// 创建默认数据(二维码及二维码对应数据)
if (book.getTempletId() != null) {
Long sceneId = qrcodeSceneConsr.createDefualtByTemplet(book.getTempletId(), book.getChannelId(),
book.getCreatedUser(), book.getAgentId(), book.getBookId(), null);
bookDto.setSceneId(sceneId);
}
// 二维码不为空的时候,将图书与该二维码关联起来
if (book.getSceneId() != null) {
// 关联二维码
qrcodeSceneConsr.relationQr(book.getBookId(), book.getSceneId(), book.getCreatedUser());
}
} }
// 书籍总数缓存加1 // 书籍总数缓存加1
bookCache.incrObject(BookConstant.BOOK_CACHE + "PLATFORM_BOOK_COUNT"); bookCache.incrObject(BookConstant.BOOK_CACHE + "PLATFORM_BOOK_COUNT");
...@@ -250,18 +233,6 @@ public class BookBizImpl implements BookBiz { ...@@ -250,18 +233,6 @@ public class BookBizImpl implements BookBiz {
BookDto bookDto = new BookDto(); BookDto bookDto = new BookDto();
bookDto.setBookId(book.getBookId()); bookDto.setBookId(book.getBookId());
bookDto.setTempletId(book.getTempletId()); bookDto.setTempletId(book.getTempletId());
// 创建默认数据(二维码及二维码对应数据)
if (book.getTempletId() != null) {
Long sceneId = qrcodeSceneConsr.createDefualtByTemplet(book.getTempletId(), book.getChannelId(),
book.getCreatedUser(), book.getAgentId(), book.getBookId(), null);
bookDto.setSceneId(sceneId);
}
// 二维码不为空的时候,将图书与该二维码关联起来
if (book.getSceneId() != null) {
// 关联二维码
qrcodeSceneConsr.relationQr(book.getBookId(), book.getSceneId(), book.getCreatedUser());
}
// 清除redis中数据 // 清除redis中数据
bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber()); bookCache.clearRedisByBook(book.getBookId(), book.getIsbn(), book.getSerialNumber());
checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg()); checkIsUpdateCoverImgAndSendTopic(bookDto, book.getCoverImg());
...@@ -1109,22 +1080,6 @@ public class BookBizImpl implements BookBiz { ...@@ -1109,22 +1080,6 @@ public class BookBizImpl implements BookBiz {
} }
/** /**
* 更新图书模板
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Long updateBookTemplet(Book book, Long adviserId, Long agentId) {
LOGGER.info("书刊-更新图书模板,<START>.[ book]=" + book);
if (book.getBookId() == null || book.getTempletId() == null || book.getChannelId() == null) {
throw new BookBizException(BookBizException.PARAM_IS_NULL, "参数缺失,请稍后重试");
}
bookAdviserBiz.updateBookTemplet(book.getBookId(), book.getChannelId(), adviserId, book.getTempletId());
Long sceneId = qrcodeSceneConsr.createDefualtByTemplet(book.getTempletId(), book.getChannelId(), adviserId,
agentId, book.getBookId(), book.getSceneId());
return sceneId;
}
/**
* 获取应用关联图书 * 获取应用关联图书
*/ */
@Override @Override
......
...@@ -365,16 +365,6 @@ public interface BookFacade { ...@@ -365,16 +365,6 @@ public interface BookFacade {
throws BizException, PermissionException, JsonParseException; throws BizException, PermissionException, JsonParseException;
/** /**
* 更新图书模板
*/
@ApiOperation(value = "更新图书模板", httpMethod = "POST")
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", dataType = "string", paramType = "header"),
@ApiImplicitParam(name = "book", value = "书籍实体", dataType = "Book", paramType = "body")})
@RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST)
ResponseDto<?> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException, JsonParseException;
/**
* 获取应用关联的图书 * 获取应用关联的图书
*/ */
@ApiOperation(value = "获取应用关联的图书", httpMethod = "GET") @ApiOperation(value = "获取应用关联的图书", httpMethod = "GET")
......
...@@ -530,21 +530,6 @@ public class BookFacadeImpl implements BookFacade { ...@@ -530,21 +530,6 @@ public class BookFacadeImpl implements BookFacade {
} }
/** /**
* 更新图书模板
*/
@Override
@RequestMapping(value = "updateBookTemplet", method = RequestMethod.POST)
public ResponseDto<BookDto> updateBookTemplet(@RequestHeader("token") String token, @RequestBody Book book)
throws BizException, PermissionException {
Long adviserId = (Long) SessionUtil.getVlaue(token, SessionUtil.PARTY_ID);
Long agentId = (Long) SessionUtil.getVlaue(token, SessionUtil.TENANT_ID);
BookDto bookDto = new BookDto();
bookDto.setSceneId(bookBiz.updateBookTemplet(book, adviserId, agentId));
bookDto.setTempletId(book.getTempletId());
return new ResponseDto<>(bookDto);
}
/**
* 获取应用关联图书 * 获取应用关联图书
*/ */
@Override @Override
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
*/ */
package com.pcloud.book.consumer.channel; package com.pcloud.book.consumer.channel;
import com.pcloud.book.base.exception.BookBizException; import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.channelcenter.qrcode.dto.DefaultTempletQrcode; import com.pcloud.channelcenter.qrcode.dto.DefaultTempletQrcode;
import com.pcloud.channelcenter.qrcode.service.QrcodeSceneService; import com.pcloud.channelcenter.qrcode.service.QrcodeSceneService;
...@@ -133,37 +132,6 @@ public class QrcodeSceneConsr { ...@@ -133,37 +132,6 @@ public class QrcodeSceneConsr {
} }
/** /**
* 默认生成二维码以及对应数据
*/
public Long createDefualtByTemplet(Long templetId, Long channelId, Long adviserId, Long agentId, Long bookId,
Long sceneId) throws BizException {
LOGGER.info("【二维码-渠道(消)】默认生成二维码以及对应数据,<START>.[templetId]=" + templetId + ",[channelId]=" + channelId
+ ",[adviserId]=" + adviserId + ",[agentId]=" + agentId + ",[bookId]=" + bookId + ",[sceneId]="
+ sceneId);
try {
DefaultTempletQrcode defaultTempletQrcode = new DefaultTempletQrcode();
defaultTempletQrcode.setTempletId(templetId);
defaultTempletQrcode.setAgentId(agentId);
defaultTempletQrcode.setBookId(bookId);
defaultTempletQrcode.setChannelId(channelId);
defaultTempletQrcode.setSceneId(sceneId);
defaultTempletQrcode.setAdviserId(adviserId);
LOGGER.info("【二维码-渠道(消)】默认生成二维码以及对应数据,<START>.defaultTempletQrcode=" + defaultTempletQrcode);
ResponseEntity<ResponseDto<Long>> createDefualtByTemplet = qrcodeSceneService
.createDefualtByTemplet(defaultTempletQrcode);
sceneId = ResponseHandleUtil.parseResponse(createDefualtByTemplet, Long.class);
} catch (BizException e) {
LOGGER.warn("【二维码-渠道(消)】默认生成二维码以及对应数据[qrcodeSceneService.createDefualtByTemplet]:" + e.getMessage(), e);
throw new BizException(e.getCode(), e.getMessage());
} catch (Exception e) {
LOGGER.error("【二维码-渠道(消)】默认生成二维码以及对应数据,<ERROR>.[create]:" + e.getMessage(), e);
throw new BookBizException(BookBizException.INVOKE_CHANNEL_ERROR, "默认生成二维码以及对应数据失败~!");
}
LOGGER.info("【二维码-渠道(消)】默认生成二维码以及对应数据,<END>");
return sceneId;
}
/**
* 图书关联二维码 * 图书关联二维码
*/ */
public Long relationQr(Long bookId, Long sceneId, Long adviserId) throws BizException { public Long relationQr(Long bookId, Long sceneId, Long adviserId) throws BizException {
......
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