优化wei订单拉取
This commit is contained in:
parent
b561226db7
commit
5c35a114ae
|
|
@ -41,22 +41,6 @@ public class DouOrderContoller extends BaseController {
|
||||||
return success(orderService.queryDetailById(id));
|
return success(orderService.queryDetailById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 手动推送到系统
|
|
||||||
* @param bo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/push_oms")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult pushOms(@RequestBody DouOrderPushBo bo) {
|
|
||||||
// TODO:需要优化消息格式
|
|
||||||
if(bo!=null && bo.getIds()!=null) {
|
|
||||||
for(String id: bo.getIds()) {
|
|
||||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.DOU, MqType.ORDER_MESSAGE, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/confirmOrder")
|
@PostMapping("/confirmOrder")
|
||||||
public AjaxResult confirmOrder(@RequestBody DouOrderConfirmBo bo) {
|
public AjaxResult confirmOrder(@RequestBody DouOrderConfirmBo bo) {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import cn.qihangerp.open.wei.model.OrderDetailDeliverInfoAddress;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
import cn.qihangerp.security.common.BaseController;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -21,16 +22,22 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import cn.qihangerp.model.request.OrderPullRequest;
|
import cn.qihangerp.model.request.OrderPullRequest;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@RequestMapping("/wei/order")
|
@RequestMapping("/wei/order")
|
||||||
@RestController
|
@RestController
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class WeiOrderApiController extends BaseController {
|
public class WeiOrderApiController extends BaseController {
|
||||||
private final WeiApiCommon apiCommon;
|
private final WeiApiCommon apiCommon;
|
||||||
private final WeiOrderService weiOrderService;
|
private final WeiOrderService weiOrderService;
|
||||||
|
private final String DATE_PATTERN =
|
||||||
|
"^(?:(?:(?:\\d{4}-(?:0?[1-9]|1[0-2])-(?:0?[1-9]|1\\d|2[0-8]))|(?:(?:(?:\\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:(?:0[48]|[2468][048]|[13579][26])00))-0?2-29))$)|(?:(?:(?:\\d{4}-(?:0?[13578]|1[02]))-(?:0?[1-9]|[12]\\d|30))$)|(?:(?:(?:\\d{4}-0?[13-9]|1[0-2])-(?:0?[1-9]|[1-2]\\d|30))$)|(?:(?:(?:\\d{2}(?:0[48]|[13579][26]|[2468][048])|(?:(?:0[48]|[13579][26]|[2468][048])00))-0?2-29))$)$";
|
||||||
|
private final Pattern DATE_FORMAT = Pattern.compile(DATE_PATTERN);
|
||||||
/**
|
/**
|
||||||
* 拉取订单
|
* 拉取订单
|
||||||
* @param params
|
* @param params
|
||||||
|
|
@ -41,6 +48,16 @@ public class WeiOrderApiController extends BaseController {
|
||||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isEmpty(params.getStartTime())) {
|
||||||
|
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有下单日期");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断时间格式
|
||||||
|
Matcher matcher = DATE_FORMAT.matcher(params.getStartTime());
|
||||||
|
boolean b = matcher.find();
|
||||||
|
if (!b) {
|
||||||
|
return AjaxResult.error("下单日期格式错误");
|
||||||
|
}
|
||||||
|
|
||||||
var checkResult = apiCommon.checkBefore(params.getShopId());
|
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||||
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
|
|
@ -50,8 +67,9 @@ public class WeiOrderApiController extends BaseController {
|
||||||
String accessToken = checkResult.getData().getAccessToken();
|
String accessToken = checkResult.getData().getAccessToken();
|
||||||
// String appKey = checkResult.getData().getAppKey();
|
// String appKey = checkResult.getData().getAppKey();
|
||||||
// String appSecret = checkResult.getData().getAppSecret();
|
// String appSecret = checkResult.getData().getAppSecret();
|
||||||
LocalDateTime endTime = LocalDateTime.now();
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
LocalDateTime startTime = endTime.minusHours(1);
|
LocalDateTime startTime = LocalDateTime.parse(params.getStartTime() + " 00:00:01", formatter);
|
||||||
|
LocalDateTime endTime = LocalDateTime.parse(params.getStartTime() + " 23:59:59", formatter);
|
||||||
ApiResultVo<Order> orderApiResultVo = WeiOrderApiHelper.pullOrderList(startTime, endTime, accessToken,1,100);
|
ApiResultVo<Order> orderApiResultVo = WeiOrderApiHelper.pullOrderList(startTime, endTime, accessToken,1,100);
|
||||||
|
|
||||||
// ApiResultVo<Order> apiResultVo = OrderApiHelper.pullOrderList(startTime, endTime, accessToken);
|
// ApiResultVo<Order> apiResultVo = OrderApiHelper.pullOrderList(startTime, endTime, accessToken);
|
||||||
|
|
@ -138,13 +156,14 @@ public class WeiOrderApiController extends BaseController {
|
||||||
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
insertSuccess++;
|
insertSuccess++;
|
||||||
} else {
|
} else {
|
||||||
|
log.error(result.getMsg());
|
||||||
totalError++;
|
totalError++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String msg = "成功{startTime:"+startTime.format(formatter)+",endTime:"+endTime.format(formatter)+"} 新增:" + insertSuccess + "条,添加错误:" + totalError + "条,更新:" + hasExistOrder + "条";
|
||||||
return AjaxResult.success();
|
return AjaxResult.success(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import cn.qihangerp.common.enums.EnumShopType;
|
||||||
import cn.qihangerp.common.mq.MqMessage;
|
import cn.qihangerp.common.mq.MqMessage;
|
||||||
import cn.qihangerp.common.mq.MqType;
|
import cn.qihangerp.common.mq.MqType;
|
||||||
import cn.qihangerp.common.mq.MqUtils;
|
import cn.qihangerp.common.mq.MqUtils;
|
||||||
|
import cn.qihangerp.model.bo.WeiOrderBo;
|
||||||
import cn.qihangerp.model.entity.WeiOrder;
|
import cn.qihangerp.model.entity.WeiOrder;
|
||||||
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
||||||
import cn.qihangerp.model.bo.WeiOrderPushBo;
|
import cn.qihangerp.model.bo.WeiOrderPushBo;
|
||||||
|
|
@ -27,7 +28,7 @@ public class WeiOrderController extends BaseController {
|
||||||
private final WeiOrderService orderService;
|
private final WeiOrderService orderService;
|
||||||
private final MqUtils mqUtils;
|
private final MqUtils mqUtils;
|
||||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||||
public TableDataInfo orderList(WeiOrder bo, PageQuery pageQuery) {
|
public TableDataInfo orderList(WeiOrderBo bo, PageQuery pageQuery) {
|
||||||
PageResult<WeiOrder> result = orderService.queryPageList(bo, pageQuery);
|
PageResult<WeiOrder> result = orderService.queryPageList(bo, pageQuery);
|
||||||
|
|
||||||
return getDataTable(result);
|
return getDataTable(result);
|
||||||
|
|
@ -39,17 +40,7 @@ public class WeiOrderController extends BaseController {
|
||||||
return success(orderService.queryDetailById(id));
|
return success(orderService.queryDetailById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/push_oms")
|
|
||||||
@ResponseBody
|
|
||||||
public AjaxResult pushOms(@RequestBody WeiOrderPushBo bo) {
|
|
||||||
// TODO:需要优化消息格式
|
|
||||||
if(bo!=null && bo.getIds()!=null) {
|
|
||||||
for(String id: bo.getIds()) {
|
|
||||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.WEI, MqType.ORDER_MESSAGE, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
@PostMapping("/confirmOrder")
|
@PostMapping("/confirmOrder")
|
||||||
public AjaxResult confirmOrder(@RequestBody WeiOrderConfirmBo bo) {
|
public AjaxResult confirmOrder(@RequestBody WeiOrderConfirmBo bo) {
|
||||||
log.info("=========确认订单======={}", JSONObject.toJSONString(bo));
|
log.info("=========确认订单======={}", JSONObject.toJSONString(bo));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package cn.qihangerp.model.bo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WeiOrderBo implements Serializable {
|
||||||
|
private String orderId;
|
||||||
|
private Long shopId;
|
||||||
|
private String startTime;
|
||||||
|
private String endTime;
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package cn.qihangerp.module.service;
|
||||||
import cn.qihangerp.common.PageQuery;
|
import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.PageResult;
|
import cn.qihangerp.common.PageResult;
|
||||||
import cn.qihangerp.common.ResultVo;
|
import cn.qihangerp.common.ResultVo;
|
||||||
|
import cn.qihangerp.model.bo.WeiOrderBo;
|
||||||
import cn.qihangerp.model.entity.WeiOrder;
|
import cn.qihangerp.model.entity.WeiOrder;
|
||||||
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
@ -14,7 +15,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
* @createDate 2024-06-03 16:48:31
|
* @createDate 2024-06-03 16:48:31
|
||||||
*/
|
*/
|
||||||
public interface WeiOrderService extends IService<WeiOrder> {
|
public interface WeiOrderService extends IService<WeiOrder> {
|
||||||
PageResult<WeiOrder> queryPageList(WeiOrder bo, PageQuery pageQuery);
|
PageResult<WeiOrder> queryPageList(WeiOrderBo bo, PageQuery pageQuery);
|
||||||
ResultVo<Integer> saveOrder(Long shopId, WeiOrder order);
|
ResultVo<Integer> saveOrder(Long shopId, WeiOrder order);
|
||||||
WeiOrder queryDetailById(Long id);
|
WeiOrder queryDetailById(Long id);
|
||||||
WeiOrder queryDetailByOrderId(String orderId);
|
WeiOrder queryDetailByOrderId(String orderId);
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,8 @@ import cn.qihangerp.common.ResultVoEnum;
|
||||||
import cn.qihangerp.common.enums.EnumShopType;
|
import cn.qihangerp.common.enums.EnumShopType;
|
||||||
import cn.qihangerp.mapper.ErpOrderItemMapper;
|
import cn.qihangerp.mapper.ErpOrderItemMapper;
|
||||||
import cn.qihangerp.mapper.ErpOrderMapper;
|
import cn.qihangerp.mapper.ErpOrderMapper;
|
||||||
import cn.qihangerp.model.entity.OOrder;
|
import cn.qihangerp.model.bo.WeiOrderBo;
|
||||||
import cn.qihangerp.model.entity.OOrderItem;
|
import cn.qihangerp.model.entity.*;
|
||||||
import cn.qihangerp.model.entity.WeiGoodsSku;
|
|
||||||
import cn.qihangerp.model.entity.WeiOrder;
|
|
||||||
import cn.qihangerp.model.entity.WeiOrderItem;
|
|
||||||
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
import cn.qihangerp.model.bo.WeiOrderConfirmBo;
|
||||||
import cn.qihangerp.mapper.WeiGoodsSkuMapper;
|
import cn.qihangerp.mapper.WeiGoodsSkuMapper;
|
||||||
import cn.qihangerp.mapper.WeiOrderItemMapper;
|
import cn.qihangerp.mapper.WeiOrderItemMapper;
|
||||||
|
|
@ -32,8 +29,12 @@ import org.springframework.util.StringUtils;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TW
|
* @author TW
|
||||||
|
|
@ -50,21 +51,54 @@ public class WeiOrderServiceImpl extends ServiceImpl<WeiOrderMapper, WeiOrder>
|
||||||
private final ErpOrderMapper erpOrderMapper;
|
private final ErpOrderMapper erpOrderMapper;
|
||||||
private final ErpOrderItemMapper erpOrderItemMapper;
|
private final ErpOrderItemMapper erpOrderItemMapper;
|
||||||
// private final MQClientService mqClientService;
|
// private final MQClientService mqClientService;
|
||||||
|
private final String DATE_PATTERN =
|
||||||
|
"^(?:(?:(?:\\d{4}-(?:0?[1-9]|1[0-2])-(?:0?[1-9]|1\\d|2[0-8]))|(?:(?:(?:\\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:(?:0[48]|[2468][048]|[13579][26])00))-0?2-29))$)|(?:(?:(?:\\d{4}-(?:0?[13578]|1[02]))-(?:0?[1-9]|[12]\\d|30))$)|(?:(?:(?:\\d{4}-0?[13-9]|1[0-2])-(?:0?[1-9]|[1-2]\\d|30))$)|(?:(?:(?:\\d{2}(?:0[48]|[13579][26]|[2468][048])|(?:(?:0[48]|[13579][26]|[2468][048])00))-0?2-29))$)$";
|
||||||
|
private final Pattern DATE_FORMAT = Pattern.compile(DATE_PATTERN);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<WeiOrder> queryPageList(WeiOrder bo, PageQuery pageQuery) {
|
public PageResult<WeiOrder> queryPageList(WeiOrderBo bo, PageQuery pageQuery) {
|
||||||
|
Long startTimestamp = null;
|
||||||
|
Long endTimestamp = null;
|
||||||
|
if(StringUtils.hasText(bo.getStartTime())){
|
||||||
|
Matcher matcher = DATE_FORMAT.matcher(bo.getStartTime());
|
||||||
|
boolean b = matcher.find();
|
||||||
|
if(!b){
|
||||||
|
bo.setStartTime("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.hasText(bo.getEndTime())){
|
||||||
|
Matcher matcher = DATE_FORMAT.matcher(bo.getEndTime());
|
||||||
|
boolean b = matcher.find();
|
||||||
|
if(!b){
|
||||||
|
bo.setEndTime("");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(StringUtils.hasText(bo.getStartTime())) {
|
||||||
|
bo.setEndTime(bo.getStartTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.hasText(bo.getStartTime())) {
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
LocalDateTime startTime = LocalDateTime.parse(bo.getStartTime()+" 00:00:00", formatter);
|
||||||
|
LocalDateTime endTime = LocalDateTime.parse(bo.getEndTime()+" 23:59:59", formatter);
|
||||||
|
|
||||||
|
startTimestamp = startTime.toEpochSecond(ZoneOffset.ofHours(8));
|
||||||
|
endTimestamp = endTime.toEpochSecond(ZoneOffset.ofHours(8));
|
||||||
|
}
|
||||||
LambdaQueryWrapper<WeiOrder> queryWrapper = new LambdaQueryWrapper<WeiOrder>()
|
LambdaQueryWrapper<WeiOrder> queryWrapper = new LambdaQueryWrapper<WeiOrder>()
|
||||||
.eq(bo.getShopId()!=null, WeiOrder::getShopId,bo.getShopId())
|
.eq(bo.getShopId()!=null, WeiOrder::getShopId,bo.getShopId())
|
||||||
.eq(StringUtils.hasText(bo.getOrderId()), WeiOrder::getOrderId,bo.getOrderId())
|
.eq(StringUtils.hasText(bo.getOrderId()), WeiOrder::getOrderId,bo.getOrderId())
|
||||||
.eq(bo.getStatus()!=null, WeiOrder::getStatus,bo.getStatus())
|
.eq(bo.getStatus()!=null, WeiOrder::getStatus,bo.getStatus())
|
||||||
|
.ge(StringUtils.hasText(bo.getStartTime()), WeiOrder::getCreateTime, startTimestamp)
|
||||||
|
.le(StringUtils.hasText(bo.getEndTime()),WeiOrder::getCreateTime,endTimestamp)
|
||||||
;
|
;
|
||||||
if(bo.getErpSendStatus()!=null){
|
// if(bo.getErpSendStatus()!=null){
|
||||||
if(bo.getErpSendStatus()==-1) {
|
// if(bo.getErpSendStatus()==-1) {
|
||||||
queryWrapper.lt(WeiOrder::getErpSendStatus,3);
|
// queryWrapper.lt(WeiOrder::getErpSendStatus,3);
|
||||||
}else {
|
// }else {
|
||||||
queryWrapper.eq(WeiOrder::getErpSendStatus, bo.getErpSendStatus());
|
// queryWrapper.eq(WeiOrder::getErpSendStatus, bo.getErpSendStatus());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Page<WeiOrder> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
Page<WeiOrder> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||||
if(page.getRecords()!=null){
|
if(page.getRecords()!=null){
|
||||||
|
|
@ -100,9 +134,9 @@ public class WeiOrderServiceImpl extends ServiceImpl<WeiOrderMapper, WeiOrder>
|
||||||
|
|
||||||
if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
||||||
// 更新
|
// 更新
|
||||||
WeiOrderItem itemUpdate = new WeiOrderItem();
|
|
||||||
itemUpdate.setId(taoOrderItems.get(0).getId());
|
item.setId(taoOrderItems.get(0).getId());
|
||||||
itemMapper.updateById(itemUpdate);
|
itemMapper.updateById(item);
|
||||||
} else {
|
} else {
|
||||||
// 新增
|
// 新增
|
||||||
item.setShopId(shopId);
|
item.setShopId(shopId);
|
||||||
|
|
@ -126,6 +160,7 @@ public class WeiOrderServiceImpl extends ServiceImpl<WeiOrderMapper, WeiOrder>
|
||||||
return ResultVo.success();
|
return ResultVo.success();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,21 +20,26 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="下单日期" prop="orderCreateTime">
|
<el-form-item label="下单日期" prop="startTime">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable @change="handleQuery"
|
||||||
v-model="queryParams.orderCreateTime"
|
v-model="queryParams.startTime"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="请选择订单创建时间">
|
placeholder="请选择订单创建时间">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="订单状态" prop="statusStr">
|
<el-form-item label="订单状态" prop="status">
|
||||||
<el-input
|
<el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable @change="handleQuery">
|
||||||
v-model="queryParams.statusStr"
|
<el-option label="待付款" value="10"></el-option>
|
||||||
placeholder="请输入订单状态"
|
<el-option label="礼物待收下" value="12"></el-option>
|
||||||
clearable
|
<el-option label="一起买待成团" value="13"></el-option>
|
||||||
@keyup.enter.native="handleQuery"
|
<el-option label="待发货" value="20"></el-option>
|
||||||
/>
|
<el-option label="部分发货" value="21"></el-option>
|
||||||
|
<el-option label="待收货" value="30"></el-option>
|
||||||
|
<el-option label="完成" value="100"></el-option>
|
||||||
|
<el-option label="全部商品售后之后,订单取消" value="200"></el-option>
|
||||||
|
<el-option label="未付款用户主动取消或超时未付款订单自动取消" value="250"></el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
|
@ -154,7 +159,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="收件人信息" align="center" prop="userName" >
|
<el-table-column label="收件人信息" align="left" prop="userName" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{scope.row.userName}}</span><br />
|
<span>{{scope.row.userName}}</span><br />
|
||||||
<span> {{scope.row.provinceName}} {{scope.row.cityName}} {{scope.row.countyName}}
|
<span> {{scope.row.provinceName}} {{scope.row.cityName}} {{scope.row.countyName}}
|
||||||
|
|
@ -168,9 +173,14 @@
|
||||||
<el-table-column label="订单状态" align="center" prop="status" >
|
<el-table-column label="订单状态" align="center" prop="status" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.status === 10 " size="small">待付款</el-tag>
|
<el-tag v-if="scope.row.status === 10 " size="small">待付款</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status === 12 " size="small">礼物待收下</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status === 13 " size="small">一起买待成团</el-tag>
|
||||||
<el-tag v-if="scope.row.status === 20 " size="small">待发货</el-tag>
|
<el-tag v-if="scope.row.status === 20 " size="small">待发货</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status === 21 " size="small">部分发货</el-tag>
|
||||||
<el-tag v-if="scope.row.status === 30 " size="small">待收货</el-tag>
|
<el-tag v-if="scope.row.status === 30 " size="small">待收货</el-tag>
|
||||||
<el-tag v-if="scope.row.status === 100 " size="small">完成</el-tag>
|
<el-tag v-if="scope.row.status === 100 " size="small">完成</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status === 200 " size="small">订单取消</el-tag>
|
||||||
|
<el-tag v-if="scope.row.status === 250 " size="small">未付款订单自动取消</el-tag>
|
||||||
<br/>
|
<br/>
|
||||||
<el-tag style="margin-top: 5px" type="warning" v-if="scope.row.auditStatus === 0 " size="small">待确认</el-tag>
|
<el-tag style="margin-top: 5px" type="warning" v-if="scope.row.auditStatus === 0 " size="small">待确认</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -459,17 +469,26 @@ export default {
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
handlePull() {
|
handlePull() {
|
||||||
if(this.queryParams.shopId){
|
if (!this.queryParams.shopId) {
|
||||||
this.pullLoading = true
|
this.$modal.msgError("请选择店铺");
|
||||||
pullOrder({shopId:this.queryParams.shopId}).then(response => {
|
return
|
||||||
console.log('拉取订单接口返回=====',response)
|
|
||||||
this.$modal.msgSuccess(JSON.stringify(response));
|
|
||||||
this.pullLoading = false
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.$modal.msgSuccess("请先选择店铺");
|
|
||||||
}
|
}
|
||||||
|
if (!this.queryParams.startTime) {
|
||||||
|
this.$modal.msgError("请选择下单时间");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.pullLoading = true
|
||||||
|
pullOrder({shopId:this.queryParams.shopId,startTime:this.queryParams.startTime}).then(response => {
|
||||||
|
console.log('拉取订单接口返回=====',response)
|
||||||
|
if(response.code === 200){
|
||||||
|
this.$modal.msgSuccess(JSON.stringify(response));
|
||||||
|
this.getList()
|
||||||
|
}else{
|
||||||
|
this.$modal.msgError(response.msg)
|
||||||
|
}
|
||||||
|
this.pullLoading = false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// this.$modal.msgSuccess("请先配置API");
|
// this.$modal.msgSuccess("请先配置API");
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue