Commit bc188748 by zhengyunfei

Merge remote-tracking branch 'origin/master'

parents 6ab9279e 22caa4e0
...@@ -40,7 +40,6 @@ public class WxController { ...@@ -40,7 +40,6 @@ public class WxController {
} }
/** /**
* 微信支付 * 微信支付
* *
...@@ -65,15 +64,13 @@ public class WxController { ...@@ -65,15 +64,13 @@ public class WxController {
} }
/** /**
* 回调测试 * 回调测试
*/ */
@RequestMapping(value = "/testNotifyOk/{id}", method = RequestMethod.GET) @RequestMapping(value = "/testNotifyOk/{id}", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public String testNotifyOk(@PathVariable Integer id){ public String testNotifyOk(@PathVariable Integer id) {
if(id == null) return null; if (id == null) return null;
this.wxServiceImpl.handleNotifyOk(id); this.wxServiceImpl.handleNotifyOk(id);
...@@ -100,20 +97,17 @@ public class WxController { ...@@ -100,20 +97,17 @@ public class WxController {
@RequestMapping(value = "/wxRefund", method = RequestMethod.POST) @RequestMapping(value = "/wxRefund", method = RequestMethod.POST)
public Result wxRefund(Integer userId, Integer orderId, HttpServletRequest request) { public Result wxRefund(Integer userId, Integer orderId, HttpServletRequest request) {
try { try {
return wxService.wxRefund(userId, orderId,"", request); return wxService.wxRefund(userId, orderId, "", request);
} catch (Exception e) { } catch (Exception e) {
return new Result(103); return new Result(103);
} }
} }
// @RequestMapping(value = "/asd", method = {RequestMethod.POST, RequestMethod.GET}) // @RequestMapping(value = "/asd", method = {RequestMethod.POST, RequestMethod.GET})
// public void asd(String outTradeNo) throws IOException, JDOMException { // public void asd(String outTradeNo) throws IOException, JDOMException {
// wxService.asd(outTradeNo); // wxService.asd(outTradeNo);
// } // }
} }
\ No newline at end of file
...@@ -339,7 +339,7 @@ public class OrderMainController { ...@@ -339,7 +339,7 @@ public class OrderMainController {
@ResponseBody @ResponseBody
public Result refundReceive(@RequestBody JSONObject json){ public Result refundReceive(@RequestBody JSONObject json){
OrderMain user = JSONObject.toJavaObject(json,OrderMain.class); OrderMain user = JSONObject.toJavaObject(json,OrderMain.class);
return this.orderService.refundReceive(user); return this.orderService.refundReceive(user, 4);
} }
/** /**
......
...@@ -30,6 +30,8 @@ public class OrderMain { ...@@ -30,6 +30,8 @@ public class OrderMain {
// 关联查询对象: 关联用户表 // 关联查询对象: 关联用户表
@TableField(exist = false) @TableField(exist = false)
private Customer customer; private Customer customer;
@TableField(exist = false)
private OrderRefund orderRefund;
//提交订单校验错误信息 //提交订单校验错误信息
@TableField(exist = false) @TableField(exist = false)
...@@ -76,6 +78,8 @@ public class OrderMain { ...@@ -76,6 +78,8 @@ public class OrderMain {
//数据库字段 //数据库字段
private Integer id; // id主键 private Integer id; // id主键
@TableField(exist = false)
private Integer zid; // id主键
private Integer customerid; // 客户id private Integer customerid; // 客户id
private Integer productid; // 商品id,关联商品信息表id private Integer productid; // 商品id,关联商品信息表id
private Integer addressid;//地址id,关联地址表 private Integer addressid;//地址id,关联地址表
......
package com.yunniu.farming.webadmin.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName(value = "order_refund")
public class OrderRefund implements Serializable {
/**
* id
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 订单主表id
*/
@TableField(value = "order_mian_id")
private Long orderMianId;
/**
* 退款类型(1:仅退款,2退货退款)
*/
@TableField(value = "refund_type")
private String refundType;
/**
* 是否部分退(0是,1否)
*/
@TableField(value = "portion")
private String portion;
/**
* 退款编码
*/
@TableField(value = "refund_code")
private String refundCode;
/**
* 退款状态(1退款申请,2申请通过,3申请拒绝,4待退货,5退款成功,6待退款)
*/
@TableField(value = "refund_status")
private String refundStatus;
/**
* 退款金额
*/
@TableField(value = "refund_money")
private Double refundMoney;
/**
* 退款申请时间
*/
@TableField(value = "refund_time")
private Date refundTime;
/**
* 退款完成时间
*/
@TableField(value = "refund_suc_time")
private Date refundSucTime;
/**
* 退款原因
*/
@TableField(value = "refund_reason")
private String refundReason;
/**
* 退款图片
*/
@TableField(value = "refund_img")
private String refundImg;
/**
* 退款详情
*/
@TableField(value = "refund_detail")
private String refundDetail;
}
\ No newline at end of file
...@@ -43,9 +43,9 @@ public class OrderSub { ...@@ -43,9 +43,9 @@ public class OrderSub {
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
private String sdef1; //自定义项1 退款状态 1申请退款,2申请成功,3申请拒绝,4退款成功 private String sdef1; //自定义项1 退款状态 1申请退款,2申请成功,3申请拒绝,4退款成功
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
private String sdef2; //自定义项2 private String sdef2; //自定义项2 退款成功数量
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
private String sdef3; //自定义项3 private String sdef3; //自定义项3 退款申请中的数量
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
private String sdef4; //自定义项4 private String sdef4; //自定义项4
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
......
...@@ -4,16 +4,11 @@ import com.alibaba.fastjson.JSON; ...@@ -4,16 +4,11 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yunniu.farming.util.StringHelper; import com.yunniu.farming.util.StringHelper;
import com.yunniu.farming.webadmin.dao.GroupBuyDao; import com.yunniu.farming.webadmin.dao.*;
import com.yunniu.farming.webadmin.dao.GroupOrderDao; import com.yunniu.farming.webadmin.model.*;
import com.yunniu.farming.webadmin.dao.OrderMainDao;
import com.yunniu.farming.webadmin.dao.OrderSubDao;
import com.yunniu.farming.webadmin.model.GroupBuy;
import com.yunniu.farming.webadmin.model.GroupOrder;
import com.yunniu.farming.webadmin.model.OrderMain;
import com.yunniu.farming.webadmin.model.OrderSub;
import com.yunniu.farming.webadmin.service.GroupOrderService; import com.yunniu.farming.webadmin.service.GroupOrderService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.aspectj.weaver.ast.Var;
import org.springframework.beans.factory.annotation.Autowired; 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;
...@@ -40,15 +35,18 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -40,15 +35,18 @@ public class GroupOrderServiceImpl implements GroupOrderService {
private OrderMainDao orderMainDao; private OrderMainDao orderMainDao;
@Autowired @Autowired
private OrderSubDao orderSubDao; private OrderSubDao orderSubDao;
@Autowired
private OrderRefundMapper refundMapper;
/** /**
* 保存团购订单 * 保存团购订单
*
* @param item * @param item
* @return * @return
*/ */
@Override @Override
public GroupOrder addGroupOrder(OrderMain item) { public GroupOrder addGroupOrder(OrderMain item) {
if (item.getAreaId() == null){ if (item.getAreaId() == null) {
throw new RuntimeException("缺少小区id参数"); throw new RuntimeException("缺少小区id参数");
} }
if (item.getGroupBuyId() == null) { if (item.getGroupBuyId() == null) {
...@@ -82,7 +80,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -82,7 +80,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
order.setCreateTime(new Date()); order.setCreateTime(new Date());
orderDao.insert(order); orderDao.insert(order);
return order; return order;
}else { } else {
groupOrder.setGroupSize(groupOrder.getGroupSize() + 1); groupOrder.setGroupSize(groupOrder.getGroupSize() + 1);
if (Objects.equals(groupOrder.getGroupSize(), groupBuy.getGroupSize())) { if (Objects.equals(groupOrder.getGroupSize(), groupBuy.getGroupSize())) {
groupOrder.setGroupStatus("1"); groupOrder.setGroupStatus("1");
...@@ -94,6 +92,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -94,6 +92,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 查询团购订单列表 * 查询团购订单列表
*
* @param item * @param item
* @return * @return
*/ */
...@@ -105,13 +104,14 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -105,13 +104,14 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 团购订单详情 * 团购订单详情
*
* @param id * @param id
* @return * @return
*/ */
@Override @Override
public GroupOrder findById(Long id) { public GroupOrder findById(Long id) {
GroupOrder order = orderDao.detailById(id); GroupOrder order = orderDao.detailById(id);
if (order.getSuccessTime()!= null) { if (order.getSuccessTime() != null) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
order.setSuccessTimeStr(formatter.format(order.getSuccessTime())); order.setSuccessTimeStr(formatter.format(order.getSuccessTime()));
} }
...@@ -120,6 +120,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -120,6 +120,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 团购订单用户信息列表 * 团购订单用户信息列表
*
* @param item * @param item
* @return * @return
*/ */
...@@ -131,6 +132,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -131,6 +132,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 购买商品列表 * 购买商品列表
*
* @param item 用户列表id * @param item 用户列表id
* @return * @return
*/ */
...@@ -141,18 +143,28 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -141,18 +143,28 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 退款回调修改退款状态 * 退款回调修改退款状态
*
* @param outRefundNo * @param outRefundNo
* @return * @return
*/ */
@Override @Override
public boolean updateRefundStatus(String outRefundNo) { public boolean updateRefundStatus(String outRefundNo) {
OrderMain order = orderDao.getBySdef1(outRefundNo); OrderRefund orderRefund = refundMapper.selectOne(Wrappers.<OrderRefund>lambdaQuery()
order.setIrefundstatus(OrderMain.STATUS_REFUND_SUC); .eq(OrderRefund::getRefundCode, outRefundNo)
order.setIstatus(OrderMain.STATUS_COMPLETE); .eq(OrderRefund::getRefundStatus, 6));
int update = orderMainDao.updateById(order); orderRefund.setRefundStatus("5");
int update = refundMapper.updateById(orderRefund);
OrderMain order = orderMainDao.selectById(orderRefund.getOrderMianId());
if (orderRefund.getPortion().equals("1")) {
order.setIrefundstatus(OrderMain.STATUS_REFUND_SUC);
order.setIstatus(OrderMain.STATUS_COMPLETE);
orderMainDao.updateById(order);
}
List<OrderSub> orderSubs = this.orderSubDao.selectList(Wrappers.<OrderSub>lambdaQuery().eq(OrderSub::getMainid, order.getId()).eq(OrderSub::getSdef1, 2)); List<OrderSub> orderSubs = this.orderSubDao.selectList(Wrappers.<OrderSub>lambdaQuery().eq(OrderSub::getMainid, order.getId()).eq(OrderSub::getSdef1, 2));
orderSubs.forEach(sub->{ orderSubs.forEach(sub -> {
sub.setSdef1("4"); sub.setSdef1("4");
sub.setSdef2(sub.getSdef3());
sub.setSdef3("0");
orderSubDao.updateById(sub); orderSubDao.updateById(sub);
}); });
if (update > 0) { if (update > 0) {
...@@ -188,6 +200,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -188,6 +200,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 完成 * 完成
*
* @param id * @param id
* @return * @return
*/ */
...@@ -200,6 +213,7 @@ public class GroupOrderServiceImpl implements GroupOrderService { ...@@ -200,6 +213,7 @@ public class GroupOrderServiceImpl implements GroupOrderService {
/** /**
* 支付成功后判断团购订单是否成团 * 支付成功后判断团购订单是否成团
*
* @param curOrder * @param curOrder
*/ */
public void isSuccess(OrderMain curOrder) { public void isSuccess(OrderMain curOrder) {
......
...@@ -2,11 +2,9 @@ package com.yunniu.farming.webadmin.service.impl; ...@@ -2,11 +2,9 @@ package com.yunniu.farming.webadmin.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yunniu.farming.util.*; import com.yunniu.farming.util.*;
import com.yunniu.farming.webadmin.dao.CustomerDao; import com.yunniu.farming.webadmin.dao.*;
import com.yunniu.farming.webadmin.dao.GroupBuyDao;
import com.yunniu.farming.webadmin.dao.IntegralrecDao;
import com.yunniu.farming.webadmin.dao.OrderMainDao;
import com.yunniu.farming.webadmin.model.*; import com.yunniu.farming.webadmin.model.*;
import com.yunniu.farming.webadmin.service.WxService; import com.yunniu.farming.webadmin.service.WxService;
import com.yunniu.farming.wx.WxConfigUtil; import com.yunniu.farming.wx.WxConfigUtil;
...@@ -49,6 +47,9 @@ public class WxServiceImpl implements WxService { ...@@ -49,6 +47,9 @@ public class WxServiceImpl implements WxService {
@Autowired @Autowired
private GroupBuyDao groupBuyDao; private GroupBuyDao groupBuyDao;
@Autowired
private OrderRefundMapper refundMapper;
private String[] imageUrl = {"https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/41e98a7cc2834450b41927219197d713.jpeg" private String[] imageUrl = {"https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/41e98a7cc2834450b41927219197d713.jpeg"
, "https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/65daa7ab2a9c46c99a580874c73465e3.jpeg" , "https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/65daa7ab2a9c46c99a580874c73465e3.jpeg"
, "https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/056bb47d0b274ab7b430ddd522b18ee3.jpeg" , "https://yuezhi-1314984551.cos.ap-shanghai.myqcloud.com/register/056bb47d0b274ab7b430ddd522b18ee3.jpeg"
...@@ -243,9 +244,14 @@ public class WxServiceImpl implements WxService { ...@@ -243,9 +244,14 @@ public class WxServiceImpl implements WxService {
order.setSrefundreason(srefundreason); // 退款理由 order.setSrefundreason(srefundreason); // 退款理由
order.setIrefundstatus(OrderMain.STATUS_CANCEL); order.setIrefundstatus(OrderMain.STATUS_CANCEL);
} }
order.setTrefundtime(new Date()); // order.setTrefundtime(new Date());
order.setRefundorderno(StringHelper.getOrderno()); // order.setRefundorderno(StringHelper.getOrderno());
orderMainDao.updateById(order); // orderMainDao.updateById(order);
OrderRefund refund = refundMapper.selectOne(Wrappers.<OrderRefund>lambdaQuery()
.eq(OrderRefund::getOrderMianId, order.getId())
.eq(OrderRefund::getRefundStatus, 6));
refund.setRefundCode(StringHelper.getOrderno());
refundMapper.updateById(refund);
double tradeMoney = order.getDactmoney(); double tradeMoney = order.getDactmoney();
DecimalFormat decimalFormat = new DecimalFormat("###################"); DecimalFormat decimalFormat = new DecimalFormat("###################");
...@@ -257,15 +263,15 @@ public class WxServiceImpl implements WxService { ...@@ -257,15 +263,15 @@ public class WxServiceImpl implements WxService {
parameters.put("out_trade_no", order.getSorderno()); // 商户订单号 parameters.put("out_trade_no", order.getSorderno()); // 商户订单号
parameters.put("refund_fee_type", "CNY"); // 默认人民币:CNY parameters.put("refund_fee_type", "CNY"); // 默认人民币:CNY
parameters.put("total_fee", decimalFormat.format(tradeMoney * 100)); // 订单总金额 parameters.put("total_fee", decimalFormat.format(tradeMoney * 100)); // 订单总金额
if (order.getIrefundstatus().equals(OrderMain.STATUS_APPLICATION)) { if (refund.getRefundStatus().equals(1)) {
parameters.put("refund_fee", decimalFormat.format(order.getIrefundmoney() * 100)); // 订单总金额 parameters.put("refund_fee", decimalFormat.format(refund.getRefundMoney() * 100)); // 订单总金额
}else { }else {
parameters.put("refund_fee", decimalFormat.format(order.getIrefundmoney() * 100)); // 退款金额 parameters.put("refund_fee", decimalFormat.format(refund.getRefundMoney() * 100)); // 退款金额
} }
//parameters.put("profit_sharing", "Y"); //parameters.put("profit_sharing", "Y");
// 用户端实际ip // 用户端实际ip
parameters.put("notify_url", WxConfigUtil.refund_notify_url); // 接收微信支付异步通知回调地址 parameters.put("notify_url", WxConfigUtil.refund_notify_url); // 接收微信支付异步通知回调地址
parameters.put("out_refund_no", order.getRefundorderno()); parameters.put("out_refund_no", refund.getRefundCode());
System.out.println("sign=====" + parameters); System.out.println("sign=====" + parameters);
// 设置签名 // 设置签名
String sign = WxUtil.createSignMD5(parameters); String sign = WxUtil.createSignMD5(parameters);
......
...@@ -15,9 +15,9 @@ public class WxConfigUtil { ...@@ -15,9 +15,9 @@ public class WxConfigUtil {
public final static String UNIFIED_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder"; public final static String UNIFIED_ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
public final static String PROFIT_SHARING_URL = "https://api.mch.weixin.qq.com/secapi/pay/profitsharing"; public final static String PROFIT_SHARING_URL = "https://api.mch.weixin.qq.com/secapi/pay/profitsharing";
public final static String PROFIT_SHARING_ADDRECEIVER = "https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver"; public final static String PROFIT_SHARING_ADDRECEIVER = "https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver";
// public final static String notify_url = "http://farming.nyinhong.com/wx/notify"; // 订单回调接口 // public final static String notify_url = "http://felo.nyinhong.com/wx/notify"; // 订单回调接口
public final static String notify_url = "https://qpxdnyy.com/wx/notify"; // 订单回调接口 public final static String notify_url = "https://qpxdnyy.com/wx/notify"; // 订单回调接口
// public final static String refund_notify_url = "http://farming.nyinhong.com/wx/wxRefundNotify"; // 订单回调接口 // public final static String refund_notify_url = "http://felo.nyinhong.com/wx/wxRefundNotify"; // 订单回调接口
public final static String refund_notify_url = "https://qpxdnyy.com/wx/wxRefundNotify"; // 订单回调接口 public final static String refund_notify_url = "https://qpxdnyy.com/wx/wxRefundNotify"; // 订单回调接口
public final static String REFUND_ORDER_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund"; public final static String REFUND_ORDER_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";
public static String GET_MINICODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit"; public static String GET_MINICODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit";
......
...@@ -3,6 +3,7 @@ package com.yunniu.farming.wx; ...@@ -3,6 +3,7 @@ package com.yunniu.farming.wx;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yunniu.farming.util.HttpClientUtil; import com.yunniu.farming.util.HttpClientUtil;
import org.apache.commons.codec.digest.DigestUtils;
import org.jdom.JDOMException; import org.jdom.JDOMException;
import javax.crypto.Mac; import javax.crypto.Mac;
...@@ -102,8 +103,8 @@ public class WxUtil { ...@@ -102,8 +103,8 @@ public class WxUtil {
} }
} }
sb.append("key=" + WxConfigUtil.API_KEY); sb.append("key=" + WxConfigUtil.API_KEY);
String sign = MD5(sb.toString()); String sign = DigestUtils.md5Hex(sb.toString());
return sign; return sign.toUpperCase();
} }
......
...@@ -83,12 +83,12 @@ ...@@ -83,12 +83,12 @@
<script type="text/html" id="table-handle"> <script type="text/html" id="table-handle">
<i class="layui-icon layui-icon-form" lay-event="orderDetail" title="订单详情"></i> <i class="layui-icon layui-icon-form" lay-event="orderDetail" title="订单详情"></i>
<!-- 101退款申请中 102待退货 103待退款 104退款成功 105退款拒绝--> <!-- 101退款申请中 102待退货 103待退款 104退款成功 105退款拒绝-->
{{#if (d.irefundstatus == 101) { }} {{#if (d.orderRefund.refundStatus == 1 && d.orderRefund.refundType == 1) { }}
<i class="layui-icon layui-icon-ok" lay-event="pass" title="退款申请通过"></i> <i class="layui-icon layui-icon-ok" lay-event="pass" title="退款申请通过"></i>
<i class="layui-icon layui-icon-close" lay-event="refuse" title="退款申请拒绝"></i> <i class="layui-icon layui-icon-close" lay-event="refuse" title="退款申请拒绝"></i>
{{# }else if(d.irefundstatus == 103){ }} {{# }else if(d.orderRefund.refundStatus == 4){ }}
<i class="layui-icon layui-icon-component" lay-event="receive" title="退款已收货"></i> <i class="layui-icon layui-icon-component" lay-event="receive" title="退款已收货"></i>
{{# }else if(d.irefundstatus == 106){ }} {{# }else if(d.orderRefund.refundStatus == 1 && d.orderRefund.refundType == 2){ }}
<i class="layui-icon layui-icon-ok" lay-event="pass" title="仅退款申请通过"></i> <i class="layui-icon layui-icon-ok" lay-event="pass" title="仅退款申请通过"></i>
<i class="layui-icon layui-icon-close" lay-event="refuse" title="仅退款申请拒绝"></i> <i class="layui-icon layui-icon-close" lay-event="refuse" title="仅退款申请拒绝"></i>
{{# } }} {{# } }}
...@@ -165,27 +165,28 @@ ...@@ -165,27 +165,28 @@
str += "<span style=''>" + d.customer.swxnick ? d.customer.swxnick : '' + "</span>" str += "<span style=''>" + d.customer.swxnick ? d.customer.swxnick : '' + "</span>"
} }
} }
return str; return str;
} }
} }
,{ ,{
title: "订单金额", title: "订单金额",
width: 150, width: 150,
templet: function(d) { templet: function(d) {
var str = ""; var str = "";
str += '金额:<span style="color:red;"> '+(d.dactmoney ? d.dactmoney : 0)+ '</span>&nbsp'; str += '金额:<span style="color:red;"> '+(d.dactmoney ? d.dactmoney : 0)+ '</span>&nbsp';
str += '积分:<span style="color:red;"> '+(d.dactscore ? d.dactscore : 0)+ '</span>'; str += '积分:<span style="color:red;"> '+(d.dactscore ? d.dactscore : 0)+ '</span>';
str += '</div>'; str += '</div>';
return str ? str : ""; return str ? str : "";
} }
} }
, {field: 'irefundmoney', width: 150, title: '退款金额'} , {width: 150, title: '退款金额',
templet: function(d) {
var str = "";
str += '<span> '+(d.orderRefund.refundMoney ? d.orderRefund.refundMoney : 0)+ '</span>&nbsp';
str += '</div>';
return str ? str : "";
}
}
,{ ,{
title: "订单状态", title: "订单状态",
width: 200, width: 200,
...@@ -209,12 +210,12 @@ ...@@ -209,12 +210,12 @@
str += ' <span>' + status + '</span>'; str += ' <span>' + status + '</span>';
// 101退款申请中 102待退货 103待退款 104退款成功 // 101退款申请中 102待退货 103待退款 104退款成功
var refundStatus = ""; var refundStatus = "";
if (d.irefundstatus == 101) refundStatus = "<span class='layui-badge layui-bg-red'>退款申请</span>"; if (d.orderRefund.refundStatus == 1 && d.orderRefund.refundType == 1) refundStatus = "<span class='layui-badge layui-bg-red'>退款申请</span>";
if (d.irefundstatus == 102) refundStatus = "<span class='layui-badge layui-bg-orange'>待退货</span>"; if (d.orderRefund.refundStatus == 4) refundStatus = "<span class='layui-badge layui-bg-orange'>待退货</span>";
if (d.irefundstatus == 103) refundStatus = "<span class='layui-badge layui-bg-orange'>待退款</span>"; if (d.orderRefund.refundStatus == 6) refundStatus = "<span class='layui-badge layui-bg-orange'>待退款</span>";
if (d.irefundstatus == 104) refundStatus = "<span class='layui-badge layui-bg-green'>退款成功</span>"; if (d.orderRefund.refundStatus == 5) refundStatus = "<span class='layui-badge layui-bg-green'>退款成功</span>";
if (d.irefundstatus == 105) refundStatus = "<span class='layui-badge layui-bg-cyan'>退款拒绝</span>"; if (d.orderRefund.refundStatus == 3) refundStatus = "<span class='layui-badge layui-bg-cyan'>退款拒绝</span>";
if (d.irefundstatus == 106) refundStatus = "<span class='layui-badge layui-bg-red'>仅退款申请</span>"; if (d.orderRefund.refundStatus == 1 && d.orderRefund.refundType == 2) refundStatus = "<span class='layui-badge layui-bg-red'>仅退款申请</span>";
str += ' <span>' + refundStatus + '</span>'; str += ' <span>' + refundStatus + '</span>';
str += '</div>'; str += '</div>';
return str ? str : ""; return str ? str : "";
...@@ -222,18 +223,32 @@ ...@@ -222,18 +223,32 @@
} }
, {field: 'tordertime', width: 100, title: '下单日期'} , {field: 'tordertime', width: 100, title: '下单日期'}
, {field: 'sremark', width: 100,title: '备注'} , {field: 'sremark', width: 100,title: '备注'}
, {field: 'trefundtime', width: 100, title: '退款时间'} , {width: 100, title: '退款时间',
templet: function(d) {
var str = "";
str += '<span> '+(d.orderRefund.refundSucTime ? d.orderRefund.refundSucTime : "")+ '</span>&nbsp';
str += '</div>';
return str ? str : "";
}
}
,{ ,{
width: 100, width: 100,
title: "退款图片", title: "退款图片",
align: "center", align: "center",
templet: function(d) { templet: function(d) {
return d.srefundpic ? '<div><img id="zi' + d.id + '" src="' + d.srefundpic + return d.orderRefund.refundImg ? '<div><img id="zi' + d.id + '" src="' + d.orderRefund.refundImg +
'" onmouseover="bigImg(this)" onmouseout="smallImg()" onclick="tolook(src)" style="height:20px;"></div>' : '" onmouseover="bigImg(this)" onmouseout="smallImg()" onclick="tolook(src)" style="height:20px;"></div>' :
''; '';
} }
} }
, {field: 'srefundreason', width: 100, title: '退款理由'} , {width: 100, title: '退款理由',
templet: function(d) {
var str = "";
str += '<span> '+(d.orderRefund.refundReason ? d.orderRefund.refundReason : "")+ '</span>&nbsp';
str += '</div>';
return str ? str : "";
}
}
, {field: 'couriernumber', width: 120, title: '退款快递单号'} , {field: 'couriernumber', width: 120, title: '退款快递单号'}
, {field: 'scusaddr', width: 100, title: '地址'} , {field: 'scusaddr', width: 100, title: '地址'}
, {field: 'scuname', width: 100, title: '联系姓名'} , {field: 'scuname', width: 100, title: '联系姓名'}
......
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