|
@@ -1,99 +0,0 @@
|
|
|
-package com.tzy.sportcard.mq;
|
|
|
|
|
-
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
-import com.rabbitmq.client.Channel;
|
|
|
|
|
-import com.tzy.app.mapper.TzyMerchantGroupMapper;
|
|
|
|
|
-import com.tzy.base.dto.base.IMMstNoticeAdditionalInfo;
|
|
|
|
|
-import com.tzy.base.dto.base.IMMstNoticeInfo;
|
|
|
|
|
-import com.tzy.base.service.SysBaseService;
|
|
|
|
|
-import com.tzy.common.constant.MqConstans;
|
|
|
|
|
-import com.tzy.goods_act.service.IGoodsActRecordService;
|
|
|
|
|
-import com.tzy.sportcard.group.domain.CardGroupInfo;
|
|
|
|
|
-import com.tzy.sportcard.group.domain.TzyMerchantInfo;
|
|
|
|
|
-import com.tzy.sportcard.group.dto.GroupAppSubmitReviewParam;
|
|
|
|
|
-import com.tzy.sportcard.group.dto.GroupReviewParam;
|
|
|
|
|
-import com.tzy.sportcard.group.mapper.CardGroupGoodsMapper;
|
|
|
|
|
-import com.tzy.sportcard.group.mapper.TzyMerchantInfoMapper;
|
|
|
|
|
-import com.tzy.sportcard.group.service.GroupActRecordService;
|
|
|
|
|
-import com.tzy.sportcard.group.service.ICardGroupInfoService;
|
|
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
-import org.springframework.amqp.core.Message;
|
|
|
|
|
-import org.springframework.amqp.rabbit.annotation.Queue;
|
|
|
|
|
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
|
|
|
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
|
|
-
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
|
-import java.io.IOException;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 拼团app提交审核消费mq
|
|
|
|
|
- */
|
|
|
|
|
-@Slf4j
|
|
|
|
|
-@Component
|
|
|
|
|
-public class GroupAppSubmitReviewConsumer {
|
|
|
|
|
-
|
|
|
|
|
- @Resource
|
|
|
|
|
- private ICardGroupInfoService cardGroupInfoService;
|
|
|
|
|
- @Resource
|
|
|
|
|
- private IGoodsActRecordService goodsActRecordService;
|
|
|
|
|
- @Resource
|
|
|
|
|
- private CardGroupGoodsMapper cardGroupGoodsMapper;
|
|
|
|
|
- @Resource
|
|
|
|
|
- private GroupActRecordService groupActRecordService;
|
|
|
|
|
- @Autowired
|
|
|
|
|
- protected SysBaseService sysBaseService;
|
|
|
|
|
- @Resource
|
|
|
|
|
- private TzyMerchantInfoMapper tzyMerchantInfoMapper;
|
|
|
|
|
- @RabbitHandler
|
|
|
|
|
- @RabbitListener(queuesToDeclare = @Queue(MqConstans.QUEUE_GROUP_SUBMIT))
|
|
|
|
|
- public void groupReview(String groupInfoStr, Channel channel, Message message) throws IOException {
|
|
|
|
|
- log.info("拼团app提交审核参数:{}", groupInfoStr);
|
|
|
|
|
- try {
|
|
|
|
|
- GroupAppSubmitReviewParam param = JSONObject.parseObject(groupInfoStr, GroupAppSubmitReviewParam.class);
|
|
|
|
|
- CardGroupInfo cardGroupInfo = cardGroupInfoService.selectCardGroupInfoById(param.getGroupId());
|
|
|
|
|
- log.info("拼团app提交审核参数:{}", cardGroupInfo);
|
|
|
|
|
- cardGroupInfo.setStatus(param.getStatus());
|
|
|
|
|
- cardGroupInfoService.jsonHoldV3Submit(cardGroupInfo);
|
|
|
|
|
- // 审核提交后发送im消息给审核人
|
|
|
|
|
- JSONObject jsonObjectExtra = new JSONObject();
|
|
|
|
|
- JSONObject jsonObjectPayload = new JSONObject();
|
|
|
|
|
- jsonObjectPayload.put("data", "reviewGroupBuying");
|
|
|
|
|
- jsonObjectPayload.put("description", cardGroupInfo.getCode());
|
|
|
|
|
- IMMstNoticeAdditionalInfo imMstNoticeAdditionalInfo = new IMMstNoticeAdditionalInfo();
|
|
|
|
|
- imMstNoticeAdditionalInfo.setUpdateType("reviewGroupBuying");
|
|
|
|
|
- imMstNoticeAdditionalInfo.setId(cardGroupInfo.getId());
|
|
|
|
|
- imMstNoticeAdditionalInfo.setStatus("pending");
|
|
|
|
|
-// jsonObjectAddition.put("updateType", "reviewGroupBuying");
|
|
|
|
|
-// jsonObjectAddition.put("id", cardGroupInfo.getId());
|
|
|
|
|
-// jsonObjectAddition.put("status", "refuse");
|
|
|
|
|
- jsonObjectPayload.put("additionalInformation", imMstNoticeAdditionalInfo);
|
|
|
|
|
- JSONObject jsonObjectGroupInfo = new JSONObject();
|
|
|
|
|
- jsonObjectGroupInfo.put("id", cardGroupInfo.getId());
|
|
|
|
|
- jsonObjectGroupInfo.put("pointType", cardGroupInfo.getPointType());
|
|
|
|
|
- jsonObjectGroupInfo.put("statusMsg", cardGroupInfo.getStatus());
|
|
|
|
|
- jsonObjectGroupInfo.put("groupInfoName", cardGroupInfo.getName());
|
|
|
|
|
- jsonObjectGroupInfo.put("coverPicture", cardGroupInfo.getCoverPicture());
|
|
|
|
|
- jsonObjectGroupInfo.put("code", cardGroupInfo.getCode());
|
|
|
|
|
- jsonObjectGroupInfo.put("unitPrice", cardGroupInfo.getUnitPrice());
|
|
|
|
|
-
|
|
|
|
|
-// jsonObjectGroupInfo.put("cardGroupInfo", cardGroupInfo);
|
|
|
|
|
- jsonObjectPayload.put("extension", JSON.toJSONString(jsonObjectGroupInfo));
|
|
|
|
|
- jsonObjectExtra.put("payload", jsonObjectPayload);
|
|
|
|
|
-
|
|
|
|
|
- jsonObjectExtra.put("name", cardGroupInfo.getMerchantName());
|
|
|
|
|
- jsonObjectExtra.put("id", cardGroupInfo.getId());
|
|
|
|
|
- TzyMerchantInfo tzyMerchantInfo = tzyMerchantInfoMapper.selectTzyMerchantInfoById(cardGroupInfo.getMerchantId().longValue());
|
|
|
|
|
- jsonObjectExtra.put("avatar", tzyMerchantInfo.getAvatar());
|
|
|
|
|
- IMMstNoticeInfo imMstNoticeInfo = sysBaseService.buildIMNoticeP2P("operation","TIMCustomElem","mid_"+cardGroupInfo.getMerchantId(),"[自定义内容]", JSON.toJSONString(jsonObjectExtra));
|
|
|
|
|
- sysBaseService.sendIMNotice(imMstNoticeInfo);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- log.error("拼团app提交审核参数异常", e);
|
|
|
|
|
- }
|
|
|
|
|
- channel.basicAck(message.getMessageProperties()
|
|
|
|
|
- .getDeliveryTag(), false);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-}
|
|
|