Commit cf68aea7 authored by jiaorz's avatar jiaorz

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

parents a9e0f9f7 64d83d49
package com.xxfc.platform.app.biz;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.msg.TableResultResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
......@@ -37,11 +39,13 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
* @param cofig
* @return
*/
@CacheClear(pre = "app:withdrawrule:",key = "config{1}")
public int updateConfig(Cofig cofig) {
EntityUtils.setUpdatedInfo(cofig);
return mapper.updateByPrimaryKeySelective(cofig);
}
@Cache(key = "app:withdrawrule:88")
public WithDrawRuleVo getWithDrawRule(){
WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo();
Example example = new Example(Cofig.class);
......
package com.xxfc.platform.order.pojo.pay;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class NotifyUrlDTO {
public static final int TYPE_APP = 1;
public static final int TYPE_WX = 2;
//订单号
@ApiModelProperty(value = "订单号")
private String orderNo;
//订单号
@ApiModelProperty(value = "支付订单(流水)号")
private String tradeNo;
//支付类型
@ApiModelProperty(value = "支付类型")
private Integer type;
}
\ No newline at end of file
......@@ -375,13 +375,17 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param refundStatus
*/
public void refundSubProcess(BaseOrder baseOrder, String refundDesc, BigDecimal refundAmount, Integer refundType, Integer refundStatus) {
OrderRefundVo orv = new OrderRefundVo(){{
setAmount(baseOrder.getRealAmount().multiply(new BigDecimal("100")).intValue());
setOrderNo(baseOrder.getNo());
}};
orv.setRefundDesc(refundDesc+ refundAmount.toString());
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
String refundTradeNo = thirdFeign.refund(orv).getData();
String refundTradeNo = null;
//0 小于 退款金额
if(BigDecimal.ZERO.compareTo(refundAmount) < 0) {
OrderRefundVo orv = new OrderRefundVo(){{
setAmount(baseOrder.getRealAmount().multiply(new BigDecimal("100")).intValue());
setOrderNo(baseOrder.getNo());
}};
orv.setRefundDesc(refundDesc+ refundAmount.toString());
orv.setRefundAmount(refundAmount.multiply(new BigDecimal("100")).intValue());
refundTradeNo = thirdFeign.refund(orv).getData();
}
//记录订单退款记录
Integer flag = addOrderRefund(baseOrder.getId(), refundDesc, refundAmount, refundTradeNo, refundType);
......
......@@ -28,6 +28,7 @@ import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.OrderUserLicense;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.order.*;
import com.xxfc.platform.order.pojo.pay.NotifyUrlDTO;
import com.xxfc.platform.order.pojo.pay.OrderPayDTO;
import com.xxfc.platform.universal.constant.DictionaryKey;
import com.xxfc.platform.universal.entity.Dictionary;
......@@ -470,19 +471,4 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@ApiModelProperty("每页限制")
Integer limit;
}
@Data
public class NotifyUrlDTO {
//订单号
@ApiModelProperty(value = "订单号")
private String orderNo;
//订单号
@ApiModelProperty(value = "支付订单(流水)号")
private String tradeNo;
//支付类型
@ApiModelProperty(value = "支付类型")
private Integer type;
}
}
......@@ -14,6 +14,7 @@ import com.xxfc.platform.order.contant.enumerate.OrderTypeEnum;
import com.xxfc.platform.order.entity.BaseOrder;
import com.xxfc.platform.order.entity.inter.OrderDetail;
import com.xxfc.platform.order.mqhandler.RabbitProduct;
import com.xxfc.platform.order.pojo.pay.NotifyUrlDTO;
import com.xxfc.platform.order.pojo.price.OrderPriceVO;
import com.xxfc.platform.universal.entity.Dictionary;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -120,13 +121,13 @@ public abstract class AbstractOrderHandle<Biz extends BaseBiz, Detail extends Or
}
//判断是否价格为0
// BigDecimal realAmount = detail.getOrder().getRealAmount();
// if(BigDecimal.ZERO.compareTo(realAmount) > 0) {
// throw new BaseException(ResultCode.FAILED_CODE);
// }else if(BigDecimal.ZERO.compareTo(realAmount) = 0) {
// //直接支付
// baseOrderBiz.payNotifyHandle();
// }
BigDecimal realAmount = detail.getOrder().getRealAmount();
if(BigDecimal.ZERO.compareTo(realAmount) > 0) {
throw new BaseException(ResultCode.FAILED_CODE);
}else if(BigDecimal.ZERO.compareTo(realAmount) == 0) {
//直接支付
baseOrderBiz.payNotifyHandle(detail.getOrder().getNo(), null, detail.getOrderOrigin());
}
}
/**
* 计算价格
......
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