update
This commit is contained in:
@ -345,16 +345,30 @@ public class OrderApi {
|
||||
WisdUserAddress address = userAddressService.getById(addressId);
|
||||
if (order.getStatus().equals(1) || order.getStatus().equals(2)) {
|
||||
order.setAddressId(addressId);
|
||||
order.setOrderPhone(address.getAddressPhone());
|
||||
order.setOederCostomer(address.getAddressName());
|
||||
order.setOrderAddress(address.getAddressProvince() + address.getAddressCity() + address.getAddressArea() + address.getAddressDetailed());
|
||||
orderService.updateById(order);
|
||||
return ResultUtil.success("地址修改成功");
|
||||
}
|
||||
order.setPendingApprovalAddressId(addressId);
|
||||
order.setPendingApprovalOrderPhone(address.getAddressPhone());
|
||||
order.setPendingApprovalOederCustomer(address.getAddressName());
|
||||
order.setPendingApprovalOrderAddress(address.getAddressProvince() + address.getAddressCity() + address.getAddressArea() + address.getAddressDetailed());
|
||||
orderService.updateById(order);
|
||||
return ResultUtil.success("已申请修改地址");
|
||||
}
|
||||
|
||||
// 撤销售后申请
|
||||
@RequestMapping(value = "cancelRefund")
|
||||
@ResponseBody
|
||||
public Result cancelRefund(Long orderId) {
|
||||
WisdOeder order = orderService.getById(orderId);
|
||||
order.setAfterSalesStatus(null);
|
||||
// TODO: 将退换货相关字段设为null
|
||||
orderService.updateById(order);
|
||||
return ResultUtil.success("已撤销售后申请");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "订单列表")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", paramType = "userId"), @ApiImplicitParam(name = "status", value = "1待支付 2代发货/待核销 3待收货 4已完成/已核销 5已取消 6退换货 )", paramType = "status")})
|
||||
|
@ -110,9 +110,15 @@ public class UserApi {
|
||||
QueryWrapper<WisdOeder> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId);
|
||||
if (status == 6) {
|
||||
queryWrapper.and(wrapper -> wrapper.eq("status", status).or().eq("status", 61).or().eq("status", 62).or().eq("status", 63).or().eq("status", 64).or().eq("status", 65).or().eq("status", 66));
|
||||
queryWrapper.and(wrapper -> wrapper.eq("after_sales_status", status).or().eq("after_sales_status", 61).or().eq("after_sales_status", 62).or().eq("after_sales_status", 63).or().eq("after_sales_status", 64).or().eq("after_sales_status", 65).or().eq("after_sales_status", 66));
|
||||
} else {
|
||||
queryWrapper.eq("status", status);
|
||||
queryWrapper.eq("status", status).and(wrapper -> wrapper
|
||||
.ne("after_sales_status", 61)
|
||||
.ne("after_sales_status", 62)
|
||||
.ne("after_sales_status", 63)
|
||||
.ne("after_sales_status", 64)
|
||||
.ne("after_sales_status", 65)
|
||||
);
|
||||
}
|
||||
queryWrapper.eq("is_deleted", 0);
|
||||
return orderService.count(queryWrapper);
|
||||
|
@ -10,5 +10,7 @@ public class EditOrderAddressDto {
|
||||
private int orderId;
|
||||
private String orderAddress;
|
||||
private String logisticsName;
|
||||
private String orderPhone;
|
||||
private String oederCostomer;
|
||||
private List<PackageDto> logistics;
|
||||
}
|
||||
|
@ -306,6 +306,8 @@ public class OrderController {
|
||||
//type 1 一级弹出层 2二级弹出层
|
||||
ModelAndView modelAndView = new ModelAndView("pages/order/order_refund_remarke");
|
||||
modelAndView.addObject("orderId", orderId);
|
||||
modelAndView.addObject("orderRefund", order.getOrderRefund());
|
||||
modelAndView.addObject("orderRefundImg", order.getOrderRefundImg());
|
||||
modelAndView.addObject("type", type);
|
||||
modelAndView.addObject("agree", agree);
|
||||
modelAndView.addObject("packages", order.getLogistics() == null ? "[]" : order.getLogistics());
|
||||
@ -339,7 +341,7 @@ public class OrderController {
|
||||
order.setOrderRefundTimes(three_days_after);
|
||||
} else if (refundRemarkesDto.getAgree() == 2) {
|
||||
// TODO: 拒绝退换货后订单回到**状态
|
||||
order.setStatus(3);
|
||||
// order.setStatus(3);
|
||||
order.setAfterSalesStatus(66);
|
||||
order.setOrderRefundMerchantsTime(new Date());
|
||||
}
|
||||
@ -360,7 +362,7 @@ public class OrderController {
|
||||
public Result nodelivery(Long orderId) {
|
||||
WisdOeder order = orderService.getById(orderId);
|
||||
// TODO: 拒绝退换货后订单回到**状态
|
||||
order.setStatus(3);
|
||||
// order.setStatus(3);
|
||||
order.setAfterSalesStatus(66);
|
||||
order.setOrderRefundMerchantsTime(new Date());
|
||||
Boolean flag = orderService.saveOrUpdate(order);
|
||||
@ -457,7 +459,7 @@ public class OrderController {
|
||||
public Result nodeliveryStatus(Long orderId) {
|
||||
WisdOeder wisdOeder = orderService.getById(orderId);
|
||||
// FIXME: 拒绝退货后修改状态
|
||||
wisdOeder.setStatus(3);
|
||||
// wisdOeder.setStatus(3);
|
||||
wisdOeder.setAfterSalesStatus(66);
|
||||
Boolean flag = orderService.saveOrUpdate(wisdOeder);
|
||||
if (flag) {
|
||||
@ -557,7 +559,7 @@ public class OrderController {
|
||||
public Result refund(Long orderId) {
|
||||
WisdOeder order = orderService.getById(orderId);
|
||||
// TODO: 拒绝退换货后订单回到**状态
|
||||
order.setStatus(3);
|
||||
// order.setStatus(3);
|
||||
order.setAfterSalesStatus(66);
|
||||
order.setOrderRefundMerchantsTime(new Date());
|
||||
Boolean flag = orderService.saveOrUpdate(order);
|
||||
@ -573,7 +575,7 @@ public class OrderController {
|
||||
public Result refundno(Long orderId) {
|
||||
WisdOeder order = orderService.getById(orderId);
|
||||
// TODO: 拒绝退换货后订单回到**状态
|
||||
order.setStatus(3);
|
||||
// order.setStatus(3);
|
||||
order.setAfterSalesStatus(66);
|
||||
order.setOrderRefundMerchantsTime(new Date());
|
||||
Boolean flag = orderService.saveOrUpdate(order);
|
||||
@ -623,6 +625,8 @@ public class OrderController {
|
||||
if (addressDto.getType().equals(1)) {
|
||||
order.setOrderAddress(order.getPendingApprovalOrderAddress());
|
||||
order.setAddressId(order.getPendingApprovalAddressId());
|
||||
order.setOrderPhone(order.getPendingApprovalOrderPhone());
|
||||
order.setOederCostomer(order.getPendingApprovalOederCustomer());
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String deliverGoodsJson = mapper.writeValueAsString(addressDto.getLogistics());
|
||||
order.setLogistics(deliverGoodsJson);
|
||||
@ -633,6 +637,8 @@ public class OrderController {
|
||||
} else if (addressDto.getType().equals(0)) {
|
||||
order.setPendingApprovalAddressId(null);
|
||||
order.setPendingApprovalOrderAddress(null);
|
||||
order.setPendingApprovalOrderPhone(null);
|
||||
order.setPendingApprovalOederCustomer(null);
|
||||
return ResultUtil.success("已拒绝修改地址");
|
||||
} else {
|
||||
return ResultUtil.error("参数错误");
|
||||
@ -647,6 +653,8 @@ public class OrderController {
|
||||
String deliverGoodsJson = mapper.writeValueAsString(address.getLogistics());
|
||||
order.setLogistics(deliverGoodsJson);
|
||||
order.setOrderAddress(address.getOrderAddress());
|
||||
order.setOederCostomer(address.getOederCostomer());
|
||||
order.setOrderPhone(address.getOrderPhone());
|
||||
order.setLogisticsName(address.getLogisticsName());
|
||||
orderService.updateById(order);
|
||||
return ResultUtil.success("地址修改成功");
|
||||
|
@ -89,6 +89,16 @@ public class WisdOeder implements Serializable {
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String pendingApprovalOrderAddress;
|
||||
/**
|
||||
* 待批准的新收货号码
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String pendingApprovalOrderPhone;
|
||||
/**
|
||||
* 待批准的新收货人姓名
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String pendingApprovalOederCustomer;
|
||||
/**
|
||||
* 联系地址
|
||||
*/
|
||||
@ -123,13 +133,16 @@ public class WisdOeder implements Serializable {
|
||||
/**
|
||||
* 状态(61申请换货 62申请退款 63退换货确认 64退换货物流信息提交 65退换货完成 66退换货失败)
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer afterSalesStatus;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderPayTime;
|
||||
|
||||
/**
|
||||
* 发货时间
|
||||
*/
|
||||
@ -236,6 +249,8 @@ public class WisdOeder implements Serializable {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date cancelTime;
|
||||
|
||||
private String refundJson;
|
||||
|
||||
/**
|
||||
* 退货原因
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
#开发环境
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.0.233:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://192.168.0.146:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: yshop
|
||||
# username: root
|
||||
|
@ -30,16 +30,20 @@
|
||||
<div id="root"></div>
|
||||
<script type="text/babel">
|
||||
// let __logistics = []
|
||||
const __logistics = ${logistics};
|
||||
const orderId = ${orderId};
|
||||
const type = ${type};
|
||||
const __logistics = ${logistics};
|
||||
const __orderAddress = "${order.orderAddress}";
|
||||
const __logisticsName = "${order.logisticsName}";
|
||||
const type = ${type};
|
||||
const __oederCostomer = "${order.oederCostomer}";
|
||||
const __orderPhone = "${order.orderPhone}";
|
||||
const {useState} = React
|
||||
const App = () => {
|
||||
const [logisticsName, setLogisticsName] = useState(__logisticsName)
|
||||
const [orderAddress, setOrderAddress] = useState(__orderAddress)
|
||||
const [logistics, setLogistics] = useState(__logistics)
|
||||
const [oederCostomer, setOederCostomer] = useState(__oederCostomer)
|
||||
const [orderPhone, setOrderPhone] = useState(__orderPhone)
|
||||
return <div className="p-4">
|
||||
<form>
|
||||
<div className="layui-form-item">
|
||||
@ -62,6 +66,26 @@
|
||||
placeholder="请输入物流公司" autoComplete="off" className="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="layui-form-item">
|
||||
<label htmlFor="oederCostomer" className="layui-form-label w-24">联系人姓名</label>
|
||||
<div className="layui-input-block">
|
||||
<input type="text" id="oederCostomer" name="oederCostomer" value={oederCostomer}
|
||||
onInput={ev => {
|
||||
setOederCostomer(ev.target.value)
|
||||
}}
|
||||
placeholder="请输入联系人姓名" autoComplete="off" className="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="layui-form-item">
|
||||
<label htmlFor="orderPhone" className="layui-form-label w-24">联系人号码</label>
|
||||
<div className="layui-input-block">
|
||||
<input type="text" id="orderPhone" name="orderPhone" value={orderPhone}
|
||||
onInput={ev => {
|
||||
setOrderPhone(ev.target.value)
|
||||
}}
|
||||
placeholder="请输入联系人号码" autoComplete="off" className="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
{logistics && logistics.map((pack, index) => <div
|
||||
key={pack.id}
|
||||
className={"mt-4 pt-4 pr-2 border rounded relative"}>
|
||||
@ -107,7 +131,9 @@
|
||||
orderId,
|
||||
orderAddress,
|
||||
logisticsName,
|
||||
logistics
|
||||
logistics,
|
||||
orderPhone,
|
||||
oederCostomer
|
||||
}
|
||||
$modal({
|
||||
type: 'confirm',
|
||||
|
@ -10,6 +10,7 @@
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<link rel="stylesheet" href="${root}/static/core/css/wuliu.css" media="all">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid">
|
||||
@ -23,7 +24,8 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="30%">订单号:${obj.orderNumber}</td>
|
||||
<td width="30%">微信支付(含邮费):<span class="layui-badge-rim">¥${obj.orderActualPay}</span></td>
|
||||
<td width="30%">微信支付(含邮费):<span class="layui-badge-rim">¥${obj.orderActualPay}</span>
|
||||
</td>
|
||||
<td>其他支付:<span class="layui-badge-rim">¥${obj.orderOtherPay}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -36,8 +38,15 @@
|
||||
</td>
|
||||
<td style="color: #1E9FFF">物流单号:
|
||||
<c:choose>
|
||||
<c:when test="${obj.logisticsNum == null || order.logisticsNum==''}">未发货</c:when>
|
||||
<c:otherwise>${obj.logisticsNum}  <a href="javascript:;" class="getLogistics" data="${obj.logisticsNum}" style="color: #1E9FFF">[查询]</a></c:otherwise>
|
||||
<c:when test="${obj.logistics == null || order.logistics==''}">未发货</c:when>
|
||||
<c:otherwise>
|
||||
<div id="logisticsNumbers">
|
||||
${logisticsNumbers}  <a href="javascript:;"
|
||||
class="getLogistics"
|
||||
data="${obj.logisticsNum}"
|
||||
style="color: #1E9FFF">[查询]</a>
|
||||
</div>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</c:if>
|
||||
@ -190,18 +199,22 @@
|
||||
<tr>
|
||||
<td>
|
||||
<c:if test="${ obj.status==61 && obj.orderRefundType!=3}">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal delivery" lay-event="delivery">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal delivery"
|
||||
lay-event="delivery">
|
||||
同意换货
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliverys" lay-event="nodeliverys">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliverys"
|
||||
lay-event="nodeliverys">
|
||||
拒绝换货
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${ obj.status==62 && obj.orderRefundType!=3}">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal delivery" lay-event="delivery">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal delivery"
|
||||
lay-event="delivery">
|
||||
同意退款
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliverys" lay-event="nodeliverys">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliverys"
|
||||
lay-event="nodeliverys">
|
||||
拒绝退款
|
||||
</button>
|
||||
</c:if>
|
||||
@ -209,15 +222,18 @@
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal deliveryMoney"
|
||||
lay-event="deliveryMoney">完成退换货
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodelivery" lay-event="nodelivery">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodelivery"
|
||||
lay-event="nodelivery">
|
||||
拒绝退换货
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${ obj.status==62 && obj.orderRefundType==3}">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal deliveryStatus" lay-event="deliveryStatus">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal deliveryStatus"
|
||||
lay-event="deliveryStatus">
|
||||
同意退款
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliveryStatus" lay-event="nodeliveryStatus">
|
||||
<button class="layui-btn layui-btn-sm layui-btn-danger nodeliveryStatus"
|
||||
lay-event="nodeliveryStatus">
|
||||
拒绝退款
|
||||
</button>
|
||||
</c:if>
|
||||
@ -281,7 +297,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
layui.use(['layer', 'form'], function () {
|
||||
var $ = layui.$,
|
||||
@ -307,7 +322,7 @@
|
||||
type: 2,
|
||||
content: root + "/order/refundRemarke?agree=1&type=1&orderId=" + ${obj.id},
|
||||
area: ['1000px', '600px']
|
||||
,offset: '20%'
|
||||
, offset: '20%'
|
||||
});
|
||||
});
|
||||
|
||||
@ -317,7 +332,7 @@
|
||||
type: 2,
|
||||
content: root + "/order/refundRemarke?agree=2&type=1&orderId=" + ${obj.id},
|
||||
area: ['1000px', '600px']
|
||||
,offset: '20%'
|
||||
, offset: '20%'
|
||||
});
|
||||
});
|
||||
|
||||
@ -430,9 +445,9 @@
|
||||
type: 2,
|
||||
content: root + "/order/getRefundLogistics?type=1&orderId=" + ${obj.id},
|
||||
area: ['500px', '300px']
|
||||
,offset: '20%'
|
||||
, offset: '20%'
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
$modal({
|
||||
type: 'confirm',
|
||||
icon: 'question',
|
||||
@ -455,7 +470,7 @@
|
||||
function nodelivery(id, type) {
|
||||
var index = layer.load(2);
|
||||
console.log($(".layui-laypage-em").next().html());
|
||||
$.post(root + "/order/nodelivery?orderId="+id, function (e) {
|
||||
$.post(root + "/order/nodelivery?orderId=" + id, function (e) {
|
||||
//layer.close(index);
|
||||
if (e.code == 1) {
|
||||
$.message({
|
||||
@ -480,7 +495,7 @@
|
||||
function deliveryMoney(id, type) {
|
||||
var index = layer.load(2);
|
||||
console.log($(".layui-laypage-em").next().html());
|
||||
$.post(root + "/order/deliveryMoney?orderId="+id, function (e) {
|
||||
$.post(root + "/order/deliveryMoney?orderId=" + id, function (e) {
|
||||
//layer.close(index);
|
||||
if (e.code == 1) {
|
||||
$.message({
|
||||
@ -578,4 +593,11 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
const logistics = ${obj.logistics};
|
||||
const logisticsNumbers = logistics.map(el => el.logisticsNumber).join(",")
|
||||
console.log(logisticsNumbers)
|
||||
document.getElementById("logisticsNumbers").innerHTML = logisticsNumbers
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -21,6 +21,8 @@
|
||||
<script>
|
||||
const __packages = ${packages};
|
||||
const type = ${type};
|
||||
const orderRefund = "${orderRefund}";
|
||||
const orderRefundImg = "${orderRefundImg}";
|
||||
</script>
|
||||
</head>
|
||||
<body style="background: white">
|
||||
@ -30,6 +32,21 @@
|
||||
const App = () => {
|
||||
const [orderRefundRemarke, setOrderRefundRemarke] = useState("")
|
||||
return <div className="p-4">
|
||||
<div className="layui-form-item">
|
||||
<label className="layui-form-label w-[100px]"
|
||||
htmlFor={"orderRefund"}>退换货说明</label>
|
||||
<div className="layui-input-block">
|
||||
<input type="text" name="orderRefund" id={"orderRefund"}
|
||||
value={orderRefund}
|
||||
readOnly
|
||||
placeholder="请输入运单号"
|
||||
autoComplete="off" className="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center mb-[15px]">
|
||||
<div className="w-[100px] px-[15px] text-right text-sm">退换货图片</div>
|
||||
{orderRefundImg?.split(",")?.map(img => <img className="w-24 h-24 ml-[10px]" key={img} src={img} alt=""/>)}
|
||||
</div>
|
||||
{(__packages.find(el => el.afterSalesStatus) ? __packages.filter(el => el.afterSalesStatus) : __packages).map((pack, idx) =>
|
||||
<div
|
||||
key={pack.id}
|
||||
@ -41,7 +58,7 @@
|
||||
// setActivePackage(() => index)
|
||||
}}
|
||||
className={"mt-4 pt-4 pr-2 border rounded relative"}>
|
||||
<div className="absolute left-4 -top-3 bg-white">需换货包裹</div>
|
||||
<div className="absolute left-4 -top-3 bg-white">需退换货包裹</div>
|
||||
<div className="layui-form-item">
|
||||
<label className="layui-form-label w-[100px]"
|
||||
htmlFor={"logisticsNumber" + idx}>运单号</label>
|
||||
|
Reference in New Issue
Block a user