Commit 0d078b55 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 1fb89b3c 81940ccc
...@@ -17,7 +17,8 @@ spring: ...@@ -17,7 +17,8 @@ spring:
nacos: nacos:
config: config:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
#共用配置,暂定一个
shared-dataids: common-dev.yaml,mongodb-log-dev.yaml
--- ---
spring: spring:
profiles: pro profiles: pro
......
...@@ -38,7 +38,7 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz ...@@ -38,7 +38,7 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
} }
@ApiOperation("查询邀请的成员") @ApiOperation("查询邀请的成员")
@GetMapping("/page") @GetMapping("/pages")
public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state, public ObjectRestResponse<InviteMemberVo> findInviteMemberByActivitState(@RequestParam(value = "state",required = false) Integer state,
@RequestParam("page") Integer page, @RequestParam("page") Integer page,
@RequestParam("limit") Integer limit, @RequestParam("limit") Integer limit,
......
...@@ -17,7 +17,7 @@ spring: ...@@ -17,7 +17,7 @@ spring:
config: config:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
#共用配置,暂定一个 #共用配置,暂定一个
shared-dataids: common-dev.yaml shared-dataids: common-dev.yaml,mongodb-log-dev.yaml
--- ---
spring: spring:
......
package com.xxfc.platform.activity.entity; package com.xxfc.platform.activity.entity;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
......
...@@ -14,7 +14,7 @@ public class IntegralUserRecordDto extends PageParam { ...@@ -14,7 +14,7 @@ public class IntegralUserRecordDto extends PageParam {
/** /**
* 0-获取积分;1-抵扣积分 * 0-获取积分;1-抵扣积分
*/ */
private Integer type; private Integer type = 0;
/** /**
* 积分数 * 积分数
......
...@@ -77,6 +77,12 @@ public class UserCouponVo { ...@@ -77,6 +77,12 @@ public class UserCouponVo {
@ApiModelProperty(value = "优惠券标题(有图片则显示图片):无门槛50元优惠券 | 单品最高减2000元") @ApiModelProperty(value = "优惠券标题(有图片则显示图片):无门槛50元优惠券 | 单品最高减2000元")
private String title; private String title;
/**
* 副标题
*/
@ApiModelProperty(value = "副标题")
private String subtitle;
/** /**
* 图片 * 图片
*/ */
......
...@@ -4,7 +4,6 @@ package com.xxfc.platform.activity.handler; ...@@ -4,7 +4,6 @@ package com.xxfc.platform.activity.handler;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz; import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import com.xxfc.platform.activity.config.RabbitActivityConfig;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto; import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -27,7 +26,7 @@ public class IntegralMQHandler { ...@@ -27,7 +26,7 @@ public class IntegralMQHandler {
@Autowired @Autowired
IntegralUserRecordBiz integralUserRecordBiz; IntegralUserRecordBiz integralUserRecordBiz;
@RabbitListener(queues = RabbitActivityConfig.INTEGRAL_QUEUE) @RabbitListener(queues = "integral_handle_queue")
public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) { public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
ExecutorService executorService = Executors.newCachedThreadPool(); ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new Runnable() { executorService.execute(new Runnable() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<result column="user_id" property="userId" jdbcType="INTEGER" /> <result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" /> <result column="type" property="type" jdbcType="INTEGER" />
<result column="point" property="point" jdbcType="INTEGER" /> <result column="point" property="point" jdbcType="INTEGER" />
<result column="integral_rule_code" property="integralRuleCode" jdbcType="INTEGER" /> <result column="integral_rule_code" property="integralRuleCode" jdbcType="VARCHAR" />
<result column="crt_time" property="crtTime" jdbcType="BIGINT" /> <result column="crt_time" property="crtTime" jdbcType="BIGINT" />
<result column="is_valid" property="isValid" jdbcType="BIT" /> <result column="is_valid" property="isValid" jdbcType="BIT" />
<result column="isdel" property="isdel" jdbcType="BIT" /> <result column="isdel" property="isdel" jdbcType="BIT" />
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<result property="expireTime" column="expire_time"/> <result property="expireTime" column="expire_time"/>
<result property="useTime" column="use_time"/> <result property="useTime" column="use_time"/>
<result property="title" column="title"/> <result property="title" column="title"/>
<result property="subtitle" column="subtitle"/>
<result property="icon" column="icon"/> <result property="icon" column="icon"/>
<result property="used" column="used"/> <result property="used" column="used"/>
<result property="channel" column="channel"/> <result property="channel" column="channel"/>
......
...@@ -23,7 +23,12 @@ ...@@ -23,7 +23,12 @@
<artifactId>ace-auth-client</artifactId> <artifactId>ace-auth-client</artifactId>
<version>2.0-SNAPSHOT</version> <version>2.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.xxfc.platform</groupId>
<artifactId>xx-universal-api</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- 自己项目 --> <!-- 自己项目 -->
......
package com.xxfc.platform.im.biz; package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -8,6 +9,8 @@ import com.xxfc.platform.im.dto.UpdateTypeEnum; ...@@ -8,6 +9,8 @@ import com.xxfc.platform.im.dto.UpdateTypeEnum;
import com.xxfc.platform.im.entity.ImComment; import com.xxfc.platform.im.entity.ImComment;
import com.xxfc.platform.im.entity.ImQuestion; import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImCommentMapper; import com.xxfc.platform.im.mapper.ImCommentMapper;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,7 +23,8 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> { ...@@ -20,7 +23,8 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
ImQuestionBiz imQuestionBiz; ImQuestionBiz imQuestionBiz;
@Autowired @Autowired
UserBiz userBiz; UserBiz userBiz;
@Autowired
MQSenderFeign mqSenderFeign;
/** /**
* 添加评论 * 添加评论
* *
...@@ -43,8 +47,15 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> { ...@@ -43,8 +47,15 @@ public class ImCommentBiz extends BaseBiz<ImCommentMapper, ImComment> {
return ObjectRestResponse.createDefaultFail(); return ObjectRestResponse.createDefaultFail();
} }
insertSelective(imComment); insertSelective(imComment);
ImQuestion newValue = imQuestionBiz.selectById(imComment.getQuestionId());
//修改评论数 //修改评论数
imQuestionBiz.update(imComment.getQuestionId(), MsgTypeEnum.comment, UpdateTypeEnum.add); imQuestionBiz.update(imComment.getQuestionId(), MsgTypeEnum.comment, UpdateTypeEnum.add);
//评论添加积分
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", appUserDTO.getUserid());
jsonObject.put("channelId", newValue.getId());
jsonObject.put("integralRuleCode", "COMMENTPUBLISH");
mqSenderFeign.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
package com.xxfc.platform.im.biz; package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...@@ -10,6 +11,8 @@ import com.xxfc.platform.im.dto.QuestionParamDto; ...@@ -10,6 +11,8 @@ import com.xxfc.platform.im.dto.QuestionParamDto;
import com.xxfc.platform.im.dto.UpdateTypeEnum; import com.xxfc.platform.im.dto.UpdateTypeEnum;
import com.xxfc.platform.im.entity.ImQuestion; import com.xxfc.platform.im.entity.ImQuestion;
import com.xxfc.platform.im.mapper.ImQuestionMapper; import com.xxfc.platform.im.mapper.ImQuestionMapper;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,6 +25,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> { ...@@ -22,6 +25,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
@Autowired @Autowired
UserBiz userBiz; UserBiz userBiz;
@Autowired
MQSenderFeign mqSenderFeign;
/** /**
* 获取列表 * 获取列表
* *
...@@ -58,7 +64,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> { ...@@ -58,7 +64,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
if (imQuestion == null) { if (imQuestion == null) {
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
} }
insertSelective(imQuestion); insertSelective(imQuestion);
ImQuestion newValue = mapper.selectOne(imQuestion);
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", appUserDTO.getUserid());
jsonObject.put("channelId", newValue.getId());
jsonObject.put("integralRuleCode", "PUBLISH");
mqSenderFeign.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
return ObjectRestResponse.succ(); return ObjectRestResponse.succ();
} }
......
...@@ -67,8 +67,12 @@ public class MsgBiz { ...@@ -67,8 +67,12 @@ public class MsgBiz {
ids.add(2); ids.add(2);
ids.add(4); ids.add(4);
query = new Query(Criteria.where("body.type").in(ids)); query = new Query(Criteria.where("body.type").in(ids));
List<Msg> list = mongoTemplate.find(query, Msg.class, "s_msg"); if (appUserDTO != null) {
msgList = fetchAndAttach(list, appUserDTO.getImUserid()); msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), appUserDTO.getImUserid());
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo);
}
msgList = mongoTemplate.find(query, Msg.class, "s_msg");
PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList)); PageInfo<MsgVo> goodPageInfo = new PageInfo<>(replaceMsgResult(msgList));
return ObjectRestResponse.succ(goodPageInfo); return ObjectRestResponse.succ(goodPageInfo);
} }
......
...@@ -24,7 +24,8 @@ spring: ...@@ -24,7 +24,8 @@ spring:
nacos: nacos:
config: config:
server-addr: 127.0.0.1:8848 server-addr: 127.0.0.1:8848
#共用配置,暂定一个
shared-dataids: common-dev.yaml,mongodb-log-dev.yaml
--- ---
spring: spring:
profiles: pro profiles: pro
......
package com.xxfc.platform.universal.constant;
public class MQconstant {
public static final String INTEGRAL_EXCHANGE = "integral_exchange";
public static final String INTEGRAL_ROUTING_KEY = "integral_routing_key";
}
...@@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -6,9 +6,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(value = "xx-universal", contextId = "sendMessage") @FeignClient(value = "xx-universal", contextId = "sendMessage")
public interface MQSerderFeign { public interface MQSenderFeign {
@GetMapping(value = "/message/sendMessage") @GetMapping(value = "/message/sendMessage")
public ObjectRestResponse sendMessage(@RequestParam(value = "exchange") String exchange, @RequestParam(value = "routingKey")String routKey, @RequestParam(value = "jsonParam") String jsonParam); public ObjectRestResponse sendMessage(@RequestParam(value = "exchange") String exchange, @RequestParam(value = "routKey")String routKey, @RequestParam(value = "json") String json);
} }
package com.xxfc.platform.universal.biz; package com.xxfc.platform.universal.biz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message; import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder; import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.core.MessageProperties; import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.UUID; import java.util.UUID;
@Service @Service
@AllArgsConstructor @Slf4j
public class MQServiceBiZ { public class MQServiceBiZ {
@Autowired
private RabbitTemplate rabbitTemplate; private RabbitTemplate rabbitTemplate;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ObjectRestResponse sendMessage(String exchange, String routKey, String json) { public ObjectRestResponse sendMessage(String exchange, String routKey, String json) {
log.info("发送消息到消息队列:exchange = {}, routingKey = {}, json = {}", exchange, routKey, json);
Message message = MessageBuilder.withBody(json.getBytes()) Message message = MessageBuilder.withBody(json.getBytes())
.setContentType(MessageProperties.CONTENT_TYPE_JSON).setContentEncoding("utf-8") .setContentType(MessageProperties.CONTENT_TYPE_JSON).setContentEncoding("utf-8")
.setMessageId(UUID.randomUUID() + "").build(); .setMessageId(UUID.randomUUID() + "").build();
......
...@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil; ...@@ -17,6 +17,7 @@ import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig; import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil; import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.universal.constant.MQconstant;
import com.xxfc.platform.universal.entity.Dictionary; import com.xxfc.platform.universal.entity.Dictionary;
import com.xxfc.platform.universal.entity.OrderPay; import com.xxfc.platform.universal.entity.OrderPay;
import com.xxfc.platform.universal.mapper.OrderPayMapper; import com.xxfc.platform.universal.mapper.OrderPayMapper;
...@@ -57,6 +58,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -57,6 +58,9 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
@Autowired @Autowired
HttpServletRequest request; HttpServletRequest request;
@Autowired
MQServiceBiZ mqServiceBiZ;
public JSONObject preparepay( OrderPayVo orderPayVo) { public JSONObject preparepay( OrderPayVo orderPayVo) {
if(null == orderPayVo) { if(null == orderPayVo) {
log.error("-----参数为空-----------"); log.error("-----参数为空-----------");
...@@ -69,20 +73,20 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -69,20 +73,20 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
if(StringUtils.isBlank(orderPayVo.getOrderNo())) { if(StringUtils.isBlank(orderPayVo.getOrderNo())) {
log.error("-----订单不能为空-----------"); log.error("-----订单不能为空-----------");
return JsonResultUtil.createFailedResult(ResultCode.NULL_CODE, "订单不能为空"); return JsonResultUtil.createFailedResult(ResultCode.NULL_CODE, "订单不能为空");
} }
String trade_no = OrderUtil.GetOrderNumber(""); String trade_no = OrderUtil.GetOrderNumber("");
String order_no=orderPayVo.getOrderNo(); String order_no=orderPayVo.getOrderNo();
Integer amount=orderPayVo.getAmount(); Integer amount=orderPayVo.getAmount();
log.error("---下单---order_no====="+order_no+"--支付订单号--trade_no===="+trade_no+"--金额---amount===="+amount); log.error("---下单---order_no====="+order_no+"--支付订单号--trade_no===="+trade_no+"--金额---amount===="+amount);
//报名费回调路径 //报名费回调路径
//临时处理 //临时处理
Map<String, Dictionary> dictionaryMap = dictionaryBiz.getAll4Map(); Map<String, Dictionary> dictionaryMap = dictionaryBiz.getAll4Map();
Integer demotion = Integer.valueOf(dictionaryMap.get(UNIVERSAL_PAY+ "_"+ PAY_DEMOTION).getDetail()); Integer demotion = Integer.valueOf(dictionaryMap.get(UNIVERSAL_PAY+ "_"+ PAY_DEMOTION).getDetail());
amount = amount/demotion; amount = amount/demotion;
if(amount <= 0) { if(amount <= 0) {
amount = 1; amount = 1;
} }
Integer type=orderPayVo.getType(); Integer type=orderPayVo.getType();
String jsParam=""; String jsParam="";
String notify_url="https://"+ SystemConfig.weixinHost+"/api/universal/pay/app/unauth/notify"; String notify_url="https://"+ SystemConfig.weixinHost+"/api/universal/pay/app/unauth/notify";
...@@ -144,6 +148,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> { ...@@ -144,6 +148,21 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
result= HTTPUtils.doGet(url); result= HTTPUtils.doGet(url);
} }
log.error("---支付回调处理---orderNo======="+orderNo+"---result==="+result); log.error("---支付回调处理---orderNo======="+orderNo+"---result==="+result);
//支付成功,添加积分
if(pay.getStatus() == 1) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userId", pay.getUserId());
jsonObject.put("amount", pay.getAmount());
jsonObject.put("channelId", pay.getOrderNo());
if(pay.getChannel() == 1) {//租车
jsonObject.put("integralRuleCode", "RENTRV");
} else if(pay.getChannel() == 2) { //旅游
jsonObject.put("integralRuleCode", "BUYROUT");
} else if(pay.getChannel() == 3) { //会员
jsonObject.put("integralRuleCode", "BUYMEMBER");
}
mqServiceBiZ.sendMessage(MQconstant.INTEGRAL_EXCHANGE, MQconstant.INTEGRAL_ROUTING_KEY, jsonObject.toJSONString());
}
} }
} }
} }
......
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