|
@@ -6,6 +6,7 @@ import com.kmall.api.entity.*;
|
|
|
import com.kmall.api.service.pay.wxpay.WxPayPropertiesBuilder;
|
|
|
import com.kmall.common.entity.FormIdsEntity;
|
|
|
import com.kmall.common.service.FormIdsService;
|
|
|
+import com.kmall.common.utils.Constant;
|
|
|
import com.kmall.common.utils.DateUtils;
|
|
|
import com.kmall.common.utils.MapUtils;
|
|
|
import com.kmall.common.utils.wechat.WechatRefundApiResult;
|
|
@@ -124,7 +125,7 @@ public class ApiPayService {
|
|
|
if(orderVoList != null && orderVoList.size()>0) {
|
|
|
for(OrderVo orderInfo:orderVoList) {
|
|
|
//校验返回的订单金额是否与商户侧的订单金额一致
|
|
|
- String actualPrice = String.valueOf(orderInfo.getActual_price().multiply(new BigDecimal(100)));
|
|
|
+ String actualPrice = String.valueOf(orderInfo.getActual_price().multiply(Constant.ONE_HUNDRED));
|
|
|
if(!total_fee.equalsIgnoreCase(actualPrice)){//不一致
|
|
|
MallOrderExceptionRecord mallOrderExceptionRecord = new MallOrderExceptionRecord();
|
|
|
mallOrderExceptionRecord.setUserId(Integer.parseInt(orderInfo.getUser_id()+""));
|
|
@@ -222,7 +223,7 @@ public class ApiPayService {
|
|
|
orderRefund.setRefundId(result.getRefund_id());
|
|
|
orderRefund.setRefundType(Integer.parseInt(Dict.RefundType.item_1.getItem()));
|
|
|
orderRefund.setOutRefundNo(result.getOut_refund_no());
|
|
|
- orderRefund.setRefundMoney(BigDecimal.valueOf(Long.valueOf(result.getRefund_fee())));
|
|
|
+ orderRefund.setRefundMoney(BigDecimal.valueOf(Long.valueOf(result.getRefund_fee())).divide(Constant.ONE_HUNDRED));
|
|
|
orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_2.getItem()));
|
|
|
orderRefund.setModTime(new Date());
|
|
|
|
|
@@ -250,8 +251,8 @@ public class ApiPayService {
|
|
|
storeRelaEntity.setSellVolume(0);
|
|
|
}
|
|
|
BigDecimal sellVolume = new BigDecimal(storeRelaEntity.getSellVolume()).subtract(new BigDecimal(orderGoodsEntity.getNumber()));//销售量
|
|
|
- if (sellVolume.compareTo(new BigDecimal(0)) < 0) {
|
|
|
- sellVolume = new BigDecimal(0);
|
|
|
+ if (sellVolume.compareTo(Constant.ZERO) < 0) {
|
|
|
+ sellVolume = Constant.ZERO;
|
|
|
}
|
|
|
storeRelaEntity.setSellVolume(Integer.parseInt(String.valueOf(sellVolume)));
|
|
|
if (null == storeRelaEntity.getStockNum()) {
|
|
@@ -288,7 +289,7 @@ public class ApiPayService {
|
|
|
orderRefund.setRefundTime(successTime);//退款成功时间
|
|
|
orderRefund.setOutRefundNo(refundApiResult.getOut_refund_no());
|
|
|
orderRefund.setRefundId(refundApiResult.getRefund_id());
|
|
|
- orderRefund.setRefundMoney(BigDecimal.valueOf(Long.valueOf(refundApiResult.getRefund_fee())));
|
|
|
+ orderRefund.setRefundMoney(BigDecimal.valueOf(Long.valueOf(refundApiResult.getRefund_fee())).divide(Constant.ONE_HUNDRED));
|
|
|
if (refundApiResult.getRefund_status().equalsIgnoreCase("SUCCESS")) {
|
|
|
orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_2.getItem()));
|
|
|
orderRefund.setWechatRefundStatusDes("退款成功");
|
|
@@ -302,7 +303,13 @@ public class ApiPayService {
|
|
|
orderRefund.setRefundStatus(Integer.parseInt(Dict.RefundStatus.item_4.getItem()));
|
|
|
orderRefund.setWechatRefundStatusDes("退款异常");
|
|
|
}
|
|
|
- orderRefund.setRefundRecvAccout(refundApiResult.getRefund_recv_accout());
|
|
|
+ String account = refundApiResult.getRefund_recv_accout();
|
|
|
+ try{
|
|
|
+ account = new String(account.getBytes("UTF-8"), "ISO-8859-1");
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("转换异常:",e);
|
|
|
+ }
|
|
|
+ orderRefund.setRefundRecvAccout(account);
|
|
|
orderRefund.setId(mallOrderRefund.getId());
|
|
|
mallOrderRefundMapper.update(orderRefund);//更新订单退款信息
|
|
|
|