From 651a15c78f668bef3859d9ed1bb7ad0b669d3600 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 03 七月 2020 17:52:07 +0800 Subject: [PATCH] 多APP优化 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java | 74 +++++++++++++++++++----------------- 1 files changed, 39 insertions(+), 35 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java index 27d389a..3d64611 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/cloud/UserCloudServiceImpl.java @@ -8,6 +8,9 @@ import javax.annotation.Resource; +import com.yeshi.fanli.entity.SystemEnum; +import com.yeshi.fanli.exception.taobao.TaoBaoConvertLinkException; +import com.yeshi.fanli.service.manger.goods.TaoBaoLinkManager; import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -73,6 +76,7 @@ import com.yeshi.fanli.service.inter.user.cloud.UserCloudService; import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; +import com.yeshi.fanli.service.manger.msg.RocketMQManager; import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.ImageToBase64; import com.yeshi.fanli.util.MoneyBigDecimalUtil; @@ -134,23 +138,13 @@ @Resource private PinDuoDuoCacheUtil pinDuoDuoCacheUtil; - @Resource - private QrCodeService qrCodeService; + @Resource private RedisManager redisManager; @Resource - private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; - - @Resource - private HongBaoManageService hongBaoManageService; - - @Resource private ShareGoodsTextTemplateService shareGoodsTextTemplateService; - - @Resource - private CommonGoodsService commonGoodsService; @Resource private UserCloudSendRecordService userCloudSendRecordService; @@ -161,8 +155,8 @@ @Resource private UserCloudManageService userCloudManageService; - @Resource(name = "producer") - private Producer producer; + @Resource + private RocketMQManager rocketMQManager; @Resource private UserOtherMsgNotificationService userOtherMsgNotificationService; @@ -170,11 +164,11 @@ @Resource private PushService pushService; - @Resource - private UserSystemMsgService userSystemMsgService; - @Resource(name = "taskExecutor") private TaskExecutor executor; + + @Resource + private TaoBaoLinkManager taoBaoLinkManager; @Override public UserCloud getValidByUid(Long uid) { @@ -556,6 +550,8 @@ listImg.add(imgInfo.getUrl()); } } + + String wxId = userCloud.getWxId(); Integer robotId = userCloud.getRobotId(); @@ -629,10 +625,10 @@ if (macsend) sendContent.setTitle(title); } - + SystemEnum system=userInfoService.getUserSystem(uid); // 鍙戦�佸浘鐗� int num = 1; - String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey()); + String picNum = configService.getValue(ConfigKeyEnum.robotCloudGroupPictureNum.getKey(),system); if (!StringUtil.isNullOrEmpty(picNum)) { num = Integer.parseInt(picNum); } @@ -868,7 +864,6 @@ * 娣樺疂鍟嗗搧淇℃伅澶勭悊 * * @param user - * @param inviteCode * @param robotId * @param wxId * @param goodsId @@ -880,8 +875,8 @@ List<UserCloudGroup> listOpen, String pid) throws UserCloudException { TaoBaoLink taoBaoLink = null; try { - taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsId, relationId); - } catch (ShareGoodsException e) { + taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(user.getId(), goodsId, relationId,null); + } catch (TaoBaoConvertLinkException e) { LogHelper.errorDetailInfo(e); throw new UserCloudException(1, "璇ュ晢鍝佸凡涓嬫灦"); } @@ -904,12 +899,14 @@ } String sales = TaoBaoUtil.getSaleCount(goods.getBiz30day()); + SystemEnum system=userInfoService.getUserSystem(user.getId()); + // 鑾峰彇鎺ㄨ崘璇� String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getTitle(), sales, - couponAmount, description); + couponAmount, description,system); // 鑾峰彇璇勮璇� String commentText = shareGoodsTextTemplateService.getCommentTextByTaoToken(coupon, taoBaoLink.getTaoToken(), - goods.getZkPrice().toString(), quanPrice); + goods.getZkPrice().toString(), quanPrice,system); // 寮傛鎵ц鍙戦�� executor.execute(new Runnable() { @@ -960,9 +957,11 @@ String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days()); + SystemEnum system=userInfoService.getUserSystem(user.getId()); + // 鑾峰彇鎺ㄨ崘璇� String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, jdGoods.getSkuName(), sales, - couponAmount, null); + couponAmount, null,system); // 鑾峰彇璇勮璇� BigDecimal price = jdGoods.getPrice(); @@ -972,7 +971,7 @@ } String zkPrice = BigDecimalUtil.getWithNoZera(price).toString(); String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice, - ConfigKeyEnum.quickShareJDCommentText); + ConfigKeyEnum.quickShareJDCommentText,system); // 寮傛鎵ц鍙戦�� executor.execute(new Runnable() { @@ -1022,15 +1021,17 @@ sales = "0"; } + SystemEnum system=userInfoService.getUserSystem(user.getId()); + // 鑾峰彇鎺ㄨ崘璇� String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), sales, - couponAmount, null); + couponAmount, null,system); // 鑾峰彇璇勮璇� String zkPrice = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), new BigDecimal(100)) .setScale(2).toString(); String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice, - ConfigKeyEnum.quickSharePDDCommentText); + ConfigKeyEnum.quickSharePDDCommentText,system); List<String> list = null; String[] goodsGalleryUrls = goods.getGoodsGalleryUrls(); @@ -1074,12 +1075,13 @@ boolean coupon = false; String quanPrice = ""; String couponAmount = ""; + SystemEnum system=userInfoService.getUserSystem(user.getId()); // 鑾峰彇鎺ㄨ崘璇� String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), null, - couponAmount, null); + couponAmount, null,system); // 鑾峰彇璇勮璇� String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, - goods.getMarketPrice(), quanPrice, ConfigKeyEnum.quickShareVIPCommentText); + goods.getMarketPrice(), quanPrice, ConfigKeyEnum.quickShareVIPCommentText,system); // 寮傛鎵ц鍙戦�� executor.execute(new Runnable() { @@ -1120,12 +1122,14 @@ coupon = true; } + SystemEnum system=userInfoService.getUserSystem(user.getId()); + // 鑾峰彇鎺ㄨ崘璇� String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, - goods.getCommodityInfo().getCommodityName(), sales, couponAmount, null); + goods.getCommodityInfo().getCommodityName(), sales, couponAmount, null,system); // 鐢熸垚蹇嵎鍒嗕韩鍐呭 - String template = configService.get(ConfigKeyEnum.quickShareSuNingCommentText.getKey()); + String template = configService.getValue(ConfigKeyEnum.quickShareSuNingCommentText.getKey(),system); String commentText = shareGoodsTextTemplateService.createQuickShareTextSuNing(template, goods, jumpLink); List<String> imgList = new ArrayList<>(); @@ -1197,10 +1201,10 @@ if (macsend) sendContent.setTitle(title); } - + SystemEnum system=userInfoService.getUserSystem(uid); // 鍙戦�佸浘鐗� int num = 1; - String picNum = configService.get(ConfigKeyEnum.robotCloudGroupPictureNum.getKey()); + String picNum = configService.getValue(ConfigKeyEnum.robotCloudGroupPictureNum.getKey(),system); if (!StringUtil.isNullOrEmpty(picNum)) { num = Integer.parseInt(picNum); } @@ -1290,7 +1294,7 @@ UserCloudMQMsg msg = new UserCloudMQMsg(uid, evaluateId, UserCloudMQMsg.TYPE_EVALUATE); Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg); - producer.send(message); + rocketMQManager.sendNormalMsg(message, null); } } catch (Exception e) { LogHelper.errorDetailInfo(e); @@ -1324,7 +1328,7 @@ UserCloudMQMsg msg = new UserCloudMQMsg(uid, UserCloudMQMsg.TYPE_PUSH); Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg); message.setStartDeliverTime(java.lang.System.currentTimeMillis() + 1000 * 60 * 10); - producer.send(message); + rocketMQManager.sendNormalMsg(message, null); } // 鏇存柊宸叉彁閱� -- Gitblit v1.8.0