Commit c2bdac60 authored by 周健威's avatar 周健威

修改bug

parent 8aaced63
package com.xxfc.platform.activity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class AwardDTO {
public static final int CONDITION_INVITE = 1;
/**
* 条件类型 1--邀请
*/
@ApiModelProperty("条件类型 1--邀请")
Integer conditionType;
/**
* 数量
*/
@ApiModelProperty("数量")
Integer num;
/**
* 奖励项
*/
@ApiModelProperty("奖励项")
List<AwardItemDTO> awardItems;
}
\ No newline at end of file
package com.xxfc.platform.activity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AwardItemDTO {
/**
* 奖励类型 1--现金;2--优惠券
*/
@ApiModelProperty("奖励类型")
Integer type;
/**
* 奖励内容(根据类型决定具体填什么,如优惠券就优惠券号)
*/
@ApiModelProperty("奖励")
String award;
}
\ No newline at end of file
package com.xxfc.platform.activity.biz; package com.xxfc.platform.activity.biz;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO; import com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO;
import com.github.wxiaoqi.security.admin.entity.MyWalletDetail; import com.github.wxiaoqi.security.admin.entity.MyWalletDetail;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant; import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
import com.xxfc.platform.activity.dto.AwardDTO;
import com.xxfc.platform.activity.entity.ActivityPopularizeLog; import com.xxfc.platform.activity.entity.ActivityPopularizeLog;
import com.xxfc.platform.activity.entity.ActivityPopularizeRelation; import com.xxfc.platform.activity.entity.ActivityPopularizeRelation;
import com.xxfc.platform.activity.entity.ActivityPopularizeUser; import com.xxfc.platform.activity.entity.ActivityPopularizeUser;
import com.xxfc.platform.universal.feign.MQSenderFeign; import com.xxfc.platform.universal.feign.MQSenderFeign;
import com.xxfc.platform.universal.feign.ThirdFeign; import com.xxfc.platform.universal.feign.ThirdFeign;
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;
...@@ -19,6 +22,7 @@ import com.xxfc.platform.activity.mapper.ActivityPopularizeMapper; ...@@ -19,6 +22,7 @@ import com.xxfc.platform.activity.mapper.ActivityPopularizeMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FALSE;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE; import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
...@@ -31,6 +35,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR ...@@ -31,6 +35,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR
* @date 2019-07-05 15:23:04 * @date 2019-07-05 15:23:04
*/ */
@Service @Service
@Slf4j
public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,ActivityPopularize> { public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,ActivityPopularize> {
@Autowired @Autowired
...@@ -65,12 +70,21 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -65,12 +70,21 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
//获取活动code,并且注册来源是app 并且 非普通登录 //获取活动code,并且注册来源是app 并且 非普通登录
if(POPULARIZE_0101.equals(activityCode) if(POPULARIZE_0101.equals(activityCode)
&& !RegisterQueueDTO.SIGN_LOGIN.equals(registerQueueDTO.getSign())) { && !RegisterQueueDTO.SIGN_LOGIN.equals(registerQueueDTO.getSign())) {
//查询出活动 //查询出活动
ActivityPopularize activityPopularize = popularizeBiz.selectOne(new ActivityPopularize(){{ ActivityPopularize activityPopularize = popularizeBiz.selectOne(new ActivityPopularize(){{
setCode(activityCode); setCode(activityCode);
}}); }});
Date now = DateUtil.date();
Date start = DateUtil.date(activityPopularize.getStartTime());
Date end = DateUtil.date(activityPopularize.getEndTime());
//判断是否活动超时
if(now.before(start) || now.after(end)) {
log.error("不在活动范围内 入参Json:"+ JSONUtil.toJsonStr(registerQueueDTO));
return;
}
Integer majorUserId = Integer.valueOf(appUserDTO.getInviterAccount()); Integer majorUserId = Integer.valueOf(appUserDTO.getInviterAccount());
//添加活动关系 //添加活动关系
...@@ -103,6 +117,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti ...@@ -103,6 +117,7 @@ public class ActivityPopularizeBiz extends BaseBiz<ActivityPopularizeMapper,Acti
//任务没有完成 //任务没有完成
if(!SYS_TRUE.equals(activityPopularizeUser.getStatus())) { if(!SYS_TRUE.equals(activityPopularizeUser.getStatus())) {
// AwardDTO awardDTO = JSONUtil.toBean(activityPopularize.getValue(), AwardDTO.class);
//检查是否满足奖励 //检查是否满足奖励
if(relationBiz.selectList(new ActivityPopularizeRelation(){{ if(relationBiz.selectList(new ActivityPopularizeRelation(){{
setMajorUserId(appUserDTO.getUserid()); setMajorUserId(appUserDTO.getUserid());
......
...@@ -320,7 +320,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> { ...@@ -320,7 +320,8 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
if(null == depositAmount) { if(null == depositAmount) {
depositAmount = BigDecimal.ZERO; depositAmount = BigDecimal.ZERO;
} }
BigDecimal refundGoodsAmount = calculateRefund(baseOrder.getGoodsAmount(), timeLag, dicParentKey, refundDesc); //商品价格 - 优惠券减免的价格
BigDecimal refundGoodsAmount = calculateRefund(baseOrder.getGoodsAmount().subtract(baseOrder.getCouponAmount()), timeLag, dicParentKey, refundDesc);
//退款金额 //退款金额
BigDecimal refundAmount = depositAmount.add(refundGoodsAmount); BigDecimal refundAmount = depositAmount.add(refundGoodsAmount);
...@@ -501,7 +502,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> { ...@@ -501,7 +502,6 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
if(OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) { if(OrderTypeEnum.MEMBER.getCode().equals(baseOrder.getType())) {
sendOrderMq(orvd, otd, omd, baseOrder, OrderMQDTO.ORDER_FINISH); sendOrderMq(orvd, otd, omd, baseOrder, OrderMQDTO.ORDER_FINISH);
} }
} }
} else { } else {
log.error(" order has payed , orderNo:{}, tradeNo:{} ", orderNo, tradeNo); log.error(" order has payed , orderNo:{}, tradeNo:{} ", orderNo, tradeNo);
......
...@@ -43,7 +43,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe ...@@ -43,7 +43,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
@RequestMapping(value = "/price/calculate/{type}/{no}", method = RequestMethod.GET) @RequestMapping(value = "/price/calculate/{type}/{no}", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@IgnoreClientToken @IgnoreClientToken
public ObjectRestResponse getOrderParam(@PathVariable(value = "no") String type, @PathVariable(value = "no") String no) { public ObjectRestResponse getPriceCalculate(@PathVariable(value = "type") String type, @PathVariable(value = "no") String no) {
checkAppUser(); checkAppUser();
//根据no 查订单 //根据no 查订单
OrderPageVO orderPageVO = baseOrderBiz.pageByParm(new Query(new PageParam(){{ OrderPageVO orderPageVO = baseOrderBiz.pageByParm(new Query(new PageParam(){{
...@@ -65,15 +65,15 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe ...@@ -65,15 +65,15 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
// , "取消订单退款:")); // , "取消订单退款:"));
break; break;
case TOUR: case TOUR:
String dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_REFUND; // String dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_REFUND;
//不是省外, // //不是省外,
if(SYS_FALSE.equals(orderPageVO.getOrderTourDetail().getIsOutside())) { // if(SYS_FALSE.equals(orderPageVO.getOrderTourDetail().getIsOutside())) {
dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_IN_REFUND; // dicParentKey = DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.TOUR_IN_REFUND;
} // }
orp.setRefundAmount(baseOrderBiz.calculateRefund(orderPageVO.getGoodsAmount() // orp.setRefundAmount(baseOrderBiz.calculateRefund(orderPageVO.getGoodsAmount().subtract(orderPageVO.getCouponAmount())
, System.currentTimeMillis() - orderPageVO.getOrderRentVehicleDetail().getStartTime() // , System.currentTimeMillis() - orderPageVO.getOrderRentVehicleDetail().getStartTime()
, DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.RENT_REFUND // , DictionaryKey.APP_ORDER+ "_"+ DictionaryKey.RENT_REFUND
, "取消订单退款:")); // , "取消订单退款:"));
break; break;
default: default:
// orp.setRefundAmount(orderPageVO); // orp.setRefundAmount(orderPageVO);
......
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